试图了解为什么我的 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
) Controller 。查看显示,但我会点击按钮没有任何反应
我添加了 bTestAction
看看我是否可以通过 linkaction
注释让它发生,但没有任何反应。
@FXMLController("fxml/DeliverableEditFXML.fxml")
public class DeliverableEditFXMLController {
@FXMLViewFlowContext
private ViewFlowContext context;
@FXML
@ActionTrigger("bSaveAction")
private Button bSave;
}
上面是详细信息 Controller ,您可以看到试图让 bSave
按钮返回主视图。
目前 bEdit
按钮不会将我带到 Detail
View 。如果有人能帮助我理解有什么问题,将不胜感激。
最佳答案
代码没有问题,但似乎用于 datafx 的 jar 已损坏。 Download all jar for datafx from Mavern repository
关于java - Datafx 链接操作(不工作),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29886520/