VF_BasicGoogleChart widget definition

This forum allows developers to post programming tips and coding techniques that may be useful to other Visual LANSA developers. 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
MarkDale
Posts: 102
Joined: Wed Dec 02, 2015 10:06 am

VF_BasicGoogleChart widget definition

Post by MarkDale » Mon Jul 22, 2019 11:11 am

If you need a copy of the definition of widget VF_BasicGoogleChart, used in the VLF when generating VLF-ONE Graph or Chart command handlers, it is available here:
VF_BasicGoogleChart QuickExport20190722105229.zip
(21.59 KiB) Downloaded 9 times
The compiled object is already shipped in VLF epc142057 (VF_BASICG.js)

Fromm603
Posts: 17
Joined: Fri Apr 26, 2019 10:51 pm

Re: VF_BasicGoogleChart widget definition

Post by Fromm603 » Tue Jul 23, 2019 12:22 am

MarkDale,
I am new to LANSA, Is there an easy way to incorporate a Google chart as part of the command handler, and not the entire screen area? So I want more on the screen, besides the chart, I only want the chart (a bar chart with 3 bars) to fill part of the screen. I have spent an amazing amount of time to get, what I consider, a simple function to work.
Then when I click a new item from my filter, it calls the command handler differently.
This example and EPC makes it easier for sure, but as usual, somehow doesn't fit what I need.

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

Re: VF_BasicGoogleChart widget definition

Post by MarkD » Tue Jul 23, 2019 10:13 am

When you refer to the example, do you mean you generated an example using this Common Activity?
Capture1.PNG
Capture1.PNG (11.63 KiB) Viewed 106 times
or to a precompiled shipped example i.e. one of these:
Attachments
Capture2.PNG
Capture2.PNG (33.91 KiB) Viewed 106 times

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

Re: VF_BasicGoogleChart widget definition

Post by MarkD » Tue Jul 23, 2019 10:21 am

I'm going to assume a generated graph, but the broad layout manager explanation would apply to the shipped examples just as much.

Attached is a generated example that has been modified slighty by the addition of 3 colored panels and some layout commands:

Code: Select all

Define_Com Class(#Prim_Panl) Name(#Left_Panel) Parent(#COM_OWNER) Displayposition(5) Tabposition(5) Style(#BlueBackground) Height(235) Left(4) Top(61) Width(189)
Define_Com Class(#Prim_Panl) Name(#Right_Panel) Parent(#COM_OWNER) Displayposition(4) Tabposition(4) Style(#RedBackground) Height(235) Left(480) Top(61) Width(181)
Define_Com Class(#Prim_Panl) Name(#Bottom_Panel) Parent(#COM_OWNER) Displayposition(3) Tabposition(3) Style(#GreenBackground) Height(117) Left(4) Top(296) Width(657)

Define_Com Class(#PRIM_ATLI) Name(#MainAttachmentManagerItem_Left) Attachment(Left) Parent(#MainAttachmentManager) Manage(#Left_Panel)
Define_Com Class(#PRIM_ATLI) Name(#MainAttachmentManagerItem_Right) Attachment(Right) Parent(#MainAttachmentManager) Manage(#Right_Panel)
Define_Com Class(#PRIM_ATLI) Name(#MainAttachmentManagerItem_Bottom) Attachment(Bottom) Parent(#MainAttachmentManager) Manage(#Bottom_Panel)


Define_Com Class(#Prim_vs.Style) Name(#RedBackground) Normbackcolor(Red)
Define_Com Class(#Prim_vs.Style) Name(#BlueBackground) Normbackcolor(Blue)
Define_Com Class(#Prim_vs.Style) Name(#GreenBackground) Normbackcolor(Green)
The example now looks like this:
Capture.PNG
Capture.PNG (19.64 KiB) Viewed 106 times

This adds panels to the left, right and below the graph.
You would then add your additional information to the required panels(s), which might themselves also be layout managed.

example.zip
(2.2 KiB) Downloaded 3 times

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

Re: VF_BasicGoogleChart widget definition

Post by MarkD » Tue Jul 23, 2019 10:24 am

Could you elaborate on what "Then when I click a new item from my filter, it calls the command handler differently." means?

Fromm603
Posts: 17
Joined: Fri Apr 26, 2019 10:51 pm

Re: VF_BasicGoogleChart widget definition

Post by Fromm603 » Thu Jul 25, 2019 2:07 am

Mark,
As I run the handler, I have used sys.web.alerts to show me what processes are running. So when the handler is called the first time, I understand it should do uInitalize at that time (like INZSR fr us RPG folks). But then I would expect it to run the same routines as when just clicking a new item in the filter. I'm not sure how to copy and paste my screen into this replay.

I am going to load the new EPC and try adding a Google chart that way

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

Re: VF_BasicGoogleChart widget definition

Post by MarkD » Thu Jul 25, 2019 8:32 am

In your command handler it should run uInitialize and then uExecute the first time it is executed.

As you click down an instance list of business objects in your filter it should run only uExecute - because your command handler is already open and active.

If your command handler becomes inactive (for example by executing a different command handler/tab) then uTerminate should run before it becomes inactive.

There is an option to keep a command handler active.

Post Reply