I'm wondering, what is the 'best' way to provide form data to an
action. What I have been doing follows, first create an action class
that gets its input from some components.

public class MyAction extends Action
{
     @WTKX private TextInput input

    @Override
    public void perform() {
        doSomething(input.getText());
    }
}

When the program starts, I'm left adding the actions, then after
loading the wtkx file, then calling bind on my actions to load
components.

NamedActionDictionary nd = Action.getNamedActions();
        nd.put("myAction", new MyAction());
...
...

WTKXSerializer wtkxSerializer = new WTKXSerializer();
window = (Frame) wtkxSerializer.readObject(this, "mainWindow.wtkx");
for (String act : Action.getNamedActions())
        {
            wtkxSerializer.bind(Action.getNamedActions().get(act));
        }

Is there a better way?

Thanks,
 -Mike

Reply via email to