+ Start a Discussion

Parameter - passing current value of field for actionSupport


 I'm trying to pass the current value of the inputfield id TechCenter to my apex controller, but my code below passes in null (which i assume because the field hasn't been assigned yet. I want to pass the value in this field, not the previous value to my apex class. This is an actionsupport rerender on a panel, so it's a partial page update.


<apex:pageblockSectionItem >
<apex:outputLabel value="Tech Center" for="TechCenter"></apex:outputLabel>
<apex:actionRegion >
<apex:inputField id="TechCenter" value="{!bc.Technical_Center__c}" required="true">
<apex:actionSupport event="onchange" rerender="AddressPanel" status="status1">
<apex:param id="tc" value="{!bc.Technical_Center__c}"/>





You shouldn't need to use params if you are binding directly to an inputField. This should work fine:



<apex:inputField id="TechCenter" value="{!bc.Technical_Center__c}" required="true">
<apex:actionSupport event="onchange" rerender="AddressPanel" status="status1"/>




Message Edited by TehNrd on 07-23-2009 01:47 PM

The inputfield "TechCenter" is not part of the re-render outputPanel.

I tried using a parameter because passing !bc.Technical_Center__c through the parameter gives a null value, or the value initially stored in the controller, not the one that just raised this onchange event.


hope this makes sense.


What happens if you add this:



<apex:actionSupport event="onchange" action="{!doSomething}" rerender="AddressPanel" status="status1"/> public void doSomething(){}

This should make all of the set methods execute and then the rerender will perform.



Hi iam also having a similar issue iam facing difficulty in passing the lookupfield value to controller actually i have a lookupfield value in my vpge i wantto pass this input field value     to the controller for filtering the query result ....

so plz tell me how could i do this witha  example ....