Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

jsf drop down field hard code values

Posted on 2014-02-12
2
Medium Priority
?
1,261 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

610 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