Friday, February 5, 2010

ice:panelCollapsible header styling issues

Had a problem this week with styling nested ICEfaces collapsible panels. (ice:panelCollapsible): the top panel would be styled, but the children's headers didn't get the neat open/close buttons from the default rime stylesheet. Custom styles wouldn't get recognized either.
After hours of digging around in CSS and ICE forums, I finally realized (thanks to the JIRA 3209) that the problem was not with the style, but with the layout. The content of header must be contained in a <div> (or an ice:panelGroup), otherwise the style doesn't get recognized. It doesn't have anything to do with nesting, I just happened to copy the top panel from elsewhere, and didn't pay attention to the wrapping panelGroup.


<ice:panelCollapsible expanded="true">
<f:facet name="header">
<div>
<ice:outputText value = "Grocery Panel"> </ice:outputText>
</div>
</f:facet>
<ice:panelGrid columns = "1">
<ice:outputText value = "Food stuffs"> </ice:outputText>
</ice:panelGrid>
<!-- Nested panel 1 -->
<ice:panelCollapsible>
<f:facet name="header">
<ice:panelGroup>
<ice:outputText value = "Fruit Panel"> </ice:outputText>
</ice:panelGroup>
</f:facet>
<ice:panelGrid columns = "2">
<ice:outputText value = "Apple"> </ice:outputText>
<ice:outputText value = "Orange"> </ice:outputText>
</ice:panelGrid>
</ice:panelCollapsible>
<!-- Nested panel 2 -->
<ice:panelCollapsible>
<f:facet name="header">
<ice:panelGroup>
<ice:outputText value = "Vegetable Panel"> </ice:outputText>
</ice:panelGroup>
</f:facet>
<ice:panelGrid columns = "2">
<ice:outputText value = "Cucumber"> </ice:outputText>
<ice:outputText value = "Potato"> </ice:outputText>
</ice:panelGrid>
</ice:panelCollapsible>
</ice:panelCollapsible>


Dev environment: ICEfaces 1.8.2, MyEclipse 7.5, Liferay 5.2.EE

No comments:

 
1.