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

Rerender Page based on inputfield
I have a visualforce page that, amongst other things, contains 2 fields. One is a State field and the other is a County field. The County field contains a list of all the Counties in a "Tax Zone" custom object.
I am trying to modify the code so that the County list only contains Counties from whatever State has been typed in the State field. There is currently a getter method that runs on page load that adds items in the County list field regardless of the state.
I want to use rerender to accomplish this but I am new to development and a little out of my league here. Can someone please help???
Here is the VF page:
I am trying to modify the code so that the County list only contains Counties from whatever State has been typed in the State field. There is currently a getter method that runs on page load that adds items in the County list field regardless of the state.
I want to use rerender to accomplish this but I am new to development and a little out of my league here. Can someone please help???
Here is the VF page:
<apex:inputField type="text" html-ff="Desking:frm:county" styleClass="form-control" style="text-transform: uppercase;" id="state" value="{!dealer__Deal__c.State__c}" > <apex:actionSupport event="onchange" rerender="county" /> </apex:inputField> <apex:inputField type="text" html-ff="Desking:frm:courtesyreserve" styleClass="form-control left-text" id="county" value="{!dealer__Deal__c.dealer__County__c}" list="{!TaxZoneCountyList}" html-oninput="setTaxRate();" onchange="setTaxRate();"/>Here is the class:
public List<String> getTaxZoneCountyList () { String[] taxCounties = new String[]{}; for(dealer__Tax_Zones__c tx : [select Id, dealer__City__c, dealer__County__c, dealer__State__c from dealer__Tax_Zones__c limit 500]) { taxCounties.add(tx.dealer__County__c); } return taxCounties; }


I was able to solve the problem by modifying the code in my class as follows: