I'm having trouble where my dataTable
has the editable
property set to true
. Allowing the edit of the line that the user selects.
Well, when putting a button to delete for example I'm in trouble that the edit button does not stay on the same line, giving a line break in it and leaving the two buttons at different levels.
AndthenIwouldliketoknowwhattodotobeabletoalign,IalreadytriedtoputapanelGrid
insidebutthenrowEditor
stopsworking.
Codebelow:
<p:dataTableid="vigenciaCorrente" editable="true"
value="#{tabelaTaxaBean.pojo.vigenciaCorrente.faixas}"
var="corrente" sortBy="prazoMinimo">
<f:facet name="header">
<div align="left">
<p:outputLabel value="Vigência de " />
<p:outputLabel
value="#{tabelaTaxaBean.pojo.vigenciaCorrente.dataInicial}">
<f:convertDateTime pattern="dd/MM/yyyy" />
</p:outputLabel>
<p:outputLabel value=" a "></p:outputLabel>
<p:outputLabel
value="#{tabelaTaxaBean.pojo.vigenciaCorrente.dataFinal}">
<f:convertDateTime pattern="dd/MM/yyyy" />
</p:outputLabel>
<p:outputLabel value=" (vigência corrente)"></p:outputLabel>
</div>
</f:facet>
<p:column headerText="Prazo (em meses)">
<p:cellEditor>
<f:facet name="output">
<p:outputLabel
value="#{corrente.prazoMinimo} a #{corrente.prazoMaximo}" />
</f:facet>
<f:facet name="input">
<p:inputText label="Prazo inicial"
value="#{corrente.prazoMinimo}" size="8" maxlength="3"
onkeypress="mascara(this, soNumeros)" required="true" />
<p:inputText label="Prazo final"
value="#{corrente.prazoMaximo}" size="8" maxlength="3"
onkeypress="mascara(this, soNumeros)" required="true" />
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Taxa de juros">
<p:cellEditor>
<f:facet name="output">
<p:outputLabel value="#{corrente.taxaJuros}">
<f:convertNumber locale="pt_BR" minFractionDigits="2"
maxFractionDigits="2" />
</p:outputLabel>
<p:outputLabel value="%" />
</f:facet>
<f:facet name="input">
<p:inputText label="Taxa de juros"
value="#{corrente.taxaJuros}"
onkeypress="mascara(this,valorMonetario)" size="11"
maxlength="6" required="true">
<f:convertNumber locale="pt_BR" minFractionDigits="2"
maxFractionDigits="2" />
</p:inputText>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Taxa diferenciada para o banco/empresa">
<p:cellEditor>
<f:facet name="output">
<p:outputLabel value="#{corrente.taxaDiferenciadaParaBanco}">
<f:convertNumber locale="pt_BR" minFractionDigits="2"
maxFractionDigits="2" />
</p:outputLabel>
<p:outputLabel value="%" />
</f:facet>
<f:facet name="input">
<p:inputText label="Taxa diferenciada para o banco/empresa"
value="#{corrente.taxaDiferenciadaParaBanco}"
onkeypress="mascara(this,valorMonetario)" size="11"
maxlength="6">
<f:convertNumber locale="pt_BR" minFractionDigits="2"
maxFractionDigits="2" />
</p:inputText>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Comissão">
<p:cellEditor>
<f:facet name="output">
<p:outputLabel value="#{corrente.comissao}">
<f:convertNumber locale="pt_BR" minFractionDigits="2"
maxFractionDigits="2" />
</p:outputLabel>
<p:outputLabel value="%" />
</f:facet>
<f:facet name="input">
<p:inputText label="Comissão" value="#{corrente.comissao}"
onkeypress="mascara(this,valorMonetario)" size="11"
maxlength="6" required="true">
<f:convertNumber locale="pt_BR" minFractionDigits="2"
maxFractionDigits="2" />
</p:inputText>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Complemento">
<p:cellEditor>
<f:facet name="output">
<p:outputLabel value="#{corrente.complementoComissao}">
<f:convertNumber locale="pt_BR" minFractionDigits="2"
maxFractionDigits="2" />
</p:outputLabel>
<p:outputLabel value="%" />
</f:facet>
<f:facet name="input">
<p:inputText label="Complemento"
value="#{corrente.complementoComissao}"
onkeypress="mascara(this,valorMonetario)" size="11"
maxlength="6">
<f:convertNumber locale="pt_BR" minFractionDigits="2"
maxFractionDigits="2" />
</p:inputText>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Ação" style="width: 5%">
<p:rowEditor />
<p:commandButton update=":form:vigenciaCorrentePanel"
process=":form:vigenciaCorrentePanel" title="Excluir"
value="Excluir">
<p:collector
removeFrom="#{tabelaTaxaBean.pojo.vigenciaCorrente.faixas}"
value="#{corrente}" />
</p:commandButton>
</p:column>
<f:facet name="footer">
<div align="right">
<p:commandButton id="btnFaixaCorrente"
process="btnFaixaCorrente" value="Adicionar faixa"
update=":dialogAdicionarFaixa" oncomplete="dlgFaixa.show();">
<f:setPropertyActionListener
target="#{tabelaTaxaBean.vigenciaTipo}" value="corrente" />
</p:commandButton>
</div>
</f:facet>
</p:dataTable>