In what order are the methods of ValueAwareEditor called ?

60 views
Skip to first unread message

Leonel Gayard

unread,
Sep 20, 2011, 12:42:28 PM9/20/11
to google-we...@googlegroups.com
Hi,

I have a custom widget that implements ValueAwareEditor[1].

In what order are the methods setEditorDelegate(), setValue(), subscribe() and flush() called ?

Are they called before or after methods setValue in the sub-editors are called, for each property of the bean ?

More specifically, my editor contains fields for a Person object, and there are two Radio buttons to select his/her gender (Male or Female). This is method setValue in my editor:

@Override
public void setValue(Person person) {
    if (person.getGender() == null) {
        person.setGender(MALE);
    }
}

Is this code safe ? Is there any combination of calls to setValue in the subeditors or in the editor itself that may cause the bean's property gender to be null or the radio buttons not selected ?

Thanks,
Leonel


Reply all
Reply to author
Forward
0 new messages