Component Defined with class(*ANCESTOR)

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Component Defined with class(*ANCESTOR)

Post by jyoung »

While trying to figure out what I am going to do with my instance list issues, I extended VF_UM044O and the IDE dropped this into the code.

Code: Select all

function options(*DIRECT)
begin_com role(*EXTENDS #VF_UM044O) height(270) width(500)
define_com class(*ANCESTOR) name(#Pagination_Control) width(500)
define_com class(*ANCESTOR) name(#SinglePageList) height(220) width(500)

end_com
I have never seen a component defined with a class(*ANCESTOR). Can't find any documentation on this.

What is this? How does it work?

It looks like I can get access the underlying component VF_UI038O, but I can't see how that component is defined to see how this works.

Thanks,
Joe
JamesDuignan
Posts: 85
Joined: Thu Nov 26, 2015 1:43 pm

Re: Component Defined with class(*ANCESTOR)

Post by JamesDuignan »

Hi Joe,

"define_com class(*ANCESTOR)" is a component defined in the ancestor of the form, reusable part etc.

Usually you do not see the define_com for these, unless there is a change to the original definition, such as height, width, visibility etc.

For example:

Code: Select all


Begin_Com Role(*EXTENDS #PRIM_WEB) Theme(#SYS_THEME<MaterialDesignBlue>)

Define_Com Class(#PRIM_PHBN) Name(#Button1) Caption('Button1') Displayposition(1) Left(112) Parent(#COM_OWNER) Tabposition(1) Top(88) Height(48) Width(560)

End_Com

Code: Select all

Begin_Com Role(*EXTENDS #jdwebbase)

Define_Com Class(*ANCESTOR) Name(#Button1) Left(320) Width(352)

End_Com

regards,

James
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: Component Defined with class(*ANCESTOR)

Post by jyoung »

Interesting.

This seems to be a way to get a reference to a component in the ancestor without having to create a property for it? Kinda of like declaring a protected field in a C# or Java class?

I assume it is matched based on the Name?

Thanks,
Joe
atostaine
Posts: 696
Joined: Wed Jan 20, 2016 7:38 am

Re: Component Defined with class(*ANCESTOR)

Post by atostaine »

You could also create your own component that has that ancestor, add things, and then in this component use your new ancestor.

We did this extensively in VLF-win with command handlers. We added corporate logos, security routines whatever.

Can’t believe you haven’t seen that yet considering all the stuff your doing!
Art Tostaine
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: Component Defined with class(*ANCESTOR)

Post by jyoung »

Haha, nope never saw anything like it.

Anytime I had to do something like that I created properties or methods to get access to the ancestor components.

Good to know. :D
MarkD
Posts: 692
Joined: Wed Dec 02, 2015 9:56 am

Re: Component Defined with class(*ANCESTOR)

Post by MarkD »

The VLF objects designed to be extended by custom code are prefixed VF_AC (where AC = Ancestor class).
e.g. VF_AC007O (filter container) and VF_AC010O (Command handler).

There’s a VLF-ONE summary here https://docs.lansa.com/14/en/lansa048/i ... 8_6045.htm

and a VLF-WIN summary here https://docs.lansa.com/14/en/lansa048/i ... 8_6050.htm

The extending of VF_ prefixed objects that are not prefixed VF_AC (such as VF_UM044O) may mean your changes would not work in future versions.
Post Reply