如何用jQuery捕捉对话素数?
我在myfile.js中有一个简单的函数:如何用jQuery捕捉对话素数?,jquery,jsf,primefaces,Jquery,Jsf,Primefaces,我在myfile.js中有一个简单的函数: function inclusaoDialog(args, dialog) { if (!args.validationFailed) { PF(dialog).hide(); } } 适用于(primefaces_5): 以及: 我已经发现了如何捕获JSF客户端树的元素,但是对于primefaces这样的框架,存在库冲突问题。那么,如何用jQuery捕捉对话素数? 我想我犯了很多错误。 有什么想法吗?试试看 Requ
function inclusaoDialog(args, dialog) {
if (!args.validationFailed) {
PF(dialog).hide();
}
}
适用于(primefaces_5):
以及:
我已经发现了如何捕获JSF客户端树的元素,但是对于primefaces这样的框架,存在库冲突问题。那么,如何用jQuery捕捉对话素数?
我想我犯了很多错误。
有什么想法吗?试试看
RequestContext.getCurrentInstance.execute("Pf('widgetdialogname').hide()")
在托管bean的postconstruct
中
<h:outputScript library="primefaces" name="jquery/jquery.js" target="head" />
<h:outputScript library="js" name="myfile.js" target="head"/>
$ = jQuery;
$(document).ready(function inclusaoDialog(args, dialog) {
if (!args.validationFailed) {
PF(dialog).hide();
}
});
<p:commandButton ... oncomplete="inclusaoDialog(args, '#frmTipo\\:dialogoTipo')" />
<h:form id="frmCadastro">
...
</form>
<h:form id="frmTipo">
<p:dialog header="Adicionar Tipo de Ocorrência" modal="true"
widgetVar="dialogoTipo" id="dialogoTipo" showEffect="blind" hideEffect="fade"
resizable="false" styleClass="cadastro-dialog" position="left,top">
<h:panelGroup id="inclusaoTipoPanel">
<p:messages />
<p:panelGrid columns="2">
<p:outputLabel value="Tipo" />
<h:panelGroup>
<p:inputText id="novoTipoOcorrencia" size="30" maxlength="45"
value="#{ocorrenciaView.tipoOcorrencia.descricao}"
required="true"
requiredMessage="Informe o novo tipo de Ocorrência." />
<p:commandButton value="Incluir"
style="display: block; margin-top:5px;"
actionListener="#{ocorrenciaView.addTipoOcorrencia}"
process="@this :frmTipo:novoTipoOcorrencia"
update=":frmCadastro:tipoOcorrencia :frmTipo:inclusaoTipoPanel"
oncomplete="inclusaoDialog(args, '#frmTipo\\:dialogoTipo')" />
</h:panelGroup>
</p:panelGrid>
</h:panelGroup>
</p:dialog>
</h:form>
[<h:outputScript library="primefaces"...]
$.noConflict();
jQuery(document).ready(function inclusaoDialog(args, dialog) {
if (!args.validationFailed) {
jQuery(dialog).hide();
}
});
RequestContext.getCurrentInstance.execute("Pf('widgetdialogname').hide()")