In GitHub issue PanelGrid: No way to manage style or identifiers of panelgrid cells except for tabular mode #5840, says it is possible to do it but doesn't say how.
I want to "hide" some cells. I have partially solved the problem using p:row
and p:column
; but those components don't work well inside a p:wizard
. So I was wondering if there is another way to do it. Right now, I'm only hiding the cell content, but I'd also like to remove the padding and borders from the generated td
.
I will really appreciate if someone can tell me how to set the style of specific cells without using p:row
and p:column
.
EDITED ON 11/15/22
Following the advice here is some code:
<p:panelGrid
columns="2"
columnClasses="xs-width-fit-content,xs-width-100"
styleClass="xs-width-100">
...
<h:panelGroup
id="otraPaginaPanelDetalleWritingLabelGroup"
style="#{usuario22.writingGridOtraPaginaVisible ? 'visibility: visible' : 'display: none'}">
...
</h:panelGroup>
<h:panelGroup
id="otraPaginaPanelDetalleWritingFieldGroup"
style="#{usuario22.writingGridOtraPaginaVisible ? 'visibility: visible' : 'display: none'}">
...
</h:panelGroup>
...
</p:panelGrid>
The p:panelGrid
has 2 columns, one for labels, etc, and other for input fields, etc. Each column contains a single h:panelGroup
.
Each pair of consecutive panelGroups would be a "row"; such "rows" are shown and hidden dynamically using AJAX.
When the panelGroups of a "row" are hidden, I would like to change the style of their containing td
, to set padding and borders to 0.