Jsf 无法将组件传递给进程
我试图在JSF中处理一个输入并执行一个操作,但该操作甚至没有执行。 下面是我尝试引用具有样式类的组件的代码:Jsf 无法将组件传递给进程,jsf,primefaces,Jsf,Primefaces,我试图在JSF中处理一个输入并执行一个操作,但该操作甚至没有执行。 下面是我尝试引用具有样式类的组件的代码: <h:panelGroup layout="block"> <p:inputText id="txtClientCIN" widgetVar="ClientCIN" value="#{client.clientCIN}" required="true" styleClass="textcin"/> <p:commandButton id="b
<h:panelGroup layout="block">
<p:inputText id="txtClientCIN" widgetVar="ClientCIN" value="#{client.clientCIN}" required="true" styleClass="textcin"/>
<p:commandButton id="btnSearchClient" icon="ui-icon-search" action="#{client.checkCIN}" process="@(.textcin)" update="@form" style="margin-left: 10px;"/>
</h:panelGroup>
我试图通过设置process=“txtClientCIN”
但是也不管用
当我将流程更改为@form
时,checkCIN()
方法执行得很好。据我所知:
具有如下标准命令按钮:
<p:commandButton actionListener=“#{bean.method}”/>
将处理@form,调用bean.method()并不更新任何内容
而是这个
<p:commandButton actionListener=“#{bean.method}”
process=“someComponentId”
update=“otherComponentId”/>
将处理“someComponentId”并更新“otherComponentId”。但是现在命令按钮本身将不会被处理,就像在第一个示例中一样。意思是不会调用bean.method()
所以我们需要
<p:commandButton actionListener=“#{bean.method}”
process=“@this someComponentId”
update=“otherComponentId”/>
或者完全省略process属性,或者将其设置为“@form”(这是多余的)
进一步阅读答案。用process=“@this txtClientCIN”尝试一下它:它成功了。。。非常感谢。但是为什么呢?只有身份证是不够的?