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
parkerAPTparkerAPT 

Can you extend Non-User classes, like SelectOption?

I'm trying to extend the SelectOption class. Does visualforce allow this?

public abstract class ActionableSelectOption extends SelectOption {
public ActionableSelectOption(String val, String labl){
this(val, labl,false);
}
public ActionableSelectOption(String val, String lab, Boolean isDisabled){
super(val,lab,isDisabled);
}
// The method that gets called to perform whatever action is associated with this Selected Item
public abstract boolean performAction();
}

I get the following error message:
Save error: ActionableSelectOption: Non-exception class must extend another user-defined non-exception class: SelectOption

Thanks
P
dchasmandchasman
No really a VF issue - and the answer is current no Apex Code does not support this type of extension. Can you provide some more info about why you need to do this - we'll try to help identify alternate approaches.