I am developing a web application using JSF, that needs a dropdown box which is pre-populated with common values. But if the user doesn't find the value they need, they should be able to enter one. Is there any such component in JSF? If not, are there alternatives to solving this issue?
You might use a workaround. Have the drop down list activates another textfield only when the user selects "Other" option. Tell me if you need a working example on how to do it.
Joined: Mar 14, 2006
Thanks Tak Ng, I would appreciate a working example, if you have one available...
Joined: Jun 05, 2007
These are the steps taken by JSF life cycle: 1) if the drop down menu changes, selectedOptionChanged will get called. 2) if the value of selectedOption is "other", the flag activateOtherInput is activated; otherwise, it is off. 3) the other input textfield appears depending on the flag activateOtherInput.