You need to sign in to do that
Don't have an account?
Steve Chadbourn
ActionSupport and lookup field
I'm trying to get an actionSupport to work with a lookup field.
It works if I type the name of the new adviser in the textbox and tab out of the field but does not work if I click the search button next to the lookup field and select a new adviser that way.
How do I trigger the actionSupport when the search button is clicked?
Code:
<apex:inputField id="adviser" value="{!claimNotification.Adviser__c}"> <apex:actionSupport action="{!updateAdviserDetails}" event="onchange" immediate="false" status="stat" rerender="adviserEmail,adviserPhone,adviserFax" /> </apex:inputField>
It works if I type the name of the new adviser in the textbox and tab out of the field but does not work if I click the search button next to the lookup field and select a new adviser that way.
How do I trigger the actionSupport when the search button is clicked?
Thanks Ron. OnBlur seems a little better but still not what I want.
I'm hoping this will be fixed at some point as I consider this to be missing functionality. Hopefully as Visualforce matures things like this will get cleaned up.
It's been a while since the orignial post. I've tried using action support and action function with onblur, onchange, etc. with no luck. What is the best way to do an action on a lookup field such as whoId on task after it returns from the lookup?
Thanks.
Will it be possible for you to provide a sample code of how you did it? I have never understood action function completely; always end up facing some problem with them not working.
Thanks.
Here is some code to get you going. HoldAccount is an Account object to obtain the Selected Status picklist field. When the HoldAccount select option changes, the chgStatusSelected function executes.
<apex:form id="form1"> <apex:actionFunction action="{!chgStatusSelected}" name="chgStatusSelected" rerender="Account" /> <apex:pageBlock id="Account"> <apex:selectList value="{!holdAccount.status}" multiselect="false" size="1" onchange="chgStatusSelected();" > <apex:selectOptions value="{!statusList}" /> </apex:selectList> </apex:pageBlock> Account holdAccount; public List<SelectOption> getStatusList() { return statusOptions; } public String getStatusSelected() { return statusSelected; } public PageReference chgStatusSelected() { statusSelected = holdAccount.Status; statusChgFlag = true; return null; }
I initially implemented this by adding actionSupport to the lookup inputField with the event attribute set to "onblur". It worked... sort of. It was a bit clunky, since it seems that the blur event was firing twice. Today, I tried changing the actionSupport to use the "onchange" event. It seems like selecting a record from the search dialog is now firing the "change" event, so, perhaps Salesforce has fixed the issue originally reported here. Doug Chasman, are you able to confirm this was fixed?
Does someone has a solution ?
Thank you