This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "InputText event handling problem" Watch "InputText event handling problem" New topic
Author

InputText event handling problem

S Majumder
Ranch Hand

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

Joined: Aug 26, 2006
Posts: 4968
    
    1

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: 244
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

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.

HTH,

J.


SCJP6
 
Consider Paul's rocket mass heater.
 
subject: InputText event handling problem
 
Similar Threads
SQLJ in Netbeans
POST request and reading data two time
setting request header
how to map one-to-one relation
Servlet Headers Problem