You need to sign in to do that
Don't have an account?
kevindotcar
Urgent Problem with SelectLists in a controller extension
Hi all,
I have a page that has an extension class, and whenever I try to update a variable in the extension from a SelectList, it just doesn't happen.
Page snippet:
<apex:page standardController="Opportunity" extensions="SelfEnrollController" action="{!getParameters}" id="SelfEnrollPage"> <apex:form id="SelfEnrollForm"> ... <b>Primary Category:</b> <apex:SelectList id="Positions" value="{!strPrimryCatId}" size="1" multiselect="false"> <apex:selectOptions value="{!CategoryItems}"/> </apex:SelectList> <br/> ...
Controller snippet:
public class SelfEnrollController {
Public String strPrimryCatId{get;set;}
public void getParameters() {
...
Public List<SelectOption> getCategoryItems() {
List<SelectOption> options = new List<SelectOption>();
for(jsonPrimaryCategories c :cloneCategory) {
System.debug('c.Id: ' + c.Id + ', c.Value: ' + c.Value);
options.add(new SelectOption (c.Id,c.Value));
}
return options;
}
}
Do I have to do anything different becayse the selectlist is updating a value in an extension?
Help?
Hi Khaiwong
Just to follow-up.... I got my problem fixed, but it still seems strange.
I build my selection list much like I stated in my original post:
But I added the "onChange" javascript, which is as follows;
,...Where the "{!updateMOP}" doesn't do much at all, and there is no "zzz" ID to rerender -
For the life of me, I don't know what's going on....
I was just hoping that posting the solution might help explain what the problem I'm having is...
All Answers
Hi,
Looks OK to me.
What's in your getParameters() method?
-Hengky-
Hi Khaiwong,
Really, just a bunch of initialization stuff I pull out of the opportunity id that's pased to the page:
Really nothing related... but it's necessary for the progtam to run..... but it doesn;t touch the "strPrimryCatId " variable....
Hi Khaiwong
Just to follow-up.... I got my problem fixed, but it still seems strange.
I build my selection list much like I stated in my original post:
But I added the "onChange" javascript, which is as follows;
,...Where the "{!updateMOP}" doesn't do much at all, and there is no "zzz" ID to rerender -
For the life of me, I don't know what's going on....
I was just hoping that posting the solution might help explain what the problem I'm having is...