?
Solved

jsf drop down field hard code values

Posted on 2014-02-12
2
Medium Priority
?
1,219 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 19

Accepted Solution

by:
Ken Butters earned 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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…
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.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses
Course of the Month13 days, 8 hours left to enroll

800 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