• 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

InputText event handling problem  RSS feed

 
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi every body ,

I have a <h:inputText> field .When I am filling some value on it say a value like "test" , I want add that value in a combo box.I am not able to do that .

Please any body help me out to solve this problem.

Thanks & regards,
S
 
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What have you tried?

Does this action happen when the client hits a submit button?

Show us your code.

-Cameron McKenzie
 
S Majumder
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply ,

No there is no submit button in my app.

Here is a small code of jsf :



When I enter some data (say "test" )in the input text the "renderCombo" will be true in the backing bean & the combo will visible in my jsf page with the test value .

Here is my Backing bean code :



sould I write some kind of evet for that ?
Please help .

regards,
S.
 
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unless I am totally misunderstanding, you need some kind of submit. If there isn't, the page will not be re-rendered and your control not displayed.

As far as I see it, you have two choices
1) Render the combo and use custom javascript to hide it when the client displays the page. Then use further custiomer javascript to display it when the user enters a value ("style.display=block", etc) and then add the enetered value to the list. This means no submit back to the server, but you run the risk of the client and server being out of sync. I don't recommend this.

2) I've not worked with RichFaces (which is what I think you are using), but I think that if you add an "onchange" event to your input box, you might get your desired result. At the moment it looks like that it is the combo that will fire the submit event, but as tht isn't displayed there's no way to change it.

HTH,

J.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!