Possible Duplicate:
How to make a grid of JSF composite component?
I have a <p:panelGrid>
with one column to produce the header and the footer.
The text is in Portuguese, it says "Fields are placed here! PS: inside the secound panel".
Inside that <p:panelGrid>
, I have a nested <h:panelGrid>
which should contain the fields. I created a composite component to add labels and input fields. Here is the composite implementation:
<cc:implementation>
<h:panelGrid columns="2">
<p:outputLabel for="#{cc.attrs.fieldId}" value="#{cc.attrs.fieldLabel}"/>
<p:inputText id="#{cc.attrs.fieldId}" required="#{cc.attrs.required}" disabled="#{cc.attrs.disabled}"
value="#{cc.attrs.targetValue}" styleClass="cc.attrs.styleClass">
<cc:insertChildren /> <!-- Validation Rules -->
<f:ajax event="blur" execute="@this" render="@this" />
</p:inputText>
</h:panelGrid>
</cc:implementation>
This should align the label and input in the grid. However, it renders something like as:
I tried removing the <h:panelGrid>
from the composite component, but it also looks misaligned like this:
How can I align the labels and the inputs?