3 Replies Latest reply on Feb 20, 2012 5:01 AM by Lotfi Mellouk

    how to center subTable

    Lotfi Mellouk Master

      Hello,

       

      the rich:subTable  is always rignt aligned, it's a set of rows, I cannot see any datatable generated on the html code.  I've tried to wrap the subTable inside rich:column, but it does not work.

       

      RF : 3.3.3.Final

       

      can you please advise..

        • 1. Re: how to center subTable
          Jorge Campos Newbie

          A piece of code would help

           

          Jorge Campos

          • 2. Re: how to center subTable
            Lotfi Mellouk Master

            below a snippet code :

             

            <rich:dataTable width="80%;" value="#{infoBean.results}" id="tab_a"
                style="margin-top:10px;padding:2px !important;"
                rowClasses="even-row ,odd-row " rows="20" rowKeyVar="row"
                headerClass="table-header" var="list" reRender="scrl"
                footerClass="transparent">
                <f:facet name="header">
                    <rich:columnGroup style="text-align:center;">
                        <rich:column>
                            <h:outputText value="Del" />
                        </rich:column>
                        <rich:column>
                            <h:panelGroup id="pltf">
                                <h:outputText value="Platform" />
                            </h:panelGroup>
                        </rich:column>
                        <rich:column>
                            <h:panelGroup id="spltf">
                                <h:outputText value="Platform Sub" />
                            </h:panelGroup>
                        </rich:column>
                        <rich:column>
                            <h:panelGroup id="uid">
                                <h:outputText value="User" />
                            </h:panelGroup>
                        </rich:column>
                        <rich:column>show (subtable) </rich:column>
                    </rich:columnGroup>
                </f:facet>
                <rich:column colspan="1" width="10">
                    <a4j:commandLink id="del">
            
                    </a4j:commandLink>
            
                </rich:column>
                <rich:column width="15" colspan="1"></rich:column>
                <rich:column>
                    <h:outputText value="#{list.platform}" />
                </rich:column>
                <rich:column>
                    <h:outputText value="#{list.platform.sub}" />
                </rich:column>
                <rich:column>
                    <h:outputText value="#{list.user}" />
                </rich:column>
                <rich:column width="100">
                    <h:outputText value="#{list.usersubid}" />
                </rich:column>
                <rich:column
                    <a4j:commandLink action="#{mBean.viewAll}" reRender="_tb"
                        ajaxSingle="true" rendered="#{!mBean.viewAll[list.id]}">
                        <h:outputText value="view" />
                    </a4j:commandLink>
                    <a4j:commandLink reRender="_tb" ajaxSingle="true"
                        rendered="#{mBean.viewAll[list.id]}">
                        <f:setPropertyActionListener value="false"
                            target="#{mBean.viewAll[list.id]}" />
                        <h:outputText value="hide" />
                    </a4j:commandLink>
                </rich:column>
                <rich:columnGroup rendered="#{mBean.viewGatewaies[list.id]}">
                    <!-- additionnal column to separate table and subtable -->
                    <rich:column colspan="5"
                        style="border:none;padding:5px;text-align:center;background: none !important;background-color: #FFFFFF !important;"
                        breakBefore="true">
                        <div></div>
                    </rich:column>
                    <rich:column colspan="10" breakBefore="true"
                        style="border:none;padding:5px;text-align:center;background: none !important;background-color: #FFFFFF !important;">
            
            
                        <rich:subTable width="70%;" value="#{list.gList}" id="tab_tgat"
                            rows="20" var="gtws" reRender="scrl" footerClass="transparent"
                            rendered="#{mBean.viewAll[list.id]}" align="center">
                            <!--align center doesn't work -->
                            <rich:column filterEvent="onkeyup" width="70" rendered="true">
                                <f:facet name="header">
                                    <h:panelGroup id="gtwy">
                                        <h:outputText value="Name" />
            
                                    </h:panelGroup>
                                </f:facet>
                                <h:outputText value="#{gtws.name}" />
                            </rich:column>
                            <rich:column width="150" filterEvent="onkeyup">
                                <f:facet name="header">
                                    <h:outputText value="Code" />
                                </f:facet>
                                <h:outputText value="#{gtws.code}" />
                            </rich:column>
                        </rich:subTable>
                        <!-- additionnal column to separate table and subtable -->
                    </rich:column>
                    <rich:column colspan="10"
                        style="border:none;padding:5px;border-top-width:1px;border-top-style:solid;border-top-color: #B6AD84;background: none !important;background-color: #FFFFFF !important;"
                        breakBefore="true">
                    </rich:column>
                </rich:columnGroup>
                <f:facet name="footer">
                    <h:panelGroup style="text-align:center;" layout="block">
                    </h:panelGroup>
                </f:facet>
            </rich:dataTable>
            
            • 3. Re: how to center subTable
              Lotfi Mellouk Master

              I added an empty column to the subTable, it makes the rendering more acceptable, but this workarround is not the best solution. if you have better thanks to advise.