This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Grokking Bitcoin and have Kalle Rosenbaum on-line!
See this thread for details.
Win a copy of Grokking Bitcoin this week in the Cloud/Virtualization forum!
  • 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
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
Bartenders:
  • Carey Brown
  • salvin francis
  • Claude Moore

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?
 
Saloon Keeper
Posts: 20643
122
Android Eclipse IDE Java Linux Redhat Tomcat Server
  • 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
Posts: 20643
122
Android Eclipse IDE Java Linux Redhat Tomcat Server
  • 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?
 
These are the worst of times and these are the best of times. And this is the best tiny ad:
Create Edit Print & Convert PDF Using Free API with Java
https://coderanch.com/wiki/703735/Create-Convert-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!