I am opening one VF page on click of edit fo lis view of particular object. Now I want to get the id of that particular record which I edited. I am writing this code but its throwing this error.
Cyclical server-side forwards detected: /apex/CasePopulate
VF Code
<apex:page standardController="Case_Accession__c" extensions="ExtentionController1" action="{!pageredir}" >
<apex:form >
<apex:pageBlock >
<!-- Begin Default Content REMOVE THIS -->
<h1>Congratulations</h1>
This is your new Page
<!-- End Default Content REMOVE THIS -->
<apex:inputText value="{!TestEditSpecimenID }"/>
</apex:pageBlock>
</apex:form>
</apex:page>
Apex Code
public class ExtentionController1
{
public String var {get;set;}
public string TestEditSpecimenID {get;set;}
public ExtentionController1(ApexPages.StandardController controller)
{}
public Pagereference pageredir()
{
var= ApexPages.currentPage().getParameters().get('Id');
if(var!=null)
{
TestEditSpecimenID = var;
Pagereference newpage = new Pagereference ('/apex/CasePopulate');
//Pagereference newpage =Page.Accession;
return newpage;
}
else
{
//Pagereference newpage =Page.Accession;
return null;
}
}
}
One more thing please I want to show the ID of reord into " "
Thanks in advance Raman