File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to display dynamic columns in h:dataTable ?

 
Arun Kandregula
Greenhorn
Posts: 26
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
May I know how to display dynamic columsn in dataTabel.

I tried with Rich Faces.



Here is the problem : I didnt find a solution to display dynamic columns in standard JSF. So I resorted to richfaces.
But there, with the above tag, it is not recognizing the local variable priceTypeRow.

It throws below exception :

EV 14:22:52 ERROR ColumnsHandler - FOREACH_BAD_ITEMS
avax.servlet.jsp.JspTagException: FOREACH_BAD_ITEMS
at org.richfaces.iterator.SimpleForEachIterator.toForEachIterator(Simple
orEachIterator.java:135)
at org.richfaces.iterator.SimpleForEachIterator.supportedTypeForEachIter
tor(SimpleForEachIterator.java:98)
at org.richfaces.taglib.ColumnsHandler.prepare(ColumnsHandler.java:304)
at org.richfaces.taglib.ColumnsHandler.apply(ColumnsHandler.java:489)
at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentH
ndler.java:314)
at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java
169)
at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHa
dler.java:47)
at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentH
ndler.java:314)
at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java
169)
at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentH
ndler.java:314)
at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java
169)
at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHa
dler.java:47)
at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentH
ndler.java:314)
at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java
169)
at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentH
ndler.java:314)
at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java
169)
at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHa
dler.java:47)
at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentH
ndler.java:314)
at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java
169)
at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentH
ndler.java:314)
at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java
169)
at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHa
dler.java:47)
at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentH
ndler.java:314)
at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java
169)
at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHa
dler.java:47)
at com.sun.facelets.tag.jsf.core.ViewHandler.apply(ViewHandler.java:109)

at com.sun.facelets.tag.ui.DefineHandler.applyDefinition(DefineHandler.j
va:64)
at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.j
va:131)
at com.sun.facelets.impl.DefaultFaceletContext$TemplateManager.apply(Def
ultFaceletContext.java:310)
at com.sun.facelets.impl.DefaultFaceletContext.includeDefinition(Default
aceletContext.java:280)
at com.sun.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:68)
at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHa
dler.java:47)
at com.sun.facelets.tag.ui.DefineHandler.applyDefinition(DefineHandler.j
va:64)
at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.j
va:131)
at com.sun.facelets.impl.DefaultFaceletContext$TemplateManager.apply(Def
ultFaceletContext.java:310)
at com.sun.facelets.impl.DefaultFaceletContext.includeDefinition(Default
aceletContext.java:280)
at com.sun.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:68)
at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHa
dler.java:47)
at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.jav
:49)
at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHa
dler.java:47)
at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:
5)
at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
 
Arun Kandregula
Greenhorn
Posts: 26
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is my finding till now:

I can access the variable in side

// CODE with problem...


So I defined similar column collection in someCollection itself and i am able to access the columns like this :

//CODE with imperfect solution (working)




 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic