F
fastcars
I am trying to render a page using the latest versions of
MyFaces/tomahawk. (1.1.4)
I had a question re a nested data structue. I have a structure that has
A list of categories, Each category may have items and subcategories,
and the subcategories have items as well.
So what I have done, is have a row index var at the top level which I
then use in subsequent EL index expressions further on.
ie
value="#{PortalBean.portalpage.categories[catIdx].subcategories}"
This gets an 'catIdx' unresolved attribute in the debug log and doesnt
work.
Is this to be expected ?
What other options do I have to render this data structure?
As far as I can see I need nested datatables.
What is the correcty approach ?
<t:dataTable value="#{PortalBean.portalpage.categories}"
cellpadding="1" cellspacing="0"
var="cats" styleClass="timetable" rowIndexVar="catIdx">
<t:column>
<t:div >
<t:dataTable
value="#{PortalBean.portalpage.categories[catIdx].categoryitems}"
cellpadding="1" cellspacing="0"
var="item" >
<h:commandLink action="#{item.itemhref}" >
<t:graphicImage url="#{item.iconhref}"
rendered="#{item.rendericon}"></t:graphicImage>
<hutputLabel value="#{item.itemname}"></hutputLabel>
</h:commandLink>
</t:dataTable>
<t:dataTable
value="#{PortalBean.portalpage.categories[catIdx].subcategories}"
cellpadding="1" cellspacing="0"
var="subcat" rowIndexVar="scatIdx">
<t:column id="header">
<hutputText value="#{subcat.categoryname}"/>
</t:column>
<t:dataTable
value="#{PortalBean.portalpage.categories[catIdx].subcategories[scatIdx].categoryitems}"
cellpadding="1" cellspacing="0" var="item" >
<h:commandLink action="#{item.itemhref}" >
<t:graphicImage url="#{item.iconhref}"
rendered="#{item.rendericon}"></t:graphicImage>
<hutputLabel value="#{item.itemname}"></hutputLabel>
</h:commandLink>
</t:dataTable>
</t:dataTable>
</t:div>
</t:column>
</t:dataTable>
MyFaces/tomahawk. (1.1.4)
I had a question re a nested data structue. I have a structure that has
A list of categories, Each category may have items and subcategories,
and the subcategories have items as well.
So what I have done, is have a row index var at the top level which I
then use in subsequent EL index expressions further on.
ie
value="#{PortalBean.portalpage.categories[catIdx].subcategories}"
This gets an 'catIdx' unresolved attribute in the debug log and doesnt
work.
Is this to be expected ?
What other options do I have to render this data structure?
As far as I can see I need nested datatables.
What is the correcty approach ?
<t:dataTable value="#{PortalBean.portalpage.categories}"
cellpadding="1" cellspacing="0"
var="cats" styleClass="timetable" rowIndexVar="catIdx">
<t:column>
<t:div >
<t:dataTable
value="#{PortalBean.portalpage.categories[catIdx].categoryitems}"
cellpadding="1" cellspacing="0"
var="item" >
<h:commandLink action="#{item.itemhref}" >
<t:graphicImage url="#{item.iconhref}"
rendered="#{item.rendericon}"></t:graphicImage>
<hutputLabel value="#{item.itemname}"></hutputLabel>
</h:commandLink>
</t:dataTable>
<t:dataTable
value="#{PortalBean.portalpage.categories[catIdx].subcategories}"
cellpadding="1" cellspacing="0"
var="subcat" rowIndexVar="scatIdx">
<t:column id="header">
<hutputText value="#{subcat.categoryname}"/>
</t:column>
<t:dataTable
value="#{PortalBean.portalpage.categories[catIdx].subcategories[scatIdx].categoryitems}"
cellpadding="1" cellspacing="0" var="item" >
<h:commandLink action="#{item.itemhref}" >
<t:graphicImage url="#{item.iconhref}"
rendered="#{item.rendericon}"></t:graphicImage>
<hutputLabel value="#{item.itemname}"></hutputLabel>
</h:commandLink>
</t:dataTable>
</t:dataTable>
</t:div>
</t:column>
</t:dataTable>