PrimeFaces DataTable com detalhes - p:rowToggler

Java

20/09/2012

Boa noite, tudo bem?

Como faço para p:rowToggler, carregue automático sem precisa o usuário clicar. Na verdade gostaria de trabalho com datatable com sub detalhe, tem como? os dados vir de duas tabelas diferente?

Obrigado.
Romilson Cardoso

Romilson Cardoso

Curtidas 0

Respostas

Davi Costa

Davi Costa

20/09/2012

Utilize:

http://www.primefaces.org/showcase/ui/datatableSubTable.jsf

att Davi
GOSTEI 0
Romilson Cardoso

Romilson Cardoso

20/09/2012

ok, estarei analizando.

Sabe como faço para o cabeçalho sair normal como o detalhe. Por exemplo o link que me mandou, onde esta o nome do Messi, gostaria que fosse aplicado um css de outra cor, tem como?

Por hora, muito obrigado.
GOSTEI 0
Romilson Cardoso

Romilson Cardoso

20/09/2012

ok, estarei analizando.

Sabe como faço para o cabeçalho sair normal como o detalhe. Por exemplo o link que me mandou, onde esta o nome do Messi, gostaria que fosse aplicado um css de outra cor, tem como?

Por hora, muito obrigado.
GOSTEI 0
Davi Costa

Davi Costa

20/09/2012

Dá uma olhada nesses link's:

http://forum.primefaces.org/viewtopic.php?f=3&t=17167
http://stackoverflow.com/questions/6304652/primefaces-components-css-customization
http://stackoverflow.com/questions/7816731/primefaces-2-2-1-looks-different-locally-than-in-showcase
http://forum.primefaces.org/viewtopic.php?f=3&t=22553
http://www.java2s.com/Questions_And_Answers/JSF/PrimeFaces/CSS.htm


att Davi
GOSTEI 0
Romilson Cardoso

Romilson Cardoso

20/09/2012

Estou verificando. Obrigado pela dicas. Quando terminar vou te enviar como ficou. Obrigado.
GOSTEI 0
Davi Costa

Davi Costa

20/09/2012

Estou verificando. Obrigado pela dicas. Quando terminar vou te enviar como ficou. Obrigado.

Faz isso msmo, esse é que é o grande lance do fórum, ajudar e ser ajudado... e postar as soluções.

att Davi
GOSTEI 0
Romilson Cardoso

Romilson Cardoso

20/09/2012

Estou verificando. Obrigado pela dicas. Quando terminar vou te enviar como ficou. Obrigado.

Faz isso msmo, esse é que é o grande lance do fórum, ajudar e ser ajudado... e postar as soluções.

att Davi


Davi,

Usei o ui:repeat, pois essa me atendeu com subtable do primefaces não me atendeu. No datables do jsf 2 não consigo fazer um como este exemplo:
                            <table width="100%" id="gradient-style">
                                <thead>
                                    <tr>
                                        <th scope="col" width="7%">Situação</th>
                                        <th scope="col" width="43%">Nome / Endereço</th>
                                        <th scope="col" width="5%">Cartório</th>
                                        <th scope="col" width="5%">Código</th>
                                        <th scope="col" width="5%">Data</th>
                                        <th scope="col" width="5%">Data</th>
                                        <th scope="col" width="5%">CNPJ/CPF</th>
                                        <th scope="col" width="5%">Contrato</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr>
                                        <td colspan="4">
                                        </td>
                                        <td colspan="4" align="right">
                                            <h:commandButton value="< Anterior" action="#{notiCliBean.paginator.prev}"/>
                                            <h:outputText value=" #{notiCliBean.paginator.pageIndex} / #{notiCliBean.paginator.pages} "/>
                                            <h:commandButton value="Próxima >" action="#{notiCliBean.paginator.next}"/>
                                            <h:inputHidden value="#{notiCliBean.paginator.pageIndex}"/>       
                                        </td>
                                    </tr>    
                                    <ui:repeat value="#{notiCliBean.paginator.model}" var="noti">
                                        <tr>
                                            <td rowspan="2">                                                
                                                <h:outputLink rendered="#{noti.MOVImagem > 0}" value="/certidao/KIT_#{noti.NOTIPro}.pdf" target="_blank">
                                                    <h:graphicImage url="/resources/img/pdf.png" library="images"/>                                        
                                                    <h:graphicImage rendered="#{itemDM.MOVIMGTipo == 2}" url="/resources/img/tiff.gif" library="images"/>                                        
                                                </h:outputLink>   
                                            </td>
                                            <td>                                                                                      
                                                <p:commandLink   
                                                    action="#{notiCliDetBean.consultar(noti.NOTIPro)}" ajax="true" 
                                                    oncomplete="dgdetalhe.show();" update=":idFrmPrincipal:idPGDet :idFrmPrincipal:idDetalhe"> 
                                                    <f:setPropertyActionListener target="#{notiCliBean.nome}" value="#{noti.CLINome}"/>                                         
                                                    <h:outputText style="color: #{noti.NOTISituacao gt 0 ? '#000000' : '#D20005'}" value="#{noti.CLINome}">
                                                    </h:outputText>
                                                </p:commandLink>                                                                                                                                    
                                            </td>
                                            <td>
                                                <h:outputText style="color: #{noti.NOTISituacao gt 0 ? '#000000' : '#D20005'}" value="#{noti.NOTPROCAT}">
                                                </h:outputText>
                                            </td>
                                            <td>
                                                <h:outputText style="color: #{noti.NOTISituacao gt 0 ? '#000000' : '#D20005'}" value="#{noti.NOTIPro}">
                                                </h:outputText>
                                            </td>
                                            <td>
                                                <h:outputText style="color: #{noti.NOTISituacao gt 0 ? '#000000' : '#D20005'}" value="#{noti.NOTIData}">
                                                    <f:convertDateTime pattern="dd/MM/yyyy" />
                                                </h:outputText>
                                            </td>
                                            <td>
                                                <h:outputText style="color: #{noti.NOTISituacao gt 0 ? '#000000' : '#D20005'}" value="#{noti.NOTIDtRec}">
                                                    <f:convertDateTime pattern="dd/MM/yyyy" />
                                                </h:outputText>
                                            </td>
                                            <td>
                                                <h:outputText style="color: #{noti.NOTISituacao gt 0 ? '#000000' : '#D20005'}" value="#{noti.NOTICPFCNPJ}">
                                                </h:outputText>
                                            </td>
                                            <td>
                                                <h:outputText style="color: #{noti.NOTISituacao gt 0 ? '#000000' : '#D20005'}" value="#{noti.NOTIContrato}">
                                                </h:outputText>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <h:outputLink rendered="#{noti.MOVARCod != null}" target="_blank" value="http://websro.correios.com.br/sro_bin/txect01$.QueryList">
                                                    <h:graphicImage rendered="#{noti.MOVARCod != null}" url="/resources/img/correios.jpg" library="images"/>
                                                    <f:param name="P_LINGUA" value="001" />
                                                    <f:param name="P_TIPO" value="001" />
                                                    <f:param name="P_COD_UNI" value="#{noti.MOVARCod}" />
                                                </h:outputLink>
                                                #{noti.MOVEndereco}
                                            </td>
                                            <td> </td>
                                            <td> </td>
                                            <td> </td>
                                            <td> </td>
                                            <td> </td>
                                            <td> </td>
                                        </tr>
                                    </ui:repeat> 
                                </tbody>                                    
                            </table>





Obrigado a todos.
GOSTEI 0
POSTAR