%GetComponentByID Compile Error

Primary tabs

Caché, HealthShare

Hello, 

I have a class I'm working on that is extending a base class that contains the %GetComponentByID method and a section of the new code I'm writing uses %GetComponentByID but when I attempt to compile the class I'm getting an error that says the method doesn't exist. 

Am I missing something to be able to include the GetComponent method in an extended class? 

Replies

Do you want to call %GetComponentByID  of a parent class?

You can do it like this:

set result = ##super(args...)

Documentation.

You see, when I try to call it with ##super I get "method does not exist in any super class" 

The line that's giving me trouble is: 

Set tCombobox=..%GetComponentById(pComboName)

I'm basically trying to pass a class parameter into the GetComponent so it can be used in a variable. 

The parent class uses the GetComponentById without an issue so I can't figure out why I'm getting the "not present in class" error. 

%GetComponentById and GetComponentById are different methods.

Yes, that was a typo on my part. %GetComponentById is being used in the parent class. 

Share a code sample please?

One other thing: both methods should be either methods or classmethods.

Set tCombobox=..%GetComponentById(pComboName)
Set tCombobox.valueList=%session.Data("Codes")
Set tCombobox.displayList=%session.Data("Display")

This is part of an instance method. 

The exact error is: Method or Property '%GetComponentById' does not exist in this class. 

What happens if you use %page.%GetComponentById?