You need to sign in to do that
Don't have an account?
Meer Salman
Calling function behind events
Hi..
Is it possible to call a function of extensions behind the event in a VisualForce Page?
I have the following page I want to put the getDescription() method on 'onselect' event of
<apex:inputfield value="{!newLine.Code_Combination__c}" />
How can I achieve this??
<apex:page standardController="Fin_Journal__c" extensions="Fin_LineManager">
<apex:form >
<apex:pageBlock id="pb" mode="Edit">
<apex:pageBlockButtons >
<apex:commandButton value="Click" action="{!getDescription}" rerender="pb"/>
</apex:pageBlockButtons>
<apex:PageBlockSection columns="1">
<apex:inputfield value="{!newLine.Code_Combination__c}" />
<apex:inputfield value="{!newLine.Description__c}"/>
</apex:PageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
Please help in this.
Regards,
Meer Salman
There's a couple of ways you can do this:
1. Input fields support the onselect event, so you can wrap your method in an actionfunction and invoke it. I'd avoid using 'get' as the prefix for action methods, as VF views those as property getters. Assuming its named showDescription:
2. Use an apex:actionsupport, this invokes the method directly from the component:
All Answers
There's a couple of ways you can do this:
1. Input fields support the onselect event, so you can wrap your method in an actionfunction and invoke it. I'd avoid using 'get' as the prefix for action methods, as VF views those as property getters. Assuming its named showDescription:
2. Use an apex:actionsupport, this invokes the method directly from the component:
was just waiting for your reply :)
Thanks a lot.
Regards,
Meer Salman