What is the difference between partialSubmit and autoSubmit in JSF?

后端 未结 2 1251
一整个雨季
一整个雨季 2021-02-10 13:22

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

Both of them seem to be do the same thing, except that partialSubmit is used on subm

相关标签:
2条回答
  • 2021-02-10 13:31

    The accepted answer isn't 100% correct for ADF. The partialTriggers attribute is involved in the lifecycle.

    From Enabling Partial Page Rendering Declaratively

    The autoSubmit attribute on an input component and the partialSubmit attribute on a command component are not the same thing. When partialSubmit is set to true, then only the components that have values for their partialTriggers attribute will be processed through the lifecycle. The autoSubmit attribute is used by input and select components to tell the framework to automatically do a form submit whenever the value changes. However, when a form is submitted and the autoSubmit attribute is set to true, a valueChangeEvent event is invoked, and the lifecycle runs only on the components marked as root components for that event, and their children. For more information, see Section 4.4, "Using the Optimized Lifecycle".

    0 讨论(0)
  • 2021-02-10 13:46

    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 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.

    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.

    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

    0 讨论(0)
提交回复
热议问题