Friday, June 8, 2012

PARTIAL PAGE REFRESH:

PARTIAL PAGE REFRESH:
This post regarding partial page in vf.When you click the button it will invoke the “doSomething” method and then rerender the outputPanel with any changes made by the “doSomething” method.


RerenderTest Class:



public with sharing class rerenderTest {

    public String showInRerender {get;set;}
    public String showInRerenderModified;
    
    public String getShowInRerenderModified(){

          return showInRerenderModified;

     }

     public void doSomething (){

        showInRerenderModified = 'Here is what you just typed: ' + showInRerender;

    } 

}

Partial Page Refresh Page:


<apex:page controller="rerenderTest">
  <h1>Partial Page Refresh</h1>
 <apex:form >
  
  Put some text here: <apex:inputText value="{!showInRerender}" />
  
  <apex:commandButton action="{!doSomething}" rerender="idToRerender" value="Rerender"/>

 </apex:form>

 <apex:outputPanel id="idToRerender"> 
  {!showInRerenderModified} 
 </apex:outputPanel>
</apex:page>


No comments:

Post a Comment