Sample Code:
Visualforce page:
<apex:page controller=”Sample”>
<apex:form >
<apex:pageBlock >
<apex:panelGrid >
Name: <apex:inputtext />
Age: <apex:inputtext />
Addres: <apex:inputTextarea />
</apex:panelGrid>
<apex:pageBlockButtons >
<apex:commandButton value=”Reset” action=”{!reset}”/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
Apex Controller:
public without Sharing class Sample {
public Sample() {
}
public PageReference reset() {
PageReference pg = new PageReference(System.currentPageReference().getURL());
pg.setRedirect(false);
return pg;
}
}
Visualforce page:
<apex:page controller=”Sample”>
<apex:form >
<apex:pageBlock >
<apex:panelGrid >
Name: <apex:inputtext />
Age: <apex:inputtext />
Addres: <apex:inputTextarea />
</apex:panelGrid>
<apex:pageBlockButtons >
<apex:commandButton value=”Reset” action=”{!reset}”/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
Apex Controller:
public without Sharing class Sample {
public Sample() {
}
public PageReference reset() {
PageReference pg = new PageReference(System.currentPageReference().getURL());
pg.setRedirect(false);
return pg;
}
}