File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes InputText event handling problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "InputText event handling problem" Watch "InputText event handling problem" New topic

InputText event handling problem

S Majumder
Ranch Hand

Joined: Jun 03, 2009
Posts: 346
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,
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968

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

Joined: Jun 03, 2009
Posts: 346
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 .

Jason Irwin
Ranch Hand

Joined: Jun 09, 2009
Posts: 327
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.



I agree. Here's the link:
subject: InputText event handling problem
It's not a secret anymore!