You need to sign in to do that
Don't have an account?
babloo123
Prevent reentering values in the VF page after submit
Can some one guide me how to prevent users from going back and entering details on VF page after clicking submit as submit function locks the page to edit further. But id he clicks back again the page opens need some guidance on this if any one has come across this issue?
Would need your sample code to know exactly what you are trying to accomplish.
Regardless, an initialize pagereference method may be your best route to go.
<apex:page controller="mycontroller" action="{!initialize}">
pagehere
</apex:page>
public with sharing class mycontroller{
public pagereference initialize(){
if(fieldvalue != null || variable != null){
pageference p = new pagereference('http://yoururlhere.com');
return p;
}else{
return null;
}
}
}
But I did not get field value and variable can you give me a small example. Your help is greatly appreciated
<apex:page standardcontroller="Case" extensions="mycontroller" action="{!initialize}">
<apex:inputfield value="{!Case.Subject}/>
<apex:commandbutton value="Submit" action="{!submit}"/>
</apex:page>
public with sharing class mycontroller{
Case c;
public ProjectController(ApexPages.StandardController controller) {
this.c = (Case)controller.getRecord();
}
public pagereference submit(){
c.Status = 'Closed';
update c;
return Page.Thankyou;
}
public pagereference initialize(){
if(c.Status = 'Closed'){
return Page.Thankyou;
}else{
return null;
}
}
}