Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between partialSubmit and autoSubmit in JSF?

Tags:

jsf

oracle-adf

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

like image 958
AppleGrew Avatar asked Sep 02 '11 09:09

AppleGrew


People also ask

What is PartialSubmit in JSF?

PartialSubmit reduces network traffic by only adding the partially processed components to the ajax request post. For big pages with many input components, partialSubmit is extremely useful as it leads to more lightweight requests.

What is AutoSubmit in ADF?

When AutoSubmit=”true” property is set for an input text field, then only that component will go through the Life Cycle event when curser is removed/ tab out from that input text field. Though other fields have values entered and which are not valid, it won't throw any error.

What are partial triggers in ADF?

In order to provide a dynamic and responsive web application and make changes from the server side to the client side, a technique emerged back in 2007 called Ajax that is still being used up to this moment. In ADF Faces, Ajax is implemented under a different umbrella called PPR.

Which make use of partial triggers for refreshing the part of the web page dynamically?

PPR is Partial Page Rendering, similarly to Ajax. It is used to dynamically refresh the part of page.It is done with the use of partial triggers.


2 Answers

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

like image 147
Billy Bob Bain Avatar answered Oct 11 '22 15:10

Billy Bob Bain


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

like image 35
maple_shaft Avatar answered Oct 11 '22 16:10

maple_shaft