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

Sharing variables on included visualforce pages
I have a visualforce page that shows charts that I would like to filter based on a filter header settings. For example, when the user selects a specific Country, the charts will be rerendered for just that country data. Below is the controller for the filter page showing the dropdown values. Below that is the master page that includes the filter page, and other visualforce pages that display the charts, each with its own controller. How can I share the value of the dropdown selection wiht the controllers for the included pages?
Thanks!
public with Sharing class PracticeFilterClass{
// public List<SelectOption> Filter {get;set;}
public String SelectedFilter{get;set;}
public String SelectedRegion{get;set;}
public String SelectedCountry{get;set;}
public String SelectedStateProvince{get;set;}
public String SelectedCity{get;set;}
public String SelectedRole{get;set;}
etc...
VisualForcePage:
<apex:page >
<apex:include pageName="FilterHeaderPage"/>
<apex:include pageName="MyDashboardInfo"/>
<apex:include pageName="MyDashboardRow2"/>
</apex:page>
Nice solution. Thank you!
All Answers
Hi,
You can use merge fields to dynamically provide page reference in pageName attribute of <apex:include> tag.
Upon selecting a filter value you should update the page reference for the included pages by passing the parameter values in the url string and rerender the panel in which you have included the other pages.
Apex controller:
VF Page:
Important :
Hit Kudos if this provides you with useful information and if this is what you where looking for then please mark it as a solution for other's benefit.
Nice solution. Thank you!