简体   繁体   English

相当于<f:ajax render=“@form” />

[英]Equivalent of <f:ajax render=“@form” />

Recently I started using prettyfaces with my web application which uses jsf1.x. 最近,我开始在使用jsf1.x的Web应用程序中使用prettyfaces。 While testing I realized that action methods for h:commandButton and h:commandLink is not getting called. 在测试时,我意识到没有调用h:commandButton和h:commandLink的操作方法。 Upon searching on the net, I found a link on this site where some suggested to use <f:ajax render="@form" /> it should be ok. 在网上搜索后,我在此站点上找到一个链接,其中有些建议使用<f:ajax render="@form" />应该没问题。 Since f:ajax is available in JSF2.x, so I was thinking how can I find the equivalent of <f:ajax render="@form" /> in Jsf1.x 由于f:ajax在JSF2.x中可用,因此我在考虑如何在Jsf1.x中找到<f:ajax render="@form" />的等效项。

Any help be greatly appreciated as I am completely stuck due to this. 任何帮助都将不胜感激,因为我因此而完全陷入困境。

Thanks, Neeraj 谢谢,Neeraj

There is something seriously wrong if the actions of the h:commandButton and h:commandLink are not being called anymore. 如果不再调用h:commandButtonh:commandLink的操作,则存在严重错误。 Maybe it's something easy like failed validation, which cancels the call of the action (try immediate="true" in your button/links ). 也许这很容易失败验证之类的事情,它取消了action的调用( immediate="true" in your button/links尝试immediate="true" in your button/links )。 If it's not, then you should try to find and fix what causes this instead of switching to Ajax functionality. 如果不是,那么您应该尝试查找并解决导致此问题的原因,而不是切换到Ajax功能。

As already pointed out, you may use a4j which is delivered with RichFaces 3 and works also with JSF 1. 如前所述,您可以使用RichFaces 3附带的a4j ,它也可以与JSF 1一起使用。

BUT you cannot throw away this basic functionality. 但是您不能放弃此基本功能。 Using Ajax only you will run into a lot of problems later on. 仅使用Ajax会在以后遇到很多问题。 a4j:ajax might be the equivalent of f:ajax , but it's certainly not equivalent to the standard post- action functionality. a4j:ajax可能是相当于f:ajax ,但它肯定不是相当于标准后action功能。

One common usecase would be a PDF to be displayed. 一个常见的用例是要显示的PDF。 This isn't possible with an Ajax partial-update. 使用Ajax部分更新是不可能的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM