Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Multiple selectOneMenu that always return same last value

 
nassim nayer
Greenhorn
Posts: 2
Java MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

in a JSF page iam trying y to create a flight that have a departure city and an arrival city i have two selectOneMenu populated from a proprity bean ( List of cities feeded from a database ): so the same values for both.

the point is that after the creation of the flight both components carry the value of the last selectOneMenu ?

i just wana know what is happening in my application.

here a sample from my jsf page :




Thanks

 
Tim Holloway
Saloon Keeper
Pie
Posts: 18212
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Nassim!

It's hard to say. Are these tags embedded within an "h:form" element withing a JSF view element in the JSF View source? If not, the data won't submit properly.

The other possibility is that your selectItem list doesn't match the selection.This can happen easily if you're using Request Scope. JSF tends to require Session Scope more than most other J2EE platforms. In JSF 2 they added an intermediate scope (View Scope) to make things a little easier.
 
nassim nayer
Greenhorn
Posts: 2
Java MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Tim Holloway,
thanks ! , to be honest iam a fan of ranch forums


Yes , the data is submited and inserted into the database , just a small summarization :
-it is about adding flights , each flight have a departure and an arrival city.
-in the form we have two selectOneMenu one for the departure and one for the arrival
-these two selectOneMenu are using the same Liste <City> from a beans.

the point is : after the submit both components carry the same value (always the value of the seconde selectOneMenu)

so if i choose departure paris arrival new york for a specific flight i always get after the submit departure city :new york , arrival city : new york .

i think it is a part of a case raised by :
http://www.coderanch.com/t/487296/JSF/java/Multiple-selectOneMenu-same-value

best regards




 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic