Ancestor fields in group_by and def_list

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: 643
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Ancestor fields in group_by and def_list

Post by jyoung » Thu Feb 28, 2019 2:58 am

If I define a component that has three fields in it.

Code: Select all

begin_com role(*EXTENDS #PRIM_PANL) displayposition(1) height(270) left(0) tabposition(1) top(0) width(500) layoutmanager(#Layout1)

* ================================================================================
* LAYOUT
* ================================================================================
define_com class(#PRIM_TBLO) name(#Layout1)
define_com class(#PRIM_TBLO.Row) name(#Layout1Row1) displayposition(1) parent(#Layout1)
define_com class(#PRIM_TBLO.Column) name(#Layout1Column1) displayposition(1) parent(#Layout1)
define_com class(#PRIM_TBLO.Item) name(#Layout1Item1) alignment(TopLeft) column(#Layout1Column1) manage(#OBOFID) parent(#Layout1) row(#Layout1Row1) sizing(FitToWidth) flow(Down)
define_com class(#PRIM_TBLO.Item) name(#Layout1Item2) alignment(TopLeft) column(#Layout1Column1) manage(#OBBTC) parent(#Layout1) row(#Layout1Row1) sizing(FitToWidth) flow(Down)
define_com class(#PRIM_TBLO.Item) name(#Layout1Item3) alignment(TopLeft) column(#Layout1Column1) manage(#OBPLCN) parent(#Layout1) row(#Layout1Row1) sizing(FitToWidth) flow(Down)

* ================================================================================
* UI COMPONENTS
* ================================================================================
define_com class(#OBOFID.EditField) name(#OBOFID) displayposition(1) left(0) parent(#COM_OWNER) tabposition(1) top(0) width(500) caption('Office Number') captiontype(Caption) readonly(True) enabled(False)
define_com class(#OBBTC.EditField) name(#OBBTC) displayposition(2) left(0) parent(#COM_OWNER) tabposition(2) top(75) width(500) caption('Benefit Number') captiontype(Caption) readonly(True) enabled(False)
define_com class(#OBPLCN.EditField) name(#OBPLCN) displayposition(3) left(0) parent(#COM_OWNER) tabposition(3) top(150) width(500) caption('Plan Number') captiontype(Caption) readonly(True) enabled(False)

* other code omitted
end_com
And then use that component as the ancestor of another component, the child component has the fields defined as *ANCESTOR

Code: Select all

begin_com role(*EXTENDS #OFCBOIBenefitPanel) height(433) width(657) layoutmanager(#Layout)

* ================================================================================
* LAYOUT
* ================================================================================
define_com class(#PRIM_TBLO) name(#Layout)
define_com class(#PRIM_TBLO.Column) name(#LayoutColumn1) displayposition(1) parent(#Layout)
define_com class(#PRIM_TBLO.Column) name(#LayoutColumn2) displayposition(2) parent(#Layout)
define_com class(#PRIM_TBLO.Column) name(#LayoutColumn3) displayposition(3) parent(#Layout)
define_com class(#PRIM_TBLO.Row) name(#LayoutRow1) displayposition(1) parent(#Layout)
define_com class(#PRIM_TBLO.Item) name(#LayoutItem1) manage(#OBOFID) parent(#Layout) row(#LayoutRow1) sizing(FitToWidth) column(#LayoutColumn1) alignment(TopLeft) flow(Down)
define_com class(#PRIM_TBLO.Item) name(#LayoutItem2) manage(#OBBTC) parent(#Layout) row(#LayoutRow1) sizing(FitToWidth) column(#LayoutColumn1) alignment(TopLeft) flow(Down)
define_com class(#PRIM_TBLO.Item) name(#LayoutItem3) manage(#OBPLCN) parent(#Layout) row(#LayoutRow1) sizing(FitToWidth) column(#LayoutColumn1) alignment(TopLeft) flow(Down)
define_com class(#PRIM_TBLO.Item) name(#LayoutItem4) alignment(TopLeft) column(#LayoutColumn2) manage(#BPU1) parent(#Layout) row(#LayoutRow1) sizing(FitToWidth) flow(Down) marginleft(5)
define_com class(#PRIM_TBLO.Item) name(#LayoutItem5) alignment(TopLeft) column(#LayoutColumn2) manage(#BPU2) parent(#Layout) row(#LayoutRow1) sizing(FitToWidth) flow(Down) marginleft(5)

* ================================================================================
* UI COMPONENTS
* ================================================================================
define_com class(#BPU1.EditField) name(#BPU1) displayposition(4) left(224) parent(#COM_OWNER) tabposition(4) top(0) width(214) caption('Usage Modifer') captiontype(Caption)
define_com class(#BPU2.EditField) name(#BPU2) displayposition(5) left(224) parent(#COM_OWNER) tabposition(5) top(75) width(214) caption('Benefit Factor') captiontype(Caption)

define_com class(*ANCESTOR) name(#OBBTC) width(219)
define_com class(*ANCESTOR) name(#OBOFID) width(219)
define_com class(*ANCESTOR) name(#OBPLCN) width(219)

* other code omitted

end_com
When I try to put these fields in group_by I get an error "Expression #OBBTC does not identify a field".

This means that I cannot have those fields as part of a group_by or defined in a list with def_list. If I need to pass these fields to a Server Module, I can't do so in a group or list.

I don't understand why and hope that someone can enlighten me.

Also, how do others get around this?

Thanks,
Joe

atostaine
Posts: 396
Joined: Wed Jan 20, 2016 7:38 am

Re: Ancestor fields in group_by and def_list

Post by atostaine » Thu Feb 28, 2019 8:26 am

I thought Group_by only works with repository fields. I bet you can't put your group_by in the ancestor either.

Art
Art Tostaine

MarkD
Posts: 622
Joined: Wed Dec 02, 2015 9:56 am

Re: Ancestor fields in group_by and def_list

Post by MarkD » Thu Feb 28, 2019 8:39 am

Can you put anything defined with a Define_Com (versus a DEFINE or the dictionary) into a GROUP_BY?

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

Re: Ancestor fields in group_by and def_list

Post by jyoung » Fri Mar 01, 2019 2:15 am

In the ancestor, they are just fields so I can add them in the group by

Here is a test of the ancestor (TestBasePanel)

Code: Select all

function options(*DIRECT)
begin_com role(*EXTENDS #PRIM_PANL) DisplayPosition(1) Height(270) Left(0) TabPosition(1) Top(0) Width(500) LayoutManager(#Layout1)

define_com class(#PRIM_TBLO) name(#Layout1)
define_com class(#PRIM_TBLO.Row) name(#Layout1Row1) DisplayPosition(1) Parent(#Layout1)
define_com class(#PRIM_TBLO.Column) name(#Layout1Column1) DisplayPosition(1) Parent(#Layout1)
define_com class(#PRIM_TBLO.Item) name(#Layout1Item1) Alignment(TopLeft) Column(#Layout1Column1) Parent(#Layout1) Row(#Layout1Row1) Sizing(FitToWidth)

define_com class(#STD_STRNG.EditField) name(#STD_STRNG) DisplayPosition(1) Parent(#COM_OWNER) TabPosition(1) Width(500)


group_by name(#MYGroupBy) fields(#STD_STRNG)
end_com
Here is my TestChildPanel

Code: Select all

function options(*DIRECT)
begin_com role(*EXTENDS #TestBasePanel) LayoutManager(#Layout)

define_com class(#PRIM_TBLO) name(#Layout)
define_com class(#PRIM_TBLO.Column) name(#LayoutColumn1) DisplayPosition(1) Parent(#Layout)
define_com class(#PRIM_TBLO.Column) name(#LayoutColumn2) DisplayPosition(2) Parent(#Layout)
define_com class(#PRIM_TBLO.Row) name(#LayoutRow1) DisplayPosition(1) Parent(#Layout)
define_com class(#PRIM_TBLO.Item) name(#LayoutItem1) Alignment(TopLeft) Column(#LayoutColumn1) Manage(#STD_STRNG) Parent(#Layout) Row(#LayoutRow1) Sizing(FitToWidth)

define_com class(*ANCESTOR) name(#STD_STRNG) Width(250)

define_com class(#PRIM_ALPH) name(#MyComponent)

group_by name(#MyGroupBy) fields(#STD_STRNG)

group_by name(#MyComponentGroupBy) fields(#MyComponent)
end_com
I expect MyComponentGroupBy to fail, as I did not expect to be able to put a component in it.

However, I expected MyGroupBy to work, because it is a field, albeit defined in the base panel.
Capture.PNG
Capture.PNG (27.12 KiB) Viewed 2646 times
I noticed that the define_com class(*ANCESTOR) does not appear, until I change the layout in the child class.
If I don't change the layout and I don't have the *ANCESTOR in the child, I can have STD_STRNG in the group_by; however, I don't know if this is the child's #STD_STRNG or the ancestor's #STD_STRNG.

bark
Posts: 24
Joined: Thu Jan 05, 2017 9:56 am

Re: Ancestor fields in group_by and def_list

Post by bark » Fri Mar 01, 2019 2:43 pm

Hi Joe

The expression error in the #MyGroupBy looks wrong and looks like a defect that you should report to LANSA support.

HTH
bark

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

Re: Ancestor fields in group_by and def_list

Post by jyoung » Sat Mar 02, 2019 2:07 am

Done. I'll post their response when I hear back.

Thanks,
Joe

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

Re: Ancestor fields in group_by and def_list

Post by jyoung » Wed Mar 06, 2019 1:09 am

This is been accepted as a correction to be released in a future EPC.

Thanks,
Joe

Post Reply