+ Start a Discussion
Rahul GoyalRahul Goyal 


I have a VF page with 2 picklist (ClaimType,SubClaimType), both the picklists have some values.
I have a another page which will have 1 picklist whose values will be dependent on the subclaimtype of the 1st page.
When user select a subClaimType and click on continue, it will move to another page and the respective values for the page2 for the picklist values will be displayed which is dependent on the subclaimType values .
For eg:
id SubClaimType is StaffExpenses then on page2 pickList it will display "Car expenses" or "Call Expense"
ANy idea on this will be helpful

Hi Rahul, 


pass the "subClaimType" value through url parameter to the second page and recieve it in the second page's controller and form the picklist accordimgly.

Rahul GoyalRahul Goyal

Hi Harsha,


Can you just please tel me through code how i can do ot I am just to apex and SF

Jake GmerekJake Gmerek

So in the code behind the continue button add  '?subClaim=' + SubClaimType to the end of the URL that it is calling (ie the second page)


Then in the controller for the second page:


subClaim = ApexPages.currentPage().getParameters().get(‘subClaim’);


Then use subClaim to set up your picklist on that page.


Hi rahul, 
 you might be using pagereference for redirecting from page1 to page2, there you add the Param to the existing pagereference as jake said