试图理解为什么我的datafx流不起作用。我有2个课程WIPController.class(Master)
和DeliverableEditFXMLController.class(Detail)
以下是我创建流程的方法
StackPane pane = new StackPane();
DefaultFlowContainer flowContainer = new DefaultFlowContainer(pane);
Flow flow = new Flow(WIPController.class)
.withLink(WIPController.class, "bEditAction", DeliverableEditFXMLController.class)
.withLink(DeliverableEditFXMLController.class, "bSaveAction", WIPController.class)
;
flow.createHandler().start(flowContainer);
Scene scene = new Scene(pane);
Stage stage = new Stage();
stage.setScene(scene);
stage.show();
以下是裸WIPController.class
@FXMLController(value="fxml/WIP.fxml")
public class WIPController {
@FXMLViewFlowContext
private ViewFlowContext context;
@FXML
private TreeTableView<CaseDeliverable> ttblWIP;
@FXML
@LinkAction(DeliverableEditFXMLController.class)
private Button bTestAction;
@FXML
@ActionTrigger("bEditAction")
private Button bEdit; }
bEdit
按钮用于转到(Details
)控制器。查看显示,但我点击按钮没有任何反应
我添加了bTestAction
,看看我是否可以通过linkaction
注释实现它,但没有任何反应。
@FXMLController("fxml/DeliverableEditFXML.fxml")
public class DeliverableEditFXMLController {
@FXMLViewFlowContext
private ViewFlowContext context;
@FXML
@ActionTrigger("bSaveAction")
private Button bSave;
}
上面是详细信息控制器,您可以看到尝试将bSave
按钮带回主视图。
当bEdit
按钮没有事件时,我会转到Detail
视图。如果有人能帮助我理解错误的话会非常感激。