You need to sign in to do that
Don't have an account?
what is the use of action region?
can you please tell me what is the use of action region? and why & when we're using it?
any sample example please.
any sample example please.
You need to sign in to do that
Don't have an account?
This describes mainly about <apex:actionRegion> tag used in visualforce Page. <apex:actionRegion> is used to optimise VF performance.
ActionRegion tag defines which components of VF page should be processed by Force.com server.
By Components mean, all the visualforce tags like inputField, inputText, outputPanels etc.
See this simple example Below.
in above example if you enter account Name, then suddenly an error for Industry appears saying “You Must Enter a value”.
How come this error appeared ? even if we just entered “Account Name”?.
This is beacuse, when AJAX request is generated through event such as “onClick”, or “onChange” etc. , whole <apex:form> is submitted to theForce.com server to Process setting Industry value to NULL. Hence error appeared.
How to Solve this Issue?
See this VF page code below.
we used <apex:actionRegion> tag for field “myAccount.Name”.
What it does?
“ActionRegion” tells Force.com Server which components should be proccessed. Here whatever inside an ActionRegion is processed by a server when AJAX request is generated on event such as “KeyPress” or “onClick” etc.
Thus we do not get an error.
Above code is tested in my developer org. So it should work even if you copied and pasted it as is.
Still if you have any queries please send me your email address for further communication.
Kindly mark it as solved if it really helps you.
Thanks & Regards,
Nagendra.P
9848950830
All Answers
This describes mainly about <apex:actionRegion> tag used in visualforce Page. <apex:actionRegion> is used to optimise VF performance.
ActionRegion tag defines which components of VF page should be processed by Force.com server.
By Components mean, all the visualforce tags like inputField, inputText, outputPanels etc.
See this simple example Below.
in above example if you enter account Name, then suddenly an error for Industry appears saying “You Must Enter a value”.
How come this error appeared ? even if we just entered “Account Name”?.
This is beacuse, when AJAX request is generated through event such as “onClick”, or “onChange” etc. , whole <apex:form> is submitted to theForce.com server to Process setting Industry value to NULL. Hence error appeared.
How to Solve this Issue?
See this VF page code below.
we used <apex:actionRegion> tag for field “myAccount.Name”.
What it does?
“ActionRegion” tells Force.com Server which components should be proccessed. Here whatever inside an ActionRegion is processed by a server when AJAX request is generated on event such as “KeyPress” or “onClick” etc.
Thus we do not get an error.
Above code is tested in my developer org. So it should work even if you copied and pasted it as is.
Still if you have any queries please send me your email address for further communication.
Kindly mark it as solved if it really helps you.
Thanks & Regards,
Nagendra.P
9848950830
actionRegion provides an area of a Visualforce page that decides and separates which components should be processed by the force.com server when an AJAX request is generated. Only the components which are inside actionregion component are processed by server, so it increases visualforce page performance.
Please refer the below links for more examples on actionRegion:
http://sfdcsrini.blogspot.com/2014/07/visualforce-action-region-example.html
http://www.sfdcpoint.com/salesforce/actionregion-visualforce-salesforce/
http://letusembed.com/2014/08/action-region-and-action-status-in-salesforce.html/
Hope this helps you!
Best Regards,
Deepthi
Action region is one of the most important tags which helps in increasing page performance. So we should try to make maximum use of action region in visual force page.
actionRegion component only defines which components the server processes during a request; it does not define which of the page are re-rendered when the request completes. We will still use reRender attribute on action component to decide area which should be rerendered AJAX request completes.
One more important point to note is that even when we use <apex:actionRegion> component, the whole form is still submitted, but the only area which is inside actionRegion is processed by the server.
One more important point to note is that by passing the validation rules using Action Region.
I will explain the importance of actionRegion with the help of two examples. The first example will not use actionRegion and the second example will use actionRegion. Here in both example, we are trying to show phone textbox when we are selecting customer priority as high.
Example 1 :Without <apex:actionRegion>
In this example, we are trying to show phone textbox when we are selecting high customer priority; then we are getting an error as SLA and Account name is required. So validation fails.
VisualForce Page:
Controller
Now in the second example, we will use the same code but with actionRegion tag. So in second example no validation error will be returned as only code inside action region component is processed by the server.
Example 2: with <apex:actionRegion>
Apex Code:
Please check the below link for more examples of action region.
http://sfdcsrini.blogspot.com/2014/07/visualforce-action-region-example.html
Hope this helps you!
Best Regards,
Jyothsna
While executing above code without apex:actionregion, the phone input label does not appear when previewing the page without any record ID.
It does however work perfectly, when used with a record ID.
When used with apex:actionregion, it does work in both the scenario : when loaded with or without record ID.
Could you please advise the reason.