Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

drop down list question  RSS feed

 
jim li
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi everyone,

i have the following question:

i am using the following code to display a list of information. In the drop down list, there is a hard coded choice called "other", i want to display an extra
input field when the client chooses "other", and make the input field disappear when the client chooses any other options.
<af:selectOneChoice >
<f:selectItems value="" />
</af:selectOneChoice>

i am unable to find a way to design it , please give me some suggestions.

thank you
 
Vincent Zhao
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use value change listener:
 
jim li
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you for your help
 
Samuel March
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<f:selectItem itemValue="value" itemLabel="extra" render="#{MyBean.selRenderBoolean}" />

Write a boolean method pair for setting an element
render of the response for the validation method
or boolean method and property for calling with the
onchange listener method of the h:selectOneListbox
You need a render= attribute on a f:selectItem
and write another method in your bean for the actual
h:selectOneListbox and put a render= attribute on that(h:selectOneListbox) too.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!