I've added Example #49 to my list of Not Yet Documented Samples called "Declarative and Programmatic Techniques to Pass Arguments to Method Action Bindings".
When you have a button that invokes a method in your data control, there are two ways you can pass the parameters: declaratively and programmatically. This small example contains two runnable Swing frames that illustrate each technique. The Form.java class illustrates the programmatic technique of adding an action binding listener for the action binding and setting the parameters list in the beforeActionPerformed() method. The FormDeclarative.java class uses a JTextField that is bound to a data control created for the simple MyBean class to hold a transient property value. The UIModel for the FormDeclarative page has a "sayHello" action binding, whose nested parameter definition refers declaratively to the value of the text field's binding object using the expression FormDeclarativeUIModel.name. In both cases, if you type your name into the text field and click the button, "Hello, YourName" appears in the log window.
9:02:08 AM
|
|