Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jsf remoteCommand和inputMask don';我们不能一起工作_Jsf_Jsf 2_Primefaces - Fatal编程技术网

Jsf remoteCommand和inputMask don';我们不能一起工作

Jsf remoteCommand和inputMask don';我们不能一起工作,jsf,jsf-2,primefaces,Jsf,Jsf 2,Primefaces,我试图进行地址验证,当我设置CEP时,系统将转到托管bean,请求Web服务并返回有关街道、城市和州的信息(CEP是一种地址代码)。 但是,当我将remoteCommand与inputMask组件一起使用时,我的托管bean没有收到对象中的信息,cep属性为null 我有一个带有@ViewScoped的托管bean <p:remoteCommand name="remoteCep" actionListener="#{empresaTerceiroMB.buscarCep}" proces

我试图进行地址验证,当我设置CEP时,系统将转到托管bean,请求Web服务并返回有关街道、城市和州的信息(CEP是一种地址代码)。 但是,当我将remoteCommand与inputMask组件一起使用时,我的托管bean没有收到对象中的信息,cep属性为null

我有一个带有@ViewScoped的托管bean

<p:remoteCommand name="remoteCep" actionListener="#{empresaTerceiroMB.buscarCep}" process="@this" async="true" update="cep, logradouro, bairro, cidade, estado, mensagens" >
    <p:inputMask id="cep" mask="99999-999" value="#{empresaTerceiroMB.endereco.cep}" title="#{msgs.msgCepEmpresa}" maxlength="8" onblur="remoteCep()" style="width: 90%" />
</p:remoteCommand>

嗯,我从来没有像您使用远程命令那样使用过它。我甚至不确定它是否应该有一个子组件

最好的方法是:

<p:inputMask id="cep" mask="99999-999" value="#{empresaTerceiroMB.endereco.cep}" title="#{msgs.msgCepEmpresa}" maxlength="8" onblur="remoteCep()" style="width: 90%" />
<p:remoteCommand name="remoteCep" actionListener="#{empresaTerceiroMB.buscarCep}" process="cep" async="true" update="cep, logradouro, bairro, cidade, estado, mensagens" />

您希望
输入掩码
远程命令
有什么作用?您知道它们甚至不在同一个组件系列中:
remoteCommand
是一个命令组件,
inputMask
是一个
UIInput
。如果有的话,它们应该反向嵌套。无论如何,这都不可能