Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within JSF
Search Coderanch
Advance search
Google search
Register / Login
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
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Tim Cooke
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Liutauras Vilda
Sheriffs:
Rob Spoor
Junilu Lacar
paul wheaton
Saloon Keepers:
Stephan van Hulst
Tim Moores
Tim Holloway
Carey Brown
Scott Selikoff
Bartenders:
Piet Souris
Jj Roberts
fred rosenberger
Forum:
JSF
Unable to get “value” attribute of <ice:selectManyCheckbox>
Adnan Gondal
Ranch Hand
Posts: 35
posted 10 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I am unable to get value using
<ice:selectManyCheckbox>
that is I am unable to correctly access value attribute of
<ice:selectManyCheckbox>
. In data table value is coming in this form java.stringa34567 whereas it should be "MCS", "MS" or "PHD". I am accessing it in this way. Please help?
Employee:-
public class Employee{ private String[] qualification; public String[] getQualification() { return qualification; } public void setQualification(String[] qualification) { this.qualification = qualification; } }
EmployeeBean:-
import java.util.Arrays; import java.util.Iterator; import java.util.ArrayList; import java.util.List; import javax.faces.context.FacesContext; import javax.faces.event.ActionEvent; import javax.faces.model.SelectItem; import javax.faces.component.*; import javax.faces.component.html.*; import javax.faces.event.ValueChangeEvent; import com.icesoft.faces.component.selectinputtext.SelectInputText; public class EmployeeBean{ private Employee employee; private ArrayList<Employee> empList; public void add(){ Employee emp = new Employee(employee.getQualification()); empList.add(emp); } public List<SelectItem> getQualif() { return qualif; } }
index.jspx:-
<?xml version="1.0" encoding="utf-8" ?> <jsp:root version="1.2" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ice="http://www.icesoft.com/icefaces/component"> <jsp:directive.page contentType="text/html;charset=utf-8" /> <f:view> <ice:outputDeclaration doctypeRoot="HTML" doctypePublic="-//W3C//DTD HTML 4.01 Transitional//EN" doctypeSystem="http://www.w3.org/TR/html4/loose.dtd" /> <html> <head> <title>ICEfaces, Ajax for Java EE</title> <link rel="stylesheet" type="text/css" href="./xmlhttp/css/rime/rime.css" /> </head> <body> <ice:form id="f"> <ice:outputText value="Qualification"/> <ice:selectManyCheckbox id="q" value="#{emp.employee.qualification}"> <f:selectItems value="#{emp.qualif}"/> </ice:selectManyCheckbox> <ice:dataTable value="#{emp.empList}" var="e" border="2"> <ice:column> <f:facet name="header"> <ice:outputText value="Qualification"/> </f:facet> <ice:outputText value="#{e.qualification}"/> </ice:column> </ice:dataTable> </ice:form> </body> </html> </f:view> </jsp:root>
Kumaravadivel Subramani
Ranch Hand
Posts: 171
I like...
posted 10 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Can you please post your faces-config.xml, not able to find the managed bean here.
No pain, No gain.
OCJP 1.6, Liferay Certified Developer 6.1
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Problem with JSF
error displaying values in the datatable
IceFaces 1.8 dataTable-sort example gives error
Icefaces Datatable
To Refresh the Dynamic data to the JSF Page automatically
More...