| Author |
Strange selectOneListbox problem
|
Ian Dunsirn
Ranch Hand
Joined: May 25, 2006
Posts: 36
|
|
I am having the weirdest problem. I have a page with some components, one of which is a button. This button was working fine until I put in a selectOneListbox, calling it's listener method like a pro. I put in the selectOneListbox and suddenly the button doesn't seem to work, not callings its method. I have included the jsp code. The listener method is just three debug lines telling me that it was called. The strange thing is, if I replace the f:selectItems with an empty list, things seem to work fine. Can anyone point out what I may be missing here? All my beans are defined and populated. <h:form> <f:verbatim> <p> </f:verbatim> <h utputText value="Add new Issue for #{prjsys.projectSystemCode} : #{prjsys.projectSystemTitle}" style="font-weight : bold" rendered="#{passData.passAction == 'Add'}"/> <h utputText value="Edit Issue for #{prjsys.projectSystemCode}: #{prjsys.projectSystemTitle}" style="font-weight : bold" rendered="#{passData.passAction == 'Edit'}"/> <f:verbatim> <div id="appFooter"></div> <br> </f:verbatim> <h utputText value="Please do not enter any sensitive data." style="color : red; font-weight : bold"/> <f:verbatim><br></f:verbatim> <h:panelGrid columns = "3"> <h utputText value="Issue #"/> <h utputText value="New Issue" rendered="#{passData.passAction == 'Add'}"/> <h utputText value="#{thisIssue.issueId}" rendered="#{passData.passAction == 'Edit'}"/> <h utputText value=""/> <h utputText value="Title:"/> <h:inputText id="newTitle" value="#{thisIssue.title}" size="107"/> <h:message for="newTitle" style="color : red; font-weight : bold"/> <h utputText value="Issue Description:"/> <h:inputTextarea id="newDescription" value="#{thisIssue.description}" rows="5" cols="80"/> <h:message for="newDescription" style="color : red; font-weight : bold"/> </h:panelGrid> <f:verbatim> <div id="appFooter"></div> <br> </f:verbatim> <h utputText value="Status:" style="padding: 0px 100px 0px 0px"/> <h:selectOneListbox id="newStatus" size="1" value="#{thisIssue.status}" immediate="true"> <f:selectItems value="#{dropDown.statusList}"/> </h:selectOneListbox> <h:commandButton image="images/AddButton.gif" action="#{issueListener.addAttachment}"/> <h utputText value=" Add new attachment(s)"/> <f:verbatim> <div id="appFooter"></div> <br> </f:verbatim> </h:form>
|
 |
Ian Dunsirn
Ranch Hand
Joined: May 25, 2006
Posts: 36
|
|
|
I am such a newb. I figured out that the problem lies in my command button. I put in the attribute immediate="true" and everything works like it should.
|
 |
 |
|
|
subject: Strange selectOneListbox problem
|
|
|