DataFX flow linking to different classes depending on situation

90 views
Skip to first unread message

keishm...@gmail.com

unread,
Jan 20, 2015, 8:37:57 PM1/20/15
to dataf...@googlegroups.com
Hi there,

So right now I have two classes linked via
.withAction(Scene1Controller.class, "next", new FlowActionChain(new FlowMethodAction("searchAction"), new FlowLink<Scene2Controller>(Scene2Controller.class)))

which works fine as it runs the @ActionMethod("searchAction") defined in Scene1Controller then moves into the next flow when I click the "next" button defined with ActionTrigger as per the tutorials.

Lets say Scene1 has 4 radio buttons: Location1 Location2 Location3 Location4
What I want to do is I want to choose where my "next" button takes me depending on which radio button is selected.

for example:
if(Location1.isSelected){ flow.takemeto(Scene1.class)}
if(Location2.isSelected){ flow.takemeto(Scene2.class)}
if(Location3.isSelected){ flow.takemeto(Scene3.class)}
if(Location4.isSelected){ flow.takemeto(Scene4.class)}

Something like above I was wondering if this is possible?
I am guessing I have to use handlers or something I'm not sure.  I am sort of coding in the dark here with DataFX....

Hendrik Ebbers

unread,
Jan 21, 2015, 2:00:14 AM1/21/15
to dataf...@googlegroups.com
Hi,

for this point a tutorial is still missing. To define dynamic actions you need to use the FlowActionHandler. This can be simply injected in any view by using the @ActionHandler annotation. Here is a small example:

public class MyController {

    @ActionHandler
    protected FlowActionHandler actionHandler;

    public void doSomething() {
        actionHandler.handle("actionId");
        //or
        actionHandler.navigate(NextController.class);
    }
}

You can now define the classes or the action IDs as data for the radio buttons.

Hao Wu

unread,
Mar 16, 2015, 5:56:09 AM3/16/15
to dataf...@googlegroups.com
Can you tell me what package do I need to conclude to have @ActionHandler?

I can't find this in io.datafx.flow 8.0.1、io.datafx.core 8.0.1 or io.datafx. 8.0.1

Hao Wu

unread,
Mar 16, 2015, 5:57:32 AM3/16/15
to dataf...@googlegroups.com
I'm so sorry,
It has @ActionHandler, sorry.

Hao Wu

unread,
Mar 16, 2015, 6:00:15 AM3/16/15
to dataf...@googlegroups.com
If the NextController has a bigger size view,
How to make NextController use its original size?
Reply all
Reply to author
Forward
0 new messages