You need to sign in to do that
Don't have an account?
sid_dev
How to access parameters from URl in Visual Force page
Hi,
I have a custom button which is passing some parametes in the URL. I want to access the querystring paramters in the VF page and assign the value to the inputField
I have tried the following:
Email: <apex:inputField value="{!$CurrentPage.parameters.email}"/><br/>
But I get the error message that 'paramter' does not exist. Can anyone point me to a solution or to a post where the solution is already provided.
Thanks
Saw this example from the developers guide
<apex:detail subject="{!$CurrentPage.parameters.cid}" relatedList="false" title="false"/>
But how will I get that value in the inputField. I need to show the email value in a text box.
Yes I am getting the email in the URL
I solved the problem by using javascript instead.
Need to look for the id by doing view source and then assign the parameter. Since contact object doesn't have any value and it is being passed in the URL through a custoe button I used JS to find the id and assign the value.
<apex:inputField value="{!contact.Email}" id="Email"/>
document.getElementById("j_id0:j_id2:j_id3:j_id4:Email").value = "{!$CurrentPage.parameters.email}";
Hi Rajesh,
Can you please elaborate a little more. I am new to this so I am not sure abt the methodology you are talking abt.
Thanks,
Sid
See the following code
<apex:page id="ApproveTicket" > <script> // Javascript Code function closeWindow() { var errorMessage = document.getElementById("ApproveTicket:ApprovalForm:ErrorHidden").value; } </script> <apex:form id="ApprovalForm" > <apex:inputHidden value="{!errorMessage}" id="ErrorHidden" /> </apex:form></apex:page>