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
Jamz_2010Jamz_2010 

Accessing child components of a Visualforce page

Hi

 

I've got a Visualforce page that contains another page using a composition. Is it possible to access the variables of the child pages controller in the parent page (or pass the variables up from the child page)?

 

Many Thanks

 

James

VisualForceVisualForce

Hi..

 You can pass values from child page to parent page

Child page code. <apex:commandbutton value="Parent" action="{!Parent}" /> Child page controller code. public PageReference Parent() { PageReference parPage=new PageReference('/'+Apex/urParentVFPagename?var1='+val1+'&var2='+val2); parPage.setRedirect(true); return parPage; } Parent Page controller datatype var1=Apexpages.currentPage().getParameters().get('var1'); datatype var2=Apexpages.currentPage().getParameters().get('var2');

 

Jamz_2010Jamz_2010

Thats great, but is there anyway of doing this without having to refresh the page?

 

James