试图了解为什么我的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视图。如果有人可以帮助我了解发生了什么问题,将不胜感激。

最佳答案

代码没有错,但是好像jar用于datafx的代码坏了。
Download all jar for datafx from Mavern repository

10-06 07:17