You need to sign in to do that
Don't have an account?
Apex Param not being passed to controller, simple example
Page:
<apex:page controller="param" >
<apex:form>
<apex:commandButton value="Proceed to Upload" action="{!proceedToUpload}" id="uploadButton">
<apex:param name="uploadType" assignTo="{!uploadType}" value="org" id="param"/>
</apex:commandButton>
</apex:form>
</apex:page>
Controller:
public class param {
public String uploadType {get; set;}
public pageReference proceedToUpload(){
system.debug(uploadType);
system.debug(ApexPages.currentPage().getParameters().get('uploadType'));
system.debug(ApexPages.currentPage().getParameters());
return null;
}
}
Please tell me I am blind and this is a simple typo I have overlooked. If you don't mind could you try to reproduce this in your org.
Thanks,
Jason
Jeez, I just realized this is the known bug with params not working with command buttons. What is up salesforce? This bug has been around for what seems like forever and it is something that many users have come across. Is a fix close?
If a fix isn't reasonable how about preventing saves if a commandButton has params as children?
This is how it should be written....
Page:
Controller:
I just re-posted this because I noticed the code had been removed ;-)
After summer 2010 upgrade still this bug exist am facing similar issue.
Use this instead:
try this
<apex:column >
<apex:outputlink value="/apex/updateEmployee" style="color:black;">
<apex:param name="id" value="{! employee.employeeId__c}"/>
</apex:outputLink>
</apex:column>
In the value field of outlink you must provide your page name as i have provided updateEmployee.
I faced the same issue if I use commandbutton the apex:param is getting as null in the controller getting exception as you suggested in the above I have replaced with commandbutton with apex:commandLink its working fine. Here I got a requirement need to use the commandbutton instead of commandlink so how can i overcome this issue kindly suggest
<apex:commandbutton> tag cannot be parent to <apex:param> Tag so this wont work.
This is a bug in VF page.
Thanks