• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

InputText event handling problem

 
S Majumder
Ranch Hand
Posts: 349
  • 0
  • 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
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • 0
  • 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
  • 0
  • 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.
 
Jason Irwin
Ranch Hand
Posts: 327
  • 0
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic