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

Diable Select List
I am trying to disable a select List when the user checks a checkbox. I am running into the following problems.
a. The select option tag doesnt populate the options from the referenced field
b. The Select List box doesnt get disabled when i check the checkbox
Code:
<apex:inputfield value="{!case.Region__c}"> <apex:actionSupport event="onchange" action="{!regionSectionAction}" reRender="NewEmployeeRequest1"/></apex:inputField> <b>Region</b> <apex:selectList value="{!case.Regional_Location__c}" disabled="{!!noRegionSection}" > <apex:selectOption value="{!case.Regional_Location__c}" itemLabel="{!case.Regional_Location__c}" /> </apex:selectList>
The same functionality works when i tried to disable a text box rather than a select List
Code:
<apex:inputfield value="{!case.Region__c}"> <apex:actionSupport event="onchange" action="{!regionSectionAction}" reRender="NewEmployeeRequest1"/></apex:inputField> <b>Region</b> <apex:inputtext value="{!case.Regional_Location__c}" disabled="{!!noRegionSection}" > </apex:inputtext>
Thanks,
Checkboxes don't have an onchange event.
Hi,
I did that and the validation now seems to be working. But my options for the select list arent getting pulled from the custom object. The Select List is empty.
Thanks,
I must admit I don't use Select Lists too often, but according to the docs your 'case.Regional_Location__c' should be an array (List) of SelectOption classes, made up like this:
public List<SelectOption> getItems
{
List<SelectOption> options = new List<selectOption>();
options.add(new SelectOption('US', 'US');
options.add(new SelectOption('CANADA', 'Canada');
return options;
}
The first argument is the option's value and the second parameter is the option's display text, so I think you'll have to loop through your locations building up a SelectOption list.
Sorry I can't be of more help.