• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

JSF- selectone menu  RSS feed

 
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?
 
Bartender
Posts: 20120
103
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
Bartender
Posts: 20120
103
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?
 
Police line, do not cross. Well, this tiny ad can go through:
Programmatically Create PDF Using Free Spire.PDF with Java
https://coderanch.com/wiki/703735/Programmatically-Create-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!