4 Replies Latest reply on Sep 4, 2013 3:08 PM by Christian Sadilek

    PropertyChangeHandler for Chained Bindings

    Chris Holz Newbie

      Hello there,

       

      is there any way to add a PropertyChangeHandler for chained bindings?

       

      @Inject @AutoBound DataBinder<User> dataBinder;

       

      @Inject @DataField @Bound String name;

       

      dataBinder.addPropertyChangeHandler(new PropertyChangeHandler<User>() {

                  @Override

                  public void onPropertyChange( PropertyChangeEvent<User> event ) {

                      //do something

                  }

      });

       

      Works just fine, however

       

      @Inject @AutoBound DataBinder<User> dataBinder;

       

      @Inject @DataField @Bound(property="adress.street") String street;

       

      dataBinder.addPropertyChangeHandler(new PropertyChangeHandler<User>() {

                  @Override

                  public void onPropertyChange( PropertyChangeEvent<User> event ) {

                      //do something

                  }

      });

       

      Won't trigger a change event. I could of course add a ValueChangeHandlers to each widget. But when those fire the DataBinder hasn't received the updated value yet. Currently my inline validation relies on the whole data object (JSR 303), so I can't really use the widget's ValueChangeHandlers.

      I'm using Errai 2.3.2 Final.  Any ideas?

       

      Thanks!!

       

      Chris