Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Strange selectOneListbox problem

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:outputText value="Add new Issue for #{prjsys.projectSystemCode} : #{prjsys.projectSystemTitle}"
style="font-weight : bold" rendered="#{passData.passAction == 'Add'}"/>

<h:outputText 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:outputText value="Please do not enter any sensitive data." style="color : red; font-weight : bold"/>
<f:verbatim><br></f:verbatim>

<h:panelGrid columns = "3">
<h:outputText value="Issue #"/>
<h:outputText value="New Issue" rendered="#{passData.passAction == 'Add'}"/>
<h:outputText value="#{thisIssue.issueId}" rendered="#{passData.passAction == 'Edit'}"/>
<h:outputText value=""/>

<h:outputText value="Title:"/>
<h:inputText id="newTitle" value="#{thisIssue.title}" size="107"/>
<h:message for="newTitle" style="color : red; font-weight : bold"/>

<h:outputText 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:outputText 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:outputText value=" Add new attachment(s)"/>

<f:verbatim>
<div id="appFooter"></div>
<br>   
</f:verbatim>
</h:form>
 
Ian Dunsirn
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic