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

Onchange function is not working properly for formula field
Hi,
I am trying to create a VF page for filteration .In that i have 3 filteration. Here is my code.
At 1st it consider the operating model and quantity after clicking go button that page will list the record which met the criteria. Then i have 2 picklist for filtration one Region and another is Type. For the both filteration i gave onchange action. Region is working properly but Type onchange function is not working.
Type field is formula field which takes value from another object. Please i need someone help. I am new to salesforce.
I am trying to create a VF page for filteration .In that i have 3 filteration. Here is my code.
<apex:page standardcontroller="Opportunity" extensions="QuoteControll2" sidebar="false" > <apex:form > <apex:pageBlock > <html> <body> <table> <tr> <apex:pageBlockSection > <td><table border="0" bgcolor="#00BFFF" > <tr><apex:inputField value="{!SearchCriteria.Operating_Model__c}"/></tr> <tr><apex:inputText label="Quantity" value="{!Quantity}" style="width : 90%"/> </tr> <tr><apex:commandButton value="Go" action="{!filterApplicant}" /> </tr> </table> </td> </apex:pageBlockSection> <apex:pageBlockSection > <apex:inputField label="Region" value="{!SearchCriteria.Region__c}" rendered="{!region}"> <apex:actionsupport event="onchange" action="{!filterapp}" /> </apex:inputField> <tr><apex:inputField value="{!SearchCriteria.partno__r.type__c}" id="degreeLevel" onchange="assignDegreeLevel(this.value)" rendered="{!typef}"> <apex:actionSupport event="onchange" action="{!filterapp}"/> </apex:inputField></tr> <apex:actionFunction name="assignDegreeLevel" action="{!filterapp}" reRender="program" immediate="true"> <apex:param name="degreeSelected" assignTo="{!degreeSelected}" value=""/> </apex:actionFunction> </apex:pageBlockSection> <td style="width:100%"><apex:pageBlockTable value="{!FilteredApplicants}" var="applicant" > <apex:column > <apex:inputCheckbox value="{!selected}"/> </apex:column> <apex:column value="{!applicant.Operating_Model__c}" /> <apex:column value="{!applicant.MSRP__c}"/> <apex:column value="{!applicant.Buying_Price__c}"/> <apex:column value="{!applicant.Type__c}"/> </apex:pageBlockTable> <apex:pageMessages id="error"></apex:pageMessages> </td></tr> </table> </body> </html> </apex:pageBlock> </apex:form> </apex:page>
At 1st it consider the operating model and quantity after clicking go button that page will list the record which met the criteria. Then i have 2 picklist for filtration one Region and another is Type. For the both filteration i gave onchange action. Region is working properly but Type onchange function is not working.
Type field is formula field which takes value from another object. Please i need someone help. I am new to salesforce.
All Answers
I have seen your code and will suggest you to use a actionFunction only for Type field because as I can see in your code, you are trying to call to methods on the same event (i.e. onchange) one is action function and another is action support and both are calling the same controller method.
Try to remove one of them and it will work.
Thanks for your replay. Bellow is my code
Can you please suggest me.
Thanks for your replay. As you told I removed actionSupport tag and tried then also type field is not working. Can you please give me suggestion.
Check the javascript error by inspecting the page elements. Let me know if still there is any problem.
okay in your actionsupport and action function you are missing reRender. When an ActionSupport occurs, you need to rerender a particular item in the page.
<apex:actionsupport event="onchange" action="{!filterapp}" RERENDER="idoftheelement"/>
Also in your actionFunction you have a reRender
But I don't see any data elements with id called "program".
I gave rerender as you told and I removed program, then it is refreshing the page if I give type field. But it is not working.
Thank you for your suggestion. Now it is working properly.