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.
jyoung
Posts: 694 Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA
Post
by jyoung » Fri Apr 06, 2018 4:22 am
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
Post
by JamesDuignan » Fri Apr 06, 2018 9:06 am
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
Post
by jyoung » Fri Apr 06, 2018 11:32 pm
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
Post
by atostaine » Sat Apr 07, 2018 2:45 am
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
Post
by jyoung » Sat Apr 07, 2018 2:49 am
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.