Change whether or not item appears in p: Datatable

0

Good morning. I have the following datatable:

CouldyougivemeaglimpseofwhatIcoulddotomakethisExpansionappearonlyforthefirsttwolines?Theothershavenodetailstoappearintheexpansion.

Ithoughtaboutusingrenderedifthelineisgreaterthan2(or1,Idonotknowifthecountofthedatatablestartsfrom0or1).Whatdoyouthink?Iftheythinkit'sagoodidea,doyouknowhowIcangetbacktothetable?

FollowXHTML

<h:formid="form">          
        <f:metadata>    
            <f:event type="preRenderView" listener="#{cenarioBean.prepararListaFCQ}"/>    
        </f:metadata>

        <p:dataTable var="f" value="#{cenarioBean.auxFCQ}"
            paginator="false" rows="4" class="dataTable" id="dataTable" 
            emptyMessage="Nenhum Fluxo de Qualificacao Cadastrado">

            <p:column width="1">
                <p:rowToggler />
            </p:column>

            <p:columns value="#{cenarioBean.getColunas()}" var="c" headerText="#{c}" styleClass="column" width="#{c.startsWith('T') ? 200 : 60}">
                <h:outputText value="#{cenarioBean.getValorFCQ()}" />
            </p:columns>    

            <p:rowExpansion>
                Teste
            </p:rowExpansion>
        </p:dataTable>
    </h:form>
    
asked by anonymous 27.12.2015 / 15:32

2 answers

1

Try to use rendered by the name of the column you want Expand.

Example:

<p:rowExpansion rendered="#{c.nomeColuna == 'Coluna A' or c.nomeColuna == 'Coluna B}">
     Teste 
</p:rowExpansion>

I believe this condition will resolve your case.

    
18.03.2016 / 17:32
0

Friend's choice above and good too, if it were some detailing I would use so if the list is not empty it shows.

<p:rowExpansion rendered="#{not empty lista.lstItems}">
    Teste 
</p:rowExpansio>
    
23.08.2017 / 22:18