VL-WEB and Complex design

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
kno_dk
Posts: 119
Joined: Tue Feb 23, 2016 12:00 am

VL-WEB and Complex design

Post by kno_dk » Wed Jan 29, 2020 11:28 pm

Hi.

I am trying to move a wam application to the new VL-WEB. In my wam I have a list of items. On each of these item entries I have a lot of fields (More than 100) some of them is not shown every time, but are depending on other fields value. On each of these entries I am also displaying 5 other lists.
In the WAM I can control much of this in the xsl.

now I want to make use of RP in the VL-web. I have tried to use a RP as tree like this: #PRIM_PANL *implements #Prim_Tree.iTreeDesign *ListFields #ListFields but there is a limit of 100 fields. And I don't know how tosend the list to this RP.

Does anybody have an idea/suggestion of how I should do this?

/klaus

dannyoorburg
Posts: 176
Joined: Mon Jan 04, 2016 9:50 am
Location: Australia

Re: VL-WEB and Complex design

Post by dannyoorburg » Thu Jan 30, 2020 9:57 am

Hi Klaus,

it's hard to imagine the need for a 100 or more fields in any list construct.

What does it currently look like in the WAM? How do you intend to make it look in VL WEB.

Maybe post some screenshots so we know what you're trying to do.

Cheers,
Danny

kno_dk
Posts: 119
Joined: Tue Feb 23, 2016 12:00 am

Re: VL-WEB and Complex design

Post by kno_dk » Fri Jan 31, 2020 12:22 am

Hi.

Here are som samples and they should look nearly the same in the new application.
There is some list where we display the data, and there is a lot of Fields controlling what icons should be visible or not. and there is Fields just as output.

/Klaus
Attachments
item3.png
item3.png (41.65 KiB) Viewed 514 times
item2.png
item2.png (38.83 KiB) Viewed 514 times
item1.png
item1.png (60.17 KiB) Viewed 514 times

kno_dk
Posts: 119
Joined: Tue Feb 23, 2016 12:00 am

Re: VL-WEB and Complex design

Post by kno_dk » Fri Feb 07, 2020 7:21 pm

anybody?

/Klaus

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

Re: VL-WEB and Complex design

Post by jyoung » Sat Feb 08, 2020 2:10 am

Hey Klaus,

You could decompose the app into multiple smaller components.
Annotation-Edit.png
Annotation-Edit.png (181.08 KiB) Viewed 424 times
I don't know if I would use a tree view in this case. Perhaps a root component with some sub components and the root gets added into a Data Table, Expanding Panel or even a PRIM_MD.List.

Regarding all the lists, do they all need to be visible at once? Can you put them in a dialog?

Unfortunately you can't send def_lists to another component, you have to send a component like a PRIM_ACOL<>. To help out with this you can use a data object as outlined in the "Passing a List of Data" section here https://docs.lansa.com/14/en/lansa017/c ... 3_0155.htm. We do this quite a bit in our VLF-ONE app where a Filter gets multiple collections (lists) from a Server Module, and then passes them to other components.

Depending on how many root components that you are showing you can asynchronously load their fields based on some given identifiers. You are going to have to do some plumbing work to hook up events and trigger the loading. This will cause a lot of hits to the Server Modules, but it may be ok in your case.

Joe

kno_dk
Posts: 119
Joined: Tue Feb 23, 2016 12:00 am

Re: VL-WEB and Complex design

Post by kno_dk » Mon Feb 10, 2020 8:16 pm

Hi Joe.

What do you mean by root Component?

And I need all the list because they decide which parts they need base on the info on these list. It could be an oil filter that is change from a production yyyymm.

Are you able to send multiple PRIM_ACOL<> to a RP? or could there be list inside a acol?

Thanks

/klaus

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

Re: VL-WEB and Complex design

Post by jyoung » Tue Feb 11, 2020 7:52 am

Hi Klaus,

By root component I mean the composition root RP. Its the RP that holds contains the other smaller RPs and perhaps coordinates them.
I did not outline that very well, but you could visualize it like your first list entry.

In that first element, you have 3 components, the green outline, the red outline and the yellow outline. The "root" is the RP that has all three of those components.

