function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ankethaanketha 

param tag

Hi,

  I have included some input fields which includes name input field and a command button in a visualforce page...when i click on this command button ,it wil navigate to another page..I want the name entered in the input field in the first page to be displayed in the second page after clicking on the command button.how can this be done through a param tag.?

APathakAPathak

On clicking the command link, the user will be redirected to contact edit page with first name field filled with the passed parameter("Agriculture").

 

 Page :-

<apex:page controller="SiteController">
    <apex:form >
    <apex:pageBlock >
        <apex:commandlink value="See the param" action="{!method1}">
        <apex:param value="Agriculture" assignTo="{!par}"/>
        </apex:commandlink>
        
    </apex:pageBlock>
    </apex:form>    
</apex:page>

 Controller:-

public class SiteController {

    public SiteController() {

    }
    public string par{get;set;}
    public pagereference method1()
    {
       PageReference secondPage = new pagereference('/003/e?name_firstcon2=' + par);
       secondPage.setRedirect(true);
       return secondPage;
    }
}