Details
-
Type: Improvement
-
Status: Open
-
Priority: Major
-
Resolution: Unresolved
-
Affects Version/s: 1.8.2
-
Fix Version/s: None
-
Component/s: ICE-Components
-
Labels:None
-
Environment:WebSphere Application Server 6.1, Java 1.5 (IBM J9), AIX / Tomcat 5.5, Java 1.5.0_21 (SUN), Windows
-
ICEsoft Forum Reference:
-
Affects:Documentation (User Guide, Ref. Guide, etc.)
-
Community Contribution:Yes
Description
Currently <ice:panelSeries> 'stamps' its contents as if it were a table with only one column (ie http://wiki.icefaces.org/display/ICE/Panel+Series). There are, however, people interested on showing its children as if it were a table with 'n' columns, as if it where a PanelGrid. Although the IceFaces component showcase shows a 2 column PanelSeries, this is achieved through css, through the 'align' attribute, so only two columns can be obtained.
The icefaces forum reference attached to this issue proposes using a <ui:repeat> component inside an <ice:panelGrid>, but this approach doesn't work as the <ice:panelGrid> considers the <ui:repeat>.
Using a <c:forEach> is not an option either since its children cannot 'see' the value of 'var', as 'var' only exists while the view is being created. This issue is discussed here: http://www.ninthavenue.com.au/blog/c:foreach-vs-ui:repeat-in-facelets
The solution would be to modify PanelSeriesRenderer so it uses a table with n columns instead of a div for rendering its components, effectively making it a mix of the current PanelSeriesRenderer and GridRenderer classes, then adding a "cols" attribute to PanelSeries.
Additionaly, a new "layout" attribute (grid | group) could be added to PanelSeries so the new PanelSeriesRenderer could fall back to using a div as it is currently done.
The icefaces forum reference attached to this issue proposes using a <ui:repeat> component inside an <ice:panelGrid>, but this approach doesn't work as the <ice:panelGrid> considers the <ui:repeat>.
Using a <c:forEach> is not an option either since its children cannot 'see' the value of 'var', as 'var' only exists while the view is being created. This issue is discussed here: http://www.ninthavenue.com.au/blog/c:foreach-vs-ui:repeat-in-facelets
The solution would be to modify PanelSeriesRenderer so it uses a table with n columns instead of a div for rendering its components, effectively making it a mix of the current PanelSeriesRenderer and GridRenderer classes, then adding a "cols" attribute to PanelSeries.
Additionaly, a new "layout" attribute (grid | group) could be added to PanelSeries so the new PanelSeriesRenderer could fall back to using a div as it is currently done.
Take the following as a sample: make the class Producto have a list of Paquete, and Paquete a list of doubles (or whatever) called primas. The results are shown on the attached screenshot
<h:panelGrid columns="3">
{seriesController.producto.paquetes}<ui:repeat value="#
" var="paquete">
{paquete.primas}<ice:dataTable value="#
" var="prima">
{paquete.nombre}<f:facet name="header">
<ice:outputText value="#
"></ice:outputText>
{prima}</f:facet>
<h:column id="colPrima">
<ice:outputText value="#
"></ice:outputText>
</h:column>
</ice:dataTable>
</ui:repeat>
</h:panelGrid>