Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/jsf/5.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 Primefaces commandLink起作用,但commandButton不起作用_Jsf_Primefaces - Fatal编程技术网

Jsf Primefaces commandLink起作用,但commandButton不起作用

Jsf Primefaces commandLink起作用,但commandButton不起作用,jsf,primefaces,Jsf,Primefaces,我对commandLink和commandButton有相同的操作。但是,commandLink的工作原理与预期相同。但使用commandButton时,不会发生任何操作。我是否缺少语法 <p:commandLink value="Submit" action="#{beanController.getStr(strSearch)}" ajax="false"/> <p:commandButton value="Submit" actionListener

我对commandLink和commandButton有相同的操作。但是,commandLink的工作原理与预期相同。但使用commandButton时,不会发生任何操作。我是否缺少语法

<p:commandLink value="Submit"  action="#{beanController.getStr(strSearch)}" ajax="false"/>
         <p:commandButton value="Submit"  actionListener="#{beanController.getStr(strSearch)}" ajax="false"/>     


commandButton按钮生成HTML
元素,commandLink生成HTML
,comandButton用于提交表单,commandLink用于提交链接,因此,您的表单未提交我建议您检查是否存在任何嵌套表单,或者代码中是否存在多个表单,或者导致表单提交的任何其他问题,如果您可以发布您的代码。

commandButton按钮生成HTML
元素,commandLink生成HTML
,comandButton用于提交表单,commandLink用于提交链接,因此,您的表单未提交我建议您检查是否存在任何嵌套表单,或者代码中是否存在多个表单,或者导致表单提交的任何其他问题,如果你可以发布你的代码。

如果你想进行导航,你应该在你的
命令按钮中使用
操作
而不是
操作监听器
,因此:

<p:commandButton value="Submit"  action="#{beanController.getStr(strSearch)}" ajax="false"/>

如果要进行导航,应在
命令按钮中使用
操作
而不是
操作侦听器
,因此:

<p:commandButton value="Submit"  action="#{beanController.getStr(strSearch)}" ajax="false"/>


谢谢,修改了问题谢谢,修改了问题您的意思是没有导航吗?如果是这样,您是否打算在
命令按钮中使用
操作
而不是
操作侦听器
?谢谢,就是这样。现在可以了。你的意思是没有导航发生吗?如果是这样,您是否打算在
命令按钮中使用
操作
而不是
操作侦听器
?谢谢,就是这样。现在可以了。谢谢,我正要查找它们之间的区别。我看到了你的答案。谢谢,我正要找出它们之间的区别。我看到了你的答案。