1
In my xhtml I have 2 input value 1 and 2.
The first input works perfectly the jquery mask for currency. More in the 2 input that is in a modal the coin mask is not working.
coin function
function configurarMoeda() {
$(".moeda").maskMoney({ decimal: ",", thousands: ".", allowZero: true });
}
$(document).ready(function() {
configurarMoeda();
});
My xhtml
<ui:define name="content">
<h1 class="aw-page-title">Armas</h1>
<div style="width: 80%; margin: 0 auto;">
<h:form id="frm">
<p:messages id="msgs" escape="true" closable="true" />
<p:toolbar id="toolbar">
<f:facet name="right">
<p:commandButton value="Novo" icon="fa fa-file-text" alt="Novo"
title="Novo" action="#{armaBean.novo}" process="@this"
update="dialog_arma" oncomplete="PF('edicaoArmaDialog').show()">
<p:resetInput target="dialog_arma" />
</p:commandButton>
</f:facet>
</p:toolbar>
<p:outputLabel value="Valor 1 " for="moeda" />
<p:inputText id="moeda" styleClass="moeda" label="Valor" maxlength="10"
value="#{armaBean.arma.valor}" />
</h:form>
</div>
<p:dialog widgetVar="edicaoArmaDialog" id="dialog_arma"
resizable="false" modal="true" closeOnEscape="true" responsive="true"
appendTo="@(body)" header="Cadastro de Armas">
<h:form id="frm_dialog">
<h:inputHidden id="id_arma" value="#{armaBean.arma.idArma}" />
<h:panelGrid id="painel_edicao_dialog" layout="block"
styleClass="ui-fluid">
<p:panelGrid layout="grid" columns="2"
styleClass="panelgrid-noborder"
columnClasses="ui-grid-col-3, ui-grid-col-9">
<p:outputLabel value="Valor 2" for="moeda" />
<p:inputText id="moeda" styleClass="moeda" label="Valor"
maxlength="10" value="#{armaBean.arma.valor}">
</p:inputText>
</p:panelGrid>
</h:panelGrid>
</h:form>
</p:dialog>
</ui:define>
Robson, show some error in your browser console?
– Pedro Camara Junior