Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSF- selectone menu

 
devika vijay
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 17995
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Devika!

One label/two values kind of breaks the idea of selectOneMenu, don't you think?
 
devika vijay
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 17995
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic