You need to sign in to do that
Don't have an account?

Visualforce ID
How to pass Visualforce ID, one Visualforce page to another Visualforce page
Thanks
SFDC_Learner
You need to sign in to do that
Don't have an account?
How to pass Visualforce ID, one Visualforce page to another Visualforce page
Thanks
SFDC_Learner
source
<apex:page controller="SFDCVariables_01">
<a href="/apex/SFDCVariables_02?MyVariable=25">Click Me</a>
<apex:form >
<apex:pageblock >
<apex:pageblockButtons >
<apex:commandButton value="click Me 2" action="{!Transfer}" />
</apex:pageblockButtons>
<apex:pageBlockSection >
<apex:inputText value="{!Value2Pass}" />
</apex:pageBlockSection>
</apex:pageblock>
</apex:form>
</apex:page>
public class SFDCVariables_01 {
public String Value2Pass { get; set; }
public PageReference Transfer() {
PageReference newPAge = page.SFDCVariables02;
newPage.getParameters().put('MyVariable', Value2Pass);
return newPage;
}
}
DESTINATION
<apex:page controller="SFDCVariables02">
<apex:form >
<apex:inputText value="{!Var01}" />
</apex:form>
</apex:page>
public class SFDCVariables02 {
public String Var01 { get; set; }
public SFDCVariables02() {
Var01 = Apexpages.currentPage().getParameters().get('MyVariable');
}
}
All Answers
source
<apex:page controller="SFDCVariables_01">
<a href="/apex/SFDCVariables_02?MyVariable=25">Click Me</a>
<apex:form >
<apex:pageblock >
<apex:pageblockButtons >
<apex:commandButton value="click Me 2" action="{!Transfer}" />
</apex:pageblockButtons>
<apex:pageBlockSection >
<apex:inputText value="{!Value2Pass}" />
</apex:pageBlockSection>
</apex:pageblock>
</apex:form>
</apex:page>
public class SFDCVariables_01 {
public String Value2Pass { get; set; }
public PageReference Transfer() {
PageReference newPAge = page.SFDCVariables02;
newPage.getParameters().put('MyVariable', Value2Pass);
return newPage;
}
}
DESTINATION
<apex:page controller="SFDCVariables02">
<apex:form >
<apex:inputText value="{!Var01}" />
</apex:form>
</apex:page>
public class SFDCVariables02 {
public String Var01 { get; set; }
public SFDCVariables02() {
Var01 = Apexpages.currentPage().getParameters().get('MyVariable');
}
}
Thanku Kiran
Thanks,
SFDC Learner