Mick Knutson wrote:
I am looking for a best practices for creating BackingBeans with sub objects.

Such as, I want a UserBackingBean that has a User associated with it.


But I have done that, but use:

                        <h:inputText id="firstName"
value="#{UserBackingBean.user.firstName}">
                            <f:validateLength minimum="2"
                                              maximum="25" />
                        </h:inputText>

The class that UserBackingBean refers to needs to define a method
 User getUser()

The User class needs to define
 String getFirstName()

Everything should then work fine. This is all standard JavaBeans conventions.

Regards,

Simon

Reply via email to