• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

User input either from drop down list or input text filed

 
Ranch Hand
Posts: 242
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to craete a JSF page. I want to get the user input either from a drop down list or input text field
If the user starts typing in "input text" then the drop down list should be disabled. Otherwise if the user selects a name from the drop down list, then input text filed should be disabled. I tried as follows. But it doesn't work properly. Can anyone give me some suggestion?



 
Gopu Akraju
Ranch Hand
Posts: 242
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Should I use Ajax for this? But I haven't used it before.
So any simple solution for the above situation? Thanks.
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What you are describing closely resembles a ComboBox control, except that a traditional ComboBox doesn't actually disable the list, since typing can be used to more rapidly locate an entry in the list. A variation of this for Web 2.0 is to use AJAX to cause the list to dynamically adjust itself based on what has already been typed.

Basic HTML does not support a ComboBox control, although a lot of OS native GUIs do. Because of that, you have to use JavaScript to glue a TextBox and a Select control together. Or, better yet, find a JSF extension tag library that does ComboBoxes for you.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic