@Agr0 escreveu:
Pessoal,
Tenho um dataTable e gostaria de mudar a cor dos registros das tarefas (essa é a classe) que não foram finalizadas até a dataPrazo. O dataTable ta pronto e funcionando corretamente. Só preciso agora mudar a cor dos registros baseado na condição acima...
Como posso fazer isso ?<p:dataTable id="listatarefas" value="#{tarefaBean.tarefas}" var="tarefa" rows="20" cellpadding="5" paginator="true" emptyMessage="Nenhum registro encontrado"> <f:facet name="caption"> <br /> </f:facet> <p:column width="4%"> <f:facet name="header">#</f:facet> <h:outputText value="#{tarefa.tarefa}" /> </p:column> <p:column width="20%" style="white-space:normal !important;"> <f:facet name="header">Nome</f:facet> <h:outputText value="#{tarefa.nome}" /> </p:column> <p:column style="white-space:normal !important;" width="20%"> <f:facet name="header">Início</f:facet> <h:outputText value="#{tarefa.dataInicio}"> <f:convertDateTime pattern="dd/MM/yyyy HH:mm" /> </h:outputText> </p:column> <p:column style="white-space:normal !important;" width="20%"> <f:facet name="header">Prazo</f:facet> <h:outputText value="#{tarefa.dataPrazo}"> <f:convertDateTime pattern="dd/MM/yyyy HH:mm" /> </h:outputText> </p:column> <p:column style="white-space:normal !important;" width="20%"> <f:facet name="header">Fim</f:facet> <h:outputText value="#{tarefa.dataFim}"> <f:convertDateTime pattern="dd/MM/yyyy HH:mm" /> </h:outputText> </p:column> <p:column style="white-space:normal !important;" width="12%"> <f:facet name="header">Projeto</f:facet> <h:outputText value="#{tarefa.projeto.nome}" /> </p:column> <p:column style="white-space:normal !important;" width="15%"> <f:facet name="header">Atendente</f:facet> <h:outputText value="#{tarefa.usuarioAtendente.nome}" /> </p:column> <p:column style="white-space:normal !important;" width="15%"> <f:facet name="header">Solicitante</f:facet> <h:outputText value="#{tarefa.usuarioSolicitante.nome}" /> </p:column> <p:column width="20%" style="white-space:normal !important;"> <f:facet name="header">Referência do equipamento</f:facet> <h:outputText value="#{tarefa.referenciaEquipamento}"/> </p:column> <p:column style="white-space:normal !important;" width="15%"> <f:facet name="header">Status</f:facet> <h:outputText value="#{tarefa.statusTarefa.nome}" style="color:black;font-weight:bold"/> </p:column> <p:column width="4%"> <h:commandLink action="#{tecnicoSessaoBean.editarTarefa}"> <h:graphicImage library="imagens" name="itens_req.png" style="border:0" title="Editar" /> <f:setPropertyActionListener target="#{tecnicoSessaoBean.codigoTarefa}" value="#{tarefa.tarefa}" /> <f:setPropertyActionListener target="#{tecnicoSessaoBean.nomeTarefa}" value="#{tarefa.nome}" /> <f:setPropertyActionListener target="#{tecnicoSessaoBean.dataInicioTarefa}" value="#{tarefa.dataInicio}" /> <f:setPropertyActionListener target="#{tecnicoSessaoBean.dataPrazoTarefa}" value="#{tarefa.dataPrazo}" /> <f:setPropertyActionListener target="#{tecnicoSessaoBean.dataFimTarefa}" value="#{tarefa.dataFim}" /> <f:setPropertyActionListener target="#{tecnicoSessaoBean.usuario}" value="#{tarefa.usuarioAtendente.nome}" /> <f:setPropertyActionListener target="#{tecnicoSessaoBean.usuario2}" value="#{tarefa.usuarioSolicitante.nome}" /> <f:setPropertyActionListener target="#{tecnicoSessaoBean.projeto}" value="#{tarefa.projeto.nome}" /> <f:setPropertyActionListener target="#{tecnicoSessaoBean.descricaoSolicitanteTarefa}" value="#{tarefa.descricaoSolicitante}" /> <f:setPropertyActionListener target="#{tecnicoSessaoBean.descricaoAtendenteTarefa}" value="#{tarefa.descricaoAtendente}" /> <f:setPropertyActionListener target="#{tecnicoSessaoBean.referenciaEquipamento}" value="#{tarefa.referenciaEquipamento}" /> <f:setPropertyActionListener target="#{tecnicoSessaoBean.statusTarefa}" value="#{tarefa.statusTarefa.nome}" /> </h:commandLink> </p:column> <p:column width="4%"> <h:commandLink action="#{tarefaBean.verDetalhe}"> <h:graphicImage library="imagens" name="detalhe.png" style="border:0" title="Ver detalhes" /> <f:setPropertyActionListener target="#{tarefaBean.codigoTarefa}" value="#{tarefa.tarefa}" /> </h:commandLink> </p:column> <p:column width="4%"> <h:commandLink action="#{tecnicoSessaoBean.mudarAtendente}" onclick="if (!confirm('Deseja pegar essa tarefa?')) return false;"> <h:graphicImage library="imagens" name="pegartarefa.png" style="border:0" title="Pegar tarefa" /> <f:setPropertyActionListener target="#{tecnicoSessaoBean.codigoTarefa}" value="#{tarefa.tarefa}" /> </h:commandLink> </p:column> <p:column> <p:commandButton id="selectButton" update=":buscando:display2" oncomplete="carDialog.show()" icon="ui-icon-circle-check" title="Finalizar tarefa"> <f:setPropertyActionListener target="#{tecnicoSessaoBean.codigoTarefa}" value="#{tarefa.tarefa}" /> <f:setPropertyActionListener target="#{tecnicoSessaoBean.descricaoSolicitanteTarefa}" value="#{tarefa.descricaoSolicitante}" /> </p:commandButton> </p:column> </p:dataTable> <p:dialog header="Finalizar tarefa" widgetVar="carDialog" resizable="false" id="carDlg" showEffect="fade" hideEffect="explode" modal="true"> <h:panelGrid id="display2" columns="2" cellpadding="4" style="margin:0 auto;"> <h:outputText value="#:" /> <h:outputText value="#{tecnicoSessaoBean.codigoTarefa}" style="font-weight:bold" /> <p:outputLabel value="Descrição solicitante:" /> <h:outputText value="#{tecnicoSessaoBean.descricaoSolicitanteTarefa}" style="font-weight:bold" /> <p:outputLabel value="Descrição atendente:" for="descricaoAtendente" /> <p:inputTextarea id="descricaoAtendente" label="descricaoAtendente" value="#{tecnicoSessaoBean.descricaoAtendenteTarefa}" cols="80" rows="5" maxlength="400" /> <h:commandButton action="#{tecnicoSessaoBean.finalizarTarefa}" value="Finalizar" /> </h:panelGrid> </p:dialog> </h:form> </p:panel> </h:panelGrid>
Mensagens: 12
Participantes: 2