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
Preetham 345 SFDCPreetham 345 SFDC 

Handling a the page Navigation with javascript in visual force

Hi All ,
Say the are two picklists A and B and two visual force pages 1 and 2 . Page 1 consists of Next button and page two consists of Back button 
I was trying to enable a picklist B on page1  when i click on back command button on  page2 using javascript. But the picklistB in which i am trying to enable is enabled or  disabled based on the other picklistA values in the page 1 itself. So when i was trying to move forward from page 1 to 2 i am able to succeed , but when i am trying to move backward the picklist B value is getting locked (disabled) which should not happen .
Could any one  possibly help me with how to handle with your valuable suggestions .  

Preetham SFDC 

Roy LuoRoy Luo
When you navigate to page 1 or 2 using javascript, you could build up the url to include all the info you need in the controller. The controller would do all the work to fill in the data, which would drive the UI.

You might format the url like these:

Then in Page1 controller, you get picklist values for picklistA and picklistB and bind them to Page1 apex controls.
picklist1Value = ApexPages.currentPage().getParameters().get('paValue');
picklist2Value = ApexPages.currentPage().getParameters().get('pbValue');

Hope this helps.