Hi all,
I want to have my drop down value pre-selected with appropriate option when user visit the
page.
The following is my page for showing role selection dropdown.
| <s:decorate id="role"
template="layout/display.xhtml">
| <ui:define name="label">role</ui:define>
| #{wiseUser.wiseUserRole.roleName}
| </s:decorate>
|
| <s:decorate id="valueDecoration"
template="layout/edit.xhtml">
| <ui:define name="label">Title</ui:define>
| <h:selectOneMenu value="#{wiseUser.wiseUserRole}">
| <s:selectItems value="#{wurList}" var="wur"
label="#{wur.roleName}" noSelectionLabel="Please select" />
| <s:convertEntity />
| </h:selectOneMenu>
| </s:decorate>
|
My WiseUser entity has a mapping to WiseUserRole
| @ManyToOne(fetch = FetchType.LAZY)
| //@ManyToOne(fetch = FetchType.EAGER)
| @JoinColumn(name = "UserRole")
| public WiseUserRole getWiseUserRole() {
| return this.wiseUserRole;
| }
|
When use FetchType.EAGER, then the dropdown box is correctly preselected with the
user's role, however when FetchType.LAZY it's always present "Please
select" option.
How to get the dropdown correctly preselected without using the EAGER fetching?
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112193#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...