Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Enable dynamic inputText

 
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • Quote
  • Report post to moderator
Thank you dude , I solved the problem
 
No matter. Try again. Fail again. Fail better. This time, do it with this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!