PrimeFaces panelGrid
Is there any alternative for panelGrid
in PrimeFaces components? I need something more fixable to design form开发者_StackOverflow中文版s. Something which supports colspan
attribute someway!
If all you want is colspan
, then just use plain vanilla HTML or use Tomahawk's <t:panelGrid>
with <t:panelGroup>
which supports the colspan
attribute.
RichFaces has also components supporting colspan
, but that doesn't always work flawlessly together with PrimeFaces.
You can achieve this by using "p:row and p:column" in panel Grid
example:
<p:panelGrid style="margin-top:20px">
<f:facet name="header">
<p:row>
<p:column colspan="7">1995-96 NBA Playoffs</p:column>
</p:row>
<p:row>
<p:column colspan="2">Conf. Semifinals</p:column>
<p:column colspan="2">Conf. Finals</p:column>
<p:column colspan="2">NBA Finals</p:column>
<p:column>Champion</p:column>
</p:row>
</f:facet>
<p:row>
<p:column style="font-weight: bold;">Seattle</p:column>
<p:column style="font-weight: bold;">4</p:column>
<p:column rowspan="2" style="font-weight: bold;">Seattle</p:column>
<p:column rowspan="2" style="font-weight: bold;">4</p:column>
<p:column rowspan="5">Seattle</p:column>
<p:column rowspan="5">2</p:column>
<p:column rowspan="11" style="font-weight: bold;">Chicago</p:column>
</p:row>
</p:panelGrid>
For Complete Example please visit prime faces show case
Sadly there is no alternative for <h:panelGrid>
yet.
But hopefully you can use the <p:layout>
and <p:layoutUnit>
to more fixable form design.
And there are no restrictions using <table>
and <div>
with little CSS. Personally I would stick to the panelGrid because it is a JSF component, with more JSF-ish attributes.
I don't know why my previous answer was deleted by admins but PrimeFaces 3.1 will have a panelGrid component. http://www.primefaces.org/showcase-labs/ui/panelGrid.jsf
精彩评论