aspose file tools*
The moose likes JSF and the fly likes JSF- selectone menu Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF- selectone menu" Watch "JSF- selectone menu" New topic
Author

JSF- selectone menu

devika vijay
Greenhorn

Joined: Aug 22, 2012
Posts: 3
i have a requirement. like
<f:selectItem itemValue = "C" itemLabel="Consultant" />
<f:selectItem itemValue = "N" itemLabel="Consultant" />
<f:selectItem itemValue = "E" itemLabel="Employee" />
<f:selectItem itemValue = "T" itemLabel="Temporary" />

in drop down it listing "Consultant" twice.

is it possible to have single itemlabel for 2 itemvalue?how?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16228
    
  21

Welcome to the JavaRanch, Devika!

One label/two values kind of breaks the idea of selectOneMenu, don't you think?


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

Joined: Aug 22, 2012
Posts: 3
But in some cases like there are many students in one college, if we select any o fthe student it s'd display same college name right?

how can we achieve this? anything using managed bean?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16228
    
  21

This has nothing to do with JSF. You need to think about how you're doing you basic GUI layout.

Certainly I'd expect that if the list selected students, the student's name would be the label, not the college. If you want to select multiple students - whether from one college or many, a select ONE control isn't what you need, you need some sort of select MANY control.
devika vijay
Greenhorn

Joined: Aug 22, 2012
Posts: 3
i just told you the example, our requirement is:

two itemvalue 'C' and 'N' come under same group i.e item label 'Consultant'

when C or N is selected, it sholud display consultant from dropdown automatically.

Any one has solution for this?
 
Consider Paul's rocket mass heater.
 
subject: JSF- selectone menu