aspose file tools*
The moose likes JSF and the fly likes SelectItem Help needed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "SelectItem Help needed" Watch "SelectItem Help needed" New topic
Author

SelectItem Help needed

Omar Barrera
Greenhorn

Joined: Aug 17, 2005
Posts: 15
I need some help with an issue that is driving me mad. I have a state list populated by a bean. I have my form, and it displays correctly. However, the value selected in the list is never saved. I can not figure out what is wrong with my code. FYI, I am using the MyFaces implementation of JSF. Here is my code.

statebean



Sachin Satija
Greenhorn

Joined: Aug 24, 2005
Posts: 28
The code looks good.... I tried copying the code in a test project and it worked... On the click of a submit button the state is getting saved.... Here are a few things I would suggest(if you haven't already done that):
1.) Check if any other text box in the form which is binded to the same value(i.e selected state).

2.) Try Taking this code out in a test project and use a couple of jsps to achieve the results.


P.S: I used My Faces 1.1.4 and Java Compiler 1.4. So had to change List<T> to List but that should not effect.

What is the Myfaces version you are using and also can you paste the complete JSP page and the faces-config.xml.

Sachin


SCJP1.4--91%<br />IBM 399
Omar Barrera
Greenhorn

Joined: Aug 17, 2005
Posts: 15
Hello Sachin, thank you for responding promptly. I am using MyFaces 1.1.5 and java 5. Unfortunately I am not at liberty to post my jsp page. I appreciate your response on this matter. However I will say that my other jsf components are binding with the component via the jsf api properly. This leads me to believe that there is some weird behavior occurring because of the portlet container I am using. Very discouraging, but I will continue to try and isolate the problem.

Kind Regards,

Omar
Bhaskar GR
Greenhorn

Joined: Jun 13, 2008
Posts: 28
Hi ,First write binding input to slectOneMenu in jsp page.Write

private HtmlSelectOneMenu inputBinding;
in method calling
SelectOnemenuoriginalValue=inputBinding.getSubmittedValue.toString();
It gives wht you selected value;
Zack Marrapese
Greenhorn

Joined: Jul 02, 2008
Posts: 27
I believe that since you set immediate="true", it's never getting to the point where it actually puts the new value into the backing bean....it just skips ahead to rendering the response.
~Zack
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SelectItem Help needed