Datafx链接操作(不工作)

时间:2015-04-27 03:06:45

标签: java javafx java-8

试图理解为什么我的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视图。如果有人能帮助我理解错误的话会非常感激。

1 个答案:

答案 0 :(得分:0)

代码没有错,但似乎jar正在使用datafx被打破了。 Download all jar for datafx from Mavern repository