You need to sign in to do that
Don't have an account?
balraj singh 33
Not able to pass id from visualforce to controller. IT is not redirecting to edit page. i see the id filed has null in the url Please help
MY VISUALFORCE PAGE CONATINS
<apex:pageblocktable value="{!var21}" var="a" ID="B">
<apex:column >
<apex:commandlink Value="EDIT" action="{!editaccount}" target="_blank">
<apex:param value="{!a.id}" assignTo="{!idvariable}"></apex:param>
</apex:commandlink>
</apex:column>
<apex:column value="{!a.name}"/>
</apex:pageblocktable>
MY CONTROLLER APEX:
public string idvariable{get;set;}
public pagereference editaccount()
{
PageReference newPage = new PageReference('/'+idvariable+'/e');
newPage.setRedirect(true);
return newPage;
}
<apex:pageblocktable value="{!var21}" var="a" ID="B">
<apex:column >
<apex:commandlink Value="EDIT" action="{!editaccount}" target="_blank">
<apex:param value="{!a.id}" assignTo="{!idvariable}"></apex:param>
</apex:commandlink>
</apex:column>
<apex:column value="{!a.name}"/>
</apex:pageblocktable>
MY CONTROLLER APEX:
public string idvariable{get;set;}
public pagereference editaccount()
{
PageReference newPage = new PageReference('/'+idvariable+'/e');
newPage.setRedirect(true);
return newPage;
}
Vf Page:
Class:
This perfectly worked for me .
Thanks
Bhargavi.
All Answers
I got the same issue.And this was resolved when I used rerender attribute in the commandlink . Try rerendering the pageBlockTable.
Hope this Helps.
Thanks.
URL:https://balraj-singh-dev-ed.my.salesforce.com/null/e .it is not value of id
Vf Page:
Class:
This perfectly worked for me .
Thanks
Bhargavi.