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

Populate LOOKUP field based on picklist/<apex:selectionlist>: Pls help
I have a scenario where, I want to populate LOOKUP field based on <apex:selectionlist>
Example:
<apex:outputLabel for="attribute-search-status" value="Categories"/>
<apex:outputPanel styleClass="requiredInput" layout="block" >
<apex:outputPanel styleClass="requiredBlock" layout="block"/>
<apex:selectList id="theform" value="{!selectedCategory}" size="1" required="true" style="width:180px" >
<apex:selectOptions value="{!Categories}" />
<!--<apex:actionSupport event="onchange" action="{!createServiceAgreement}" reRender="pg"/>-->
<!--<apex:actionFunction name="createServiceAgreement" action="{!createServiceAgreement}" reRender="panel"/>
<apex:actionSupport event="onchange"/>-->
</apex:selectList>
</apex:outputPanel>
And my lookup field is :
<apex:inputField id="panel" value="{!ReqUser.ServiceAgreement__c}" required="true"/>
I tried couple of solutions using:
<apex:actionFunction name="createServiceAgreement" action="{!createServiceAgreement}" reRender="panel"/>
and there is no solution.
1..Is that really possible to populate LOOKUP field based on selectionlist using <APEX:ACTIONFUNCTION>???
or 2.Have to only Trigger in such scenario??
Pls help.
Example:
<apex:outputLabel for="attribute-search-status" value="Categories"/>
<apex:outputPanel styleClass="requiredInput" layout="block" >
<apex:outputPanel styleClass="requiredBlock" layout="block"/>
<apex:selectList id="theform" value="{!selectedCategory}" size="1" required="true" style="width:180px" >
<apex:selectOptions value="{!Categories}" />
<!--<apex:actionSupport event="onchange" action="{!createServiceAgreement}" reRender="pg"/>-->
<!--<apex:actionFunction name="createServiceAgreement" action="{!createServiceAgreement}" reRender="panel"/>
<apex:actionSupport event="onchange"/>-->
</apex:selectList>
</apex:outputPanel>
And my lookup field is :
<apex:inputField id="panel" value="{!ReqUser.ServiceAgreement__c}" required="true"/>
I tried couple of solutions using:
<apex:actionFunction name="createServiceAgreement" action="{!createServiceAgreement}" reRender="panel"/>
and there is no solution.
1..Is that really possible to populate LOOKUP field based on selectionlist using <APEX:ACTIONFUNCTION>???
or 2.Have to only Trigger in such scenario??
Pls help.
like
and now try to rerender panel using action function.