Solved

jsf drop down field hard code values

Posted on 2014-02-12
2
1,115 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
mockito example issue 8 72
oracle 11g 23 73
expectj telnet failing 5 35
hibernate example for saving data 19 37
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…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

808 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