[ http://issues.apache.org/jira/browse/MYFACES-868?page=comments#action_12358391 ]
Mike Kienenberger commented on MYFACES-868: ------------------------------------------- Tony, As Simon remarked the first time you opened this issue, you should discuss this on the MyFaces user list. JSF works on components, not on rendered html. The panelGrid component takes a list of components and puts each one in a separate column. However, the dataList component is a single component to the parent panelGrid, despite all of the html that's being rendering, so all of that html is going to be put into the same column. One thing you could try is to use the jsp c:forEach tag instead of dataTable. This will create multiple copies of each component as the component tree is built. I've never used forEach, but others have brought it up on the facelets mailing list. The dataList component (and all JSF components) only render output from components at render time, but they do not add multiple copies of components at component tree build time. Put another way: The first time a page is displayed, a component tree is built. That's what panelGrid is going to work on. Each time the page is displayed, the html is going to be rendered, and that's what dataList is going to work on. If it were me, I would not be trying to solve the problem this way. I'd either replace panelGrid + dataList with a dataTable (that's what a datatable is!) or I'd get rid of the panelGrid and directly render the html table tags using f:verbatim tags. dataList excels at letting you provide the formatting while it provides the iteration. This issue needs to be marked "Won't Fix" and closed. > dataList treatment inside panelGrid > ----------------------------------- > > Key: MYFACES-868 > URL: http://issues.apache.org/jira/browse/MYFACES-868 > Project: MyFaces > Type: Improvement > Components: Tomahawk > Versions: 1.1.1, Nightly > Environment: 11/22/2005 Nightly Build > Tomcat 5.5 > Fedora 4 > Reporter: Tony Czupryna > Priority: Minor > > I'm basically trying to use a dataList as a foreach to display a bunch of > panelGroups across the screen. When the page renders, the dataList is treated > as a single panelGroup and displays vertically instead of horizontally. It > would be great if I could tell the dataList to basically be ignored by > panelGrid and just render what it contains. This makes it possible to use > dataList as a foreach. Maybe this should be a new tag that extends dataList. > A test jsp: > <%@ page session="true" contentType="text/html;charset=UTF-8" language="java" > %> > <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> > <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> > <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t" %> > <html> > <head><title>TonyTesterNoGrid</title></head> > <body> > <f:view> > <h:panelGrid columns="#{tonyTester.numberOfHelpers}"> > <t:dataList id="test" var="helper" value="#{tonyTester.helpers}"> > <h:panelGroup> > <h:panelGrid columns="1"> > <h:outputText value="#{helper.key}"/> > <h:outputText value="#{helper.descriptionLine1}"/> > <h:outputText value="#{helper.descriptionLine2}"/> > </h:panelGrid> > </h:panelGroup> > </t:dataList> > </h:panelGrid> > </f:view> > </body> > </html> > Currently, the entire list is put into the first column of the panelGrid: > <html> > <head><title>TonyTesterNoGrid</title></head> > <body> > <table border="0"><tbody><tr><td> > <table border="0"><tbody><tr><td>1</td></tr> > <tr><td>helper1-descriptionLine1</td></tr> > <tr><td>helper1-descriptionLine2</td></tr> > </tbody></table> > <table border="0"><tbody><tr><td>1</td></tr> > <tr><td>helper2-descriptionLine1</td></tr> > <tr><td>helper2-descriptionLine2</td></tr> > </tbody></table> > <table border="0"><tbody><tr><td>1</td></tr> > <tr><td>helper3-descriptionLine1</td></tr> > <tr><td>helper3-descriptionLine2</td></tr> > </tbody></table> > </td><td></td><td></td></tr> > </tbody></table> > </body> > </html> > I'd like to be able to render with each contained panelGroup as a separate > column in the panelGrid: > <html> > <head><title>TonyTesterNoGrid</title></head> > <body> > <table border="0"><tbody><tr><td> > <table border="0"><tbody><tr><td>1</td></tr> > <tr><td>helper1-descriptionLine1</td></tr> > <tr><td>helper1-descriptionLine2</td></tr> > </tbody></table> > </td><td> > <table border="0"><tbody><tr><td>1</td></tr> > <tr><td>helper2-descriptionLine1</td></tr> > <tr><td>helper2-descriptionLine2</td></tr> > </tbody></table> > </td><td> > <table border="0"><tbody><tr><td>1</td></tr> > <tr><td>helper3-descriptionLine1</td></tr> > <tr><td>helper3-descriptionLine2</td></tr> > </tbody></table> > </td></tr> > </tbody></table> > </body> > </html> > It would also have to be able to render additional rows properly. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
