Solved

jsf drop down field hard code values

Posted on 2014-02-12
2
1,098 Views
Last Modified: 2014-02-21
Hi,

I would like to create a sample JSF XHTML page with a drop down with dummy Yes, No, Alright as drop down fields. How do I do that. I do not need to go to any bean to fetch those values. I want everything in the JSF xhtml page. Please advise

 Any links resources ideas highly appreciated. Thanks in advance
0
Comment
Question by:gudii9
2 Comments
 
LVL 19

Accepted Solution

by:
Ken Butters earned 500 total points
ID: 39864738
Here is an example:

http://www.mkyong.com/jsf2/jsf-2-dropdown-box-example/

In this example... you would just change from:
<f:selectItem itemValue="Cream Latte" itemLabel="Coffee3 - Cream Latte" />

to something like:

<f:selectItem itemValue="Yes" itemLabel="Yes" />
<f:selectItem itemValue="No" itemLabel="No" />
<f:selectItem itemValue="Alright" itemLabel="Alright" />
0
 
LVL 7

Author Comment

by:gudii9
ID: 39867696
//HTML output...
<select name="j_idt6:j_idt8" size="1">      
      <option value="Cream Latte">Coffee3 - Cream Latte</option>
      <option value="Extreme Mocha">Coffee3 - Extreme Mocha</option>
      <option value="Buena Vista">Coffee3 - Buena Vista</option>
</select>


I do not want to use any backing bean as given in the example, how to avoid backing bean.

what shall i replace 'j_idt6:j_idt8' with?

Can you please send the enitre xhtm.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now