function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
astroastro 

Setter not getting invoked from selectList action

Hey guys,  Here is my scenario:

 

I have 3 page sections - top, bottom and middle

 

The top is a dropdown list

the middle is a pageblocktable with each row having 2 dropdowns in it

the bottom is just a list which requires no interaction

 

The dropdown in the top section is the same dropdown which is displayed with each row in the middle section.

 

I want it so that when the top dropdown has been changed the corresponding dropdown in the middle section's all get selected with the same values.

 

in my top dropdown controller code, I have the VALUE={} portion referencing a setter method which sets all the corresponding row elements in the middle sections rows to the same value.  But this method seems to NEVER get called.

 

Please tell me what I am doing wrong.

 

Thank's to all who contribute

 

Here is the vf code conercining the TOP dropdown list section

 

and the corresponding code that should be triggers when the value is changed

 

<apex:pageBlockSection title="Bureau Selection" collapsible="false" columns="1" id="bureau"> <apex:form > <apex:selectList size="1" onchange="genericPostbackFunction()" value="{!the_bureau}" style="position: relative; top: 50%; left: 50%;"> <apex:actionSupport event="onchange" reRender="nomination" /> <apex:selectOptions value="{!Speaker_Bureau_Options}"/> </apex:selectList> </apex:form> </apex:pageBlockSection>

 

public Speaker_Bureau_gne__c the_bureau {get; set{ system.debug('setter:'+the_bureau); for(memberContainer mC : membersMap.values()){ mC.Speaker_Bureau_ID_gne = the_bureau.id; system.debug('MC:'+mc); } } }

 


 

sforce2009sforce2009

When you are using actionsupport no need to put the onchange attribute in selectlist. remove it and call the function in

action of the actionsupport

 

<apex:selectList size="1" value="{!the_bureau}" style="position: relative; top: 50%; left: 50%;">	        			
<apex:actionSupport event="onchange" reRender="nomination" action="{!actionFunction}"}/>
XactiumBenXactiumBen

If you override a setter method (like what you are doing with set {} ) then you need to actually put the value into the variable.

 

Calling set {} is pretty much like creating a function called setMyVariable(String value) {  } so all you need to do is add:

 

 

public Speaker_Bureau_gne__c the_bureau

{

get;

set

{

the_bureau = value;

system.debug('setter:'+the_bureau);

for(memberContainer mC : membersMap.values())

{

mC.Speaker_Bureau_ID_gne = the_bureau.id;

system.debug('MC:'+mc);

}

}

}

 

 

 

Message Edited by XactiumBen on 07-28-2009 05:31 PM