You need to sign in to do that
Don't have an account?
Brian Kim
Dependent multi-select picklist not displaying chosen values when its page is calling from other page
Hi,
It seems that this is a known issue (https://success.salesforce.com/issues_view?id=a1p30000000T2KyAAK) but I am looking for some alternative solutions or workaround for this.
Here is the description of the issue and sample codes.
Page 2: you can save the Pick 1 and Pick 2 values in this page and it opens Pick 2 page after saving.
If the Page 2 is directly called from the web browser like https://yoursite.visual.force.com/apex/page2, it is correctly listing the chosen values as shown in below picture.
Pick_1__c: PickList (controlling)
Pick_2__c: (multi-select) PickList (Dependent)
VisualForce Page - Page1
VisualForce Page - Page2
Controller – myController
Thank you so much for your time.
Brian Kim
brian.kim@suppliersoft.com
It seems that this is a known issue (https://success.salesforce.com/issues_view?id=a1p30000000T2KyAAK) but I am looking for some alternative solutions or workaround for this.
Here is the description of the issue and sample codes.
- Custom Fields in Account Object
- VisualForce Page
Page 2: you can save the Pick 1 and Pick 2 values in this page and it opens Pick 2 page after saving.
- Issue Description
If the Page 2 is directly called from the web browser like https://yoursite.visual.force.com/apex/page2, it is correctly listing the chosen values as shown in below picture.
- Sample Source
Pick_1__c: PickList (controlling)
Pick_2__c: (multi-select) PickList (Dependent)
VisualForce Page - Page1
<apex:page controller="myController" cache="false"> <apex:form > <apex:pageBlock > <apex:pageBlockButtons > <apex:commandButton value="Go To Page2" action="{!gotoPage2}"/> </apex:pageBlockButtons> </apex:pageBlock> </apex:form> </apex:page>
VisualForce Page - Page2
<apex:page controller="myController" cache="false"> <apex:form > <apex:pageBlock title="Select Pick List" mode="edit" id="thePageBlock"> <apex:pageBlockButtons > <apex:commandButton value="Save" action="{!save}"/> </apex:pageBlockButtons> <apex:pageBlockSection columns="1" id="multiselectsection"> <apex:inputField value="{!Acc.Pick_1__c}" required="true" id="pick1"/> <apex:inputField value="{!Acc.Pick_2__c}" required="true" id="pick2"/> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>
Controller – myController
public class myController { public Account Acc {get;set;} public myController() { String ssid = '\'001f4000004zngp\''; String q = 'select Pick_1__c, Pick_2__c from Account where id = ' + ssid; Acc = Database.query(q); } public pageReference save() { Update Acc; return page.Page1; } public pageReference gotoPage2() { return page.Page2; } }
Thank you so much for your time.
Brian Kim
brian.kim@suppliersoft.com
Sorry for this issue you are encountering.
I tried the same in my test ORG with two dependent picklists with the dependent one being multi select and am able to get the selected values under the chosen section of the picklist when I go to edit it.
Please refer the below screenshot for your reference:
Thanks,
Nagendra
Thank you for your reply.
I think I haven't mentioned some conditions of the example.
Even in my example, if the conroller is refreshed by redirecting to the page 2 it shows the chosen values in the dependent pick-list.
Here is additional conditions:
- The two pages have to associated with the same controller (myController in my example)
- And the Page 2 in my example should be called without redirecting to it. In other words, we should not refresh the controller since we need to keep the view states.
- ddd
Please let me know if you have any questions or have any progress.Thank you so much.
Brian Kim