Where's the correct place to initialize a JSF custom component (in this case,
a subclass of HtmlForm)? Because much of my initializing involves
manipulating the component's children components, I decided to override
getChildren() and do my initialization there - BAD IDEA!

...it turns out that getChildren() is called BEFORE restoreState(), so when
you submit the form, restoreState isn't called and getChildren() fails
because it's in an uninitialized state.

I was thinking about using initializers or constructors, but then I figured
to avoid it because some initialization could depend on the component
properties getting populated first. (And initializers/constructors would be
called before those properties get populated, via their setters.)

It looks like I'm running out of options - what's the best practice on this?
Thanks.
-- 
View this message in context: 
http://www.nabble.com/Difficulties-of-initializing-a-custom-component-tp22655436p22655436.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.

Reply via email to