• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SelectItem Help needed

 
Omar Barrera
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Omar Barrera
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic