• 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

Enable dynamic inputText

 
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi every body ,

I have created 3 radiobuttons and 3 inputText fields in a panel grid , they are divided in two separate columns .All text fields are initially disabled.When user click one radio button (say radio1) the corresponding text field (say inputText1)
will get enabled .Again if radio2 is clicked then inputText2 will become enabled.

My problem is I am not getting the proper ID value of inputText & for that reason am not enable textfield.

Here is my jsf code :



Here is my backing bean code :


please help.

regards,
SB
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, s begri
Since you using <h:selectitems /> tag for the options in radio button, the "dataMap" from your bakcing bean could be a single SelectItem instance or collection of SelectItem instance or an array of SelectItem instance or map whose entries represent SelectItem labels and values. I guess you only want to show the radio button without the label, so you can construct your "dataMap" like this:


the above codes give every option in radio a value, starting from 1.

then you can set up several boolean properties for your textfiled component, doing like


for the your getVal method, add the following codes:



by the way, the method you wrote setChieldInternationalTextField in your bean, i never seen it before, and i can't find it anywhere in JSF package. Could you tell me where it comes from.

Hope this help cheers!!
 
S Majumder
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you dude , I solved the problem
 
reply
    Bookmark Topic Watch Topic
  • New Topic