【问题标题】:Datafx Link Action (Not working)Datafx 链接操作(不工作)
【发布时间】:2015-07-05 08:41:00
【问题描述】:

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

【问题讨论】:

    标签: java javafx java-8


    【解决方案1】:

    代码没有问题,但似乎用于 datafx 的 jar 已损坏。 Download all jar for datafx from Mavern repository

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-05-03
      • 2023-04-08
      • 2015-09-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-05-14
      相关资源
      最近更新 更多