function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
mac adminmac admin 

how to use the action region in div tag

Hi everyone,
I want to use <apex:actionregion > component in <div></div>tags in mycustom visualforce page. Can anyone help me over.

Magesh Mani YadavMagesh Mani Yadav
Hi Mac,

May i know the reason for using <apex:actionregion >. Do you have any element which makes AJAX call in that div?
Rupal KumarRupal Kumar
In this post i am giving an example of <apex:actionRegion> usage in visualforce. it will use to achieve AJAX functionality to partial page refresh.
Vf page-
<apex:page controller="ActionRegionCLS" >
 <apex:pagemessages id="msgs"></apex:pagemessages>
 <apex:form >
  <apex:pageblock id="pb">
     <apex:actionRegion >
        <td> <apex:outputLabel value="Enter Account Number"> </apex:outputLabel> </td>
          <apex:inputtext value="{!reqAccNumber}"/>
          <apex:commandButton value="Retrive" action="{!fillRecord}" rerender="pb,msgs"/>
      <td> <apex:outputLabel value="Account Name"> </apex:outputLabel> </td>
        <apex:inputField value="{!accObj.Name}"/>
     <td> <apex:outputLabel value="Account Type"> </apex:outputLabel> </td>
      <td>  <apex:inputField value="{!accObj.Type}"/> </td>

public class ActionRegionCLS{
 public String reqAccNumber{get;set;}
 public Account accObj{get;set;}

 public ActionRegionCLS(){
  accObj = new Account();
 public void fillRecord(){
  if(reqAccNumber !=null && reqAccNumber !=''){
    List<Account> accLst = new List<Account>();
    accLst = [select id,Name,AccountNumber,Type,AnnualRevenue from Account where AccountNumber =:reqAccNumber];
    if(accLst !=null && accLst.size()>0){
     accObj = accLst[0];
     ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.Info,' No Records found with this Account Number:'+reqAccNumber);
     accObj  = null;

Releted Link-  (

Rupal Kumar