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

Refresh for Dependent Picklist does happen more than once whenever any value is changed
Hi,
I have two picklist REGION and TERRITORY and the TERRITORY picklist values are dependent on REGION. I have used the following link to make my depending picklist http://wiki.apexdevnet.com/index.php/Extended_Functionality_of_Visualforce_-_Part_2 but the refresh happens only once. The second time I change my REGION value the TERRITORY does not get refreshed.
Here is the piece of code
Can anyone please help me ?
Thanks
Jina
I have two picklist REGION and TERRITORY and the TERRITORY picklist values are dependent on REGION. I have used the following link to make my depending picklist http://wiki.apexdevnet.com/index.php/Extended_Functionality_of_Visualforce_-_Part_2 but the refresh happens only once. The second time I change my REGION value the TERRITORY does not get refreshed.
Here is the piece of code
Code:
<apex:pageBlock title="Section 2" rendered="{!showSecondSection}"> <p>To what geography does this rate apply— </p> Region: <span style="padding:10px;"/> <apex:actionFunction action="{!refreshPage}" name="refreshPage"/> <apex:selectList value="{!contractTerms.REGION__c}" id="region" size="1"> <apex:selectOptions value="{!regionList}"/> <apex:actionSupport event="onchange" rerender="territory"/> </apex:selectList> <p> Territory: <span style="padding:10px;"/> <apex:selectList value="{!contractTerms.TERRITORY__c}" multiselect="true" id="territory" disabled="{!ISNULL(contractTerms.REGION__c)}"> <apex:selectOptions value="{!territories}"/> </apex:selectList><p/> <!-- <apex:inputField id="territory" value="{!contractTerms.TERRITORY__c}"/> --></p> <p><span style="padding:10px;"/><apex:commandButton action="{!showSection3}" value="Continue" styleClass="btn"></apex:commandButton></p><br/> </apex:pageBlock> Controller public List<SelectOption> getTerritories() { REGION__c region = null; List<REGION_TERRITORY__c> territoryList = new List<REGION_TERRITORY__c>(); List<SelectOption> options = new List<SelectOption>(); options.add(new SelectOption('','--None--')); if(contract_terms.REGION__c != null) { region = [select id, Name from REGION__c where Id =:contract_terms.REGION__c]; territoryList = [select id, Name from REGION_TERRITORY__c where Region__c=:region.Id]; } for(REGION_TERRITORY__c territory: territoryList ) { options.add(new SelectOption(territory.Id,territory.Name)); } return options ; } public List<SelectOption> getRegionList() { List<SelectOption> options = new List<SelectOption>(); options.add(new SelectOption('','--None--')); List<REGION__c> regionList = [select id, Name from REGION__c]; for( REGION__c region:regionList) { options.add(new SelectOption(region.Id,region.Name)); } return options; }
Can anyone please help me ?
Thanks
Jina
Jina,
I'm having the same thing happen to me (just started this morning). Are you on the na2 server, and were the refreshes working previously? I cannot make any changes to a page after the initial save. I save the changes, but nothing happens.
I have logged a bug for this and we will hopefully get it fixed very soon. Sorry for any inconvenience.
Jill
Jina
Mark Fox
I tested the code with the lastest release, the multi-selection works fine but there is still some issues with respect to mapping of the fields to any input field or simple String data type. I get a conversion error. I get this error where TERRITORY__c is a multiselet picklist field
Conversion Error setting value 'New Zealand Singapore' for '#{contractTerms.TERRITORY__c}'.