在JSF中,partialSubmit和autoSubmit有什么区别? [英] What is the difference between partialSubmit and autoSubmit in JSF?

查看:115
本文介绍了在JSF中,partialSubmit和autoSubmit有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想我知道区别,但是现在我发现自己很困惑. :P

I guess I knew the difference, but right now I find myself confused. :P

这两者似乎都做相同的事情,只是在提交按钮上使用partialSubmit来使用AJAX提交表单,而在可编辑组件上使用autoSubmit来提交表单,而可编辑组件仅提交自己的内容.我说的对吗?

Both of them seem to be do the same thing, except that partialSubmit is used on submit buttons to submit the form using AJAX and autoSubmit is used on editable components, which submits only its own contents. Am I right in saying this?

推荐答案

它们都是启用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

这篇关于在JSF中,partialSubmit和autoSubmit有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