且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在JSF中,partialSubmit和autoSubmit有什么区别?

更新时间:2023-12-04 16:56:40

它们都是启用AJAX的调用,这些调用发生在自定义JSF组件的自定义属性中. autoSubmit本质上异步地回发特定于组件的内容,以使服务器端托管的Bean值与客户端组件中的内容保持最新.

They are both AJAX enabled calls occurring from custom properties of custom JSF components. The autoSubmit essentially asynchronously postsback content specific to the component for keeping the server side managed bean values current with the content within the component on the client side.

A partialSubmit是另一个异步AJAX调用,它将用于在某种类型的组件事件上立即回发组件值,例如失去对ICEFaces inputText组件的关注.

A partialSubmit is another asynchronous AJAX call that will serve to immediately postback a component value on some kind of component event, like losing focus on an ICEFaces inputText component for example.

需要注意的有趣的是,整个ViewState会在每种异步提交类型上重新发布,因此,如果在提交之前页面上HAD的其他组件的值已更改,则绑定的服务器端托管Bean属性将具有其值即使客户端组件可能不刷新以反映可能发生的任何服务器端数据更改,也都将刷新.

The interesting thing to note is that the entire ViewState is posted back on each type of asynchronous submit, so if the values of other components HAD changed on the page before the submit, the bound server side managed bean properties will have their values refreshed as well, even though the client side components MAY not be refreshed to reflect any server side data changes that may have occurred.

实际上,整个JSF服务器端生命周期都发生在每个回发中,请阅读以下有关实现调试PhaseListener的文章,该文章使您可以查看每个异步提交操作发生之后正在发生什么阶段.

In fact, the entire JSF server side lifecycle occurs on each postback, read the following article on implementing a debug PhaseListener that allows you to see what Phases are occurring after each asynchronous submit operation occurs.

http://balusc.blogspot.com/2006/09/debug-jsf-lifecycle.html