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

VF Page: Field changing when a related field changes
Hi all,
Not sure if this is possible on Visualforce and how to do it.
I have an extension to a standard controller with some extra functions that will set a field (let´s call it A) to a calculated value depending on another field (let´s call that one B).
Now when B, which is a dropdown field, changes, I want A to be recalculated.
In other words, I want an Onchange event on field B (you can have these type of events) that calls a function within the Controller. The problem is that from an onchange event you can call Javascript, but I don´t know how to call an Apex function from within Javascript.
Can this be done? Thanks,
J
Hi..
Use actionsupport tag with attributes rerender or action
<apex:selectlist value="{!B}" size="1" id="B"> <apex:selectoptions value="{!B_Items}"/> <apex:actionsupport event="onchange" rerender="A"/> </apex:selectlist> <apex:inputtext value={!A}" id="A"/>
All Answers
Hi..
Use actionsupport tag with attributes rerender or action
<apex:selectlist value="{!B}" size="1" id="B"> <apex:selectoptions value="{!B_Items}"/> <apex:actionsupport event="onchange" rerender="A"/> </apex:selectlist> <apex:inputtext value={!A}" id="A"/>