Hi,
quite unusal to me using a behavior to set a model.

Why dont you delegate to your inner textfiled by implementing an own setXYZModel()-method?

Or bind your inner textfield direct by providing a particular model in your Constructor of your custom MyFormComponentPanel?
And no onInitialize()-method...

public class MyFormComponentPanel extends FormComponentPanel {
  public MyFormComponentPanel(IModel myModel){
    add(new TextField("id", myModel));
  }
}
(add generics if needed)


Patrick

Am 08.04.2015 um 09:27 schrieb mscoon:
Hi all,

I have a FormComponentPanel. Is it okay if I set its components models
using a behavior that overrides onConfigure() as below?

public class MyFormComponentPanel extends FormComponentPanel {

     protected void onInitialize() {
super.onInitialize();
                 componentA = new TextField...
                 componentA.add(new Behavior() {
                          @Override
public void onConfigure(Component component) {
                                  componentA.setModel(...);
                          }
                 });
}

thanks



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to