+ 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