aspose file tools*
The moose likes JSF and the fly likes Multiple  selectOneMenu  that  always return same last value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Multiple  selectOneMenu  that  always return same last value " Watch "Multiple  selectOneMenu  that  always return same last value " New topic
Author

Multiple selectOneMenu that always return same last value

nassim nayer
Greenhorn

Joined: Mar 08, 2011
Posts: 2

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

Joined: Jun 25, 2001
Posts: 16145
    
  21

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
nassim nayer
Greenhorn

Joined: Mar 08, 2011
Posts: 2

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




 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Multiple selectOneMenu that always return same last value