Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

selected value in h:selectOneMenu is not being sent to the managed bean  RSS feed

 
kishi kiran
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

I am in the process of migration from seam 2 to Javee6 and jsf1.2 to jsf2.0

I have h:selectOneMenu, which is JSF2.0 what i am using, when i select a value from selectOneMenu component that value is not being sent to the managed bean, i am getting null value.
here the query resulted data i am populating in selectOneMenu.

in seam framework we were using like :


but i am getting null value in managed bean while persisting,
can some one help me on this what is the correct wayto write custom converters?
or is it necessary to wite the converter?

Thanks in Advance!
Kiran.

 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have coded your View Template as though it was a program.

View Templates are not supposed to be executable, they're supposed to be templates.

So expressions like this:


Should read like this:


And actually, I recommend building the selectItems in the Model, so my preferred template structure would look more like this:


Beyond that, it looks like you are attempting to implement a Converter as a Managed Bean (Model). I'm actually doubtful that you even need a Converter if you have your Model set up like I indicated.


 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!