If the lists don't have to be immediately visible you could lazy load them, such as a "click to expand" feature. I don't know your domain, but lets say they search for "oil filters" and you display a list of found oil filters. They find the type of oil filter they need, and now could select a "Production Year" to get a that specific filter for a specific year. The selection of the "Production Year" would go fetch all the years that specific filter was in production. This way you don't fetch all the production year data for every oil filter, you only fetch it for the oil filter the user is interested in.

Not being familiar with your domain, its hard to come up with a rational, real-world example. ;)

Regarding the PRIM_<>, you can pass multiple PRIM_ACOLS<> to a component, just pass them by reference.
In this example, if you had a "root" component define and load these three collections, you can pass them into a "child" component

In the Root Component

Code: Select all

* declared in module/component scope
define_com class(#PRIM_ACOL<#ASCCHIPaymentType>) name(#PaymentTypes)
define_com class(#PRIM_ACOL<#ASCCHDCheckLine>) name(#Lines)
define_com class(#PRIM_ACOL<#ASCCHDCheckSummary>) name(#Summary)

* called from another event(perhaps Initialize or a button click etc.)
mthroutine name(LoadDataFromServer) 

#Get.Execute Summary(#Summary) Lines(#Lines) PaymentTypes(#PaymentTypes) Status(#wk_Status)

endroutine

evtroutine handling(#Get.Completed)

#ChildComponent.LoadData pSummary(#Summary) pLines(#Lines) pPaymentTypes(#PaymentTypes)

endroutine
In the Child Component

Code: Select all

mthroutine name(LoadData)
define_map for(*INPUT) class(#PRIM_ACOL<#ASCCHDCheckSummary>) name(#pSummary) pass(*BY_REFERENCE)
define_map for(*INPUT) class(#PRIM_ACOL<#ASCCHDCheckLine>) name(#pLines) pass(*BY_REFERENCE)
define_map for(*INPUT) class(#PRIM_ACOL<#ASCCHIPaymentType>) name(#pPaymentTypes) pass(*BY_REFERENCE)

* do something with each collection. maybe add to different lists

endroutine
Hope this helps,
Joe

kno_dk
Posts: 119
Joined: Tue Feb 23, 2016 12:00 am

Re: VL-WEB and Complex design

Post by kno_dk » Thu Feb 13, 2020 12:43 am

Hi Joe.

If I have my root component and i have defined a prim_md.list to hold my item list. How do I then add the child component(which i use to make the setup) to an entry in the prim_md. list?

Today I have used the prim_tree like this:
Define_Com Class(#PRIM_TREE<#FDKItemListItemLayout1>) Name(#Tree4) Displayposition(1) Left(0) Parent(ÆCOM_OWNER) Tabposition(3) Top(0) Height(800) Width(500) Visible(False)

and in the child i use
Begin_Com Role(*EXTENDS #PRIM_PANL *implements #Prim_Tree.iTreeDesign *ListFields #ListFields) Displayposition(1) Height(217) Left(0) Tabposition(1) Top(0) Width(865) Layoutmanager(#NormalLayout)

/Klaus

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

Re: VL-WEB and Complex design

Post by jyoung » Thu Feb 13, 2020 2:09 am

Hi Klaus,

Attached is a simple demo that I just threw together. It looks like this in the IDE
Tree with Components.png
Tree with Components.png (16.35 KiB) Viewed 360 times
The page as a PRIM_TRIM<ROOTCOMP> on it. The Root Component has 2 Child Components and the Root Component tells one of the Children to do something, in this case it increments a count.

When running it looks like this
running.png
running.png (27.53 KiB) Viewed 360 times
Its a pretty contrived example. :? But hopefully it helps some.

Joe
Attachments
QuickExport20200212090328.zip
(13.58 KiB) Downloaded 4 times

kno_dk
Posts: 119
Joined: Tue Feb 23, 2016 12:00 am

Re: VL-WEB and Complex design

Post by kno_dk » Thu Feb 13, 2020 4:43 am

Hi Joe.

Thanks for exsample. This is pretty much what I already got.

What I want is to change the treeview to a list of a kind, so I can do something like this #ChildComponent.LoadData pSummary(#Summary) pLines(#Lines) pPaymentTypes(#PaymentTypes) for each entry in the list, so i can transfer much more info to the RP root component.

I don't know if this is possible.

/Klaus

Post Reply