Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with SelectItems of SelectOneMenu  RSS feed

 
bee fouda
Greenhorn
Posts: 14
Eclipse IDE Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi !!
when i test by printing the selected item in the console , it always is returned as null

pleaaaaase i really need yur help i must fix this to finish my project before the deadline

there is the method in my ManagedBean



and here is my variables im my model


the methode that bring the variables from the batabase to put it in the SelctItem


and finally my html file


pleaaaaaaaaase help

 
Tim Holloway
Bartender
Posts: 18709
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We're not a good place to get emergency help, I'm afraid, since we don't have paid staff to answer questions quickly.

It will probably take several iterations to determine what you are really doing wrong, but here are some starting points:

1. What is the scope of the backing bean (programMB)?

2. Are you aware that you have coded several EL expressions in the form "{#programMB.xxxx}"? The correct form is "#{programMB.xxxx}".

3. You should not attempt to do "heavy" operations such as database functions in get/set methods. The get/set methods may be called many times in the processing of a JSF request, and that would cause redundant processing adding considerable overhead. Worse, if the code has side-effects, the the web application's internal state may be seriously impacted. It's OK to fetch stuff from a database in a "get" method as long as the first time caches the results and the subsequent accesses use the cached value instead of going back to the database, although this isn't the ideal. "set" methods, however, should not attempt to update a database. Leave that job to the action method.
 
bee fouda
Greenhorn
Posts: 14
Eclipse IDE Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In both of them i just putted # in the wrong place. change value="{#programMB.np}" to value="#{programMB.np}" and value="{#programMB.program.matricule}" to value="#{programMB.program.matricule}"
and it worked :)
it was a banal mistake thank you Tim Holloway
you really helped me :)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!