You need to sign in to do that
Don't have an account?
nimdhar
how to access the parameters sent using a command button in a controller
Hi,
I am sending parameters using a command button to a controller as follows
<apex:commandButton value="Attach" action="{!attach}" >
<apex:param name="leadId" value="{!$CurrentPageReference.parameters.q}" />
<apex:param name="locId" value="{!location.id}" />
</apex:commandButton>
I am trying to access those parametrs in the controller by having a get and set method. But it is not working. Can anyone suggest me how to access those parameters in a controller.
Thanks,
Nimdhar
I am sending parameters using a command button to a controller as follows
<apex:commandButton value="Attach" action="{!attach}" >
<apex:param name="leadId" value="{!$CurrentPageReference.parameters.q}" />
<apex:param name="locId" value="{!location.id}" />
</apex:commandButton>
I am trying to access those parametrs in the controller by having a get and set method. But it is not working. Can anyone suggest me how to access those parameters in a controller.
Thanks,
Nimdhar
I have an S-contol that pop ups the visual force page and I passed the query parameter in the URL
window.open ("/apex/searchLocation?q={!Lead.Id}","myWindow",' status=1,height=600, width=1000,menubar=no,toolbar=no');
I am able to access that parameter directly in my controller as below
Lead lead = [select Id,Location__c,LastName from Lead where Id= :System.currentPageReference().getParameters().get('q')];
But when I tried to access the parameter of a CommandButton
System.debug('Location passed from visual Force' + System.currentPageReference().getParameters().get('locationId'));
I am getting null value.
command Button in my visual force page
<apex:commandButton value="Attach" action="{!attach}" >
<apex:param name="locationId" value="{!location.id}" />
</apex:commandButton>
Thanks
Nimdhar
Thanks,
Nimdhar