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:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
JSF
java.lang.NumberFormatException: For input string
Gina vernon
Ranch Hand
Posts: 108
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
I am get the following error when trying to dynamically load an htmldatatable:
Mar 29, 2011 9:13:43 AM com.sun.facelets.FaceletViewHandler handleRenderException SEVERE: Error Rendering View[/untitled1.xhtml] java.lang.NumberFormatException: For input string: "colA" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
View code:
<h:form id="form1"> <a4j:commandButton id="searchcomp" value="Search" reRender="gridPanel1" action="#{test.findComp}"/> <h:panelGrid id="gridPanel1" binding="#{test.gridPanel1}"> </h:panelGrid> </h:form>
Backing bean code:
private HtmlDataTable lbrrtdt; private HibernateDAO hdao = new HibernateDAO (); private HtmlPanelGrid gridPanel1; public void setGridPanel1(HtmlPanelGrid gridPanel1) { this.gridPanel1 = gridPanel1; } public HtmlPanelGrid getGridPanel1() { return gridPanel1; } public void findComp() { String qry = "select colA,colB from table"; ArrayList repData= (ArrayList)hdao.hibQryRes(qry); FacesContext facesContext = FacesContext.getCurrentInstance(); ELContext elContext = facesContext.getELContext(); Application application = facesContext.getApplication(); ExpressionFactory elFactory = facesContext.getApplication().getExpressionFactory(); UIColumn col = null; UIOutput txt = null; this.lbrrtdt = new HtmlDataTable(); this.lbrrtdt.setVar("rep"); lbrrtdt.setValue(repData); col = new UIColumn(); UIOutput header = new UIOutput(); header.setValue("header1"); col.setHeader(header); txt = new UIOutput(); ValueExpression valueExpression = elFactory.createValueExpression( elContext, "#{rep.colA}", String.class); txt.setValueExpression("value", valueExpression); col.getChildren().add(txt); this.lbrrtdt.getChildren().add(col); this.gridPanel1.getChildren().add(this.lbrrtdt); } public void setLbrrtdt(HtmlDataTable lbrrtdt) { this.lbrrtdt = lbrrtdt; } public HtmlDataTable getLbrrtdt() { return lbrrtdt; }
Data access layer is hibernate.
Hibernate entity code for colA:
<property name="colA" type="java.lang.String" not-null="true"/>
Any input appreciated.
Thanks.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Not able to submit datatable
programmatic HTmlCommandLink action with parameters not working
Dynamic t:dataTable display oddness.
Programmatically create HTMLextendeddatatable
Dynamic dataTable issue
More...