You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by De...@ak.blm.gov on 2005/09/07 23:16:52 UTC

Headers w/ panelGrid problem

Attached is an image of a table generated by the following markup.  Only 
the first cell of the header is rendered and it is repeated.  The other 
cells of the header are rendered as normal cells.  Ideas?

        <h:form>
                <h:panelGrid styleClass="data" columns="4" 
rowClasses="greyBack, whiteBack" 
                                         columnClasses="codeColumn, 
textColumn, editColumn, deleteColumn">
                        <f:facet name="header">
                                <h:outputText 
value="#{domainTableBacker.codeLabel}" />
                                <h:outputText 
value="#{domainTableBacker.textLabel}" />
                                <h:commandLink value="Save" 
action="#{domainTableCrudBacker.save}" />
                                <h:commandLink value="Cancel" 
immediate="true" action="#{domainTableCrudBacker.cancelEdit}" />
                        </f:facet>
                        <h:outputText 
value="#{domainTableBacker.codeLabel}" />
                        <h:outputText 
value="#{domainTableBacker.textLabel}" />
                        <h:commandLink value="Save" 
action="#{domainTableCrudBacker.save}" />
                        <h:commandLink value="Cancel" immediate="true" 
action="#{domainTableCrudBacker.cancelEdit}" />
 
                        <h:panelGroup>
                                <h:outputText styleClass="code" 
rendered="#{not domainTableCrudBacker.addMode}"
 value="#{domainTableCrudBacker.unit.codeValue}" />
                                <h:inputText styleClass="code" 
rendered="#{domainTableCrudBacker.addMode}"
 value="#{domainTableCrudBacker.unit.codeValue}" required="true" id="code" 
/>
                        </h:panelGroup>
                        <h:inputText styleClass="text" 
value="#{domainTableCrudBacker.unit.textValue}" required="true" id="text" 
/>
                        <h:inputHidden rendered="#{not 
domainTableCrudBacker.addMode}" 
value="#{domainTableCrudBacker.unit.codeValue}" />
                        <h:outputText value="" />
                </h:panelGrid>
 
                <h:message for="code"  styleClass="validationMessage" />
                <h:message for="text"  styleClass="validationMessage" />
        </h:form>

Dennis Byrne


Re: Headers w/ panelGrid problem

Posted by Bruno Aranda <br...@gmail.com>.
Facets can only have one child component, so you should put all the
components inside the header facet inside a panelGroup, so the
panelGroup is the only child of the facet...

Regards,

Bruno

2005/9/7, Dennis_Byrne@ak.blm.gov <De...@ak.blm.gov>:
>  
> Attached is an image of a table generated by the following markup.  Only the
> first cell of the header is rendered and it is repeated.  The other cells of
> the header are rendered as normal cells.  Ideas? 
>  
>         <h:form> 
>                 <h:panelGrid styleClass="data" columns="4"
> rowClasses="greyBack, whiteBack" 
>                                          columnClasses="codeColumn,
> textColumn, editColumn, deleteColumn"> 
>                         <f:facet name="header"> 
>                                 <h:outputText
> value="#{domainTableBacker.codeLabel}" /> 
>                                 <h:outputText
> value="#{domainTableBacker.textLabel}" /> 
>                                 <h:commandLink value="Save"
> action="#{domainTableCrudBacker.save}" /> 
>                                 <h:commandLink value="Cancel"
> immediate="true"
> action="#{domainTableCrudBacker.cancelEdit}" /> 
>                         </f:facet> 
>                         <h:outputText value="#{domainTableBacker.codeLabel}"
> /> 
>                         <h:outputText value="#{domainTableBacker.textLabel}"
> /> 
>                         <h:commandLink value="Save"
> action="#{domainTableCrudBacker.save}" /> 
>                         <h:commandLink value="Cancel" immediate="true"
> action="#{domainTableCrudBacker.cancelEdit}" /> 
>                         
>                         <h:panelGroup> 
>                                 <h:outputText styleClass="code"
> rendered="#{not domainTableCrudBacker.addMode}" 
>                                        
> value="#{domainTableCrudBacker.unit.codeValue}" /> 
>                                 <h:inputText styleClass="code"
> rendered="#{domainTableCrudBacker.addMode}" 
>                                        
> value="#{domainTableCrudBacker.unit.codeValue}"
> required="true" id="code" /> 
>                         </h:panelGroup> 
>                         <h:inputText styleClass="text"
> value="#{domainTableCrudBacker.unit.textValue}"
> required="true" id="text" /> 
>                         <h:inputHidden rendered="#{not
> domainTableCrudBacker.addMode}"
> value="#{domainTableCrudBacker.unit.codeValue}" /> 
>                         <h:outputText value="" /> 
>                 </h:panelGrid> 
>                 
>                 <h:message for="code"  styleClass="validationMessage" /> 
>                 <h:message for="text"  styleClass="validationMessage" /> 
>         </h:form> 
>  
> Dennis Byrne 
>  
>  
>