Page 1 of 1

VLF One - Multiple Filters with avCloseForm

Posted: Fri Feb 14, 2020 9:55 am
by dhunt
I have an issue where i have a filter but if i close it, it didn't close the axes session. i found out that if you send a signal to avCloseForm in the JS file it will close both after terminate function occurs on the Lansa side. However if i have multiple filters for a business object, is there a way to know if the the form is closed or the active filter has changed during terminate of the previous filter.

Re: Multiple Filters with avCloseForm

Posted: Fri Feb 14, 2020 1:37 pm
by MarkD
You didn't specify the context of VLF-WIN, VLF-ONE or older classic VLF-WEB.
If it's VLF-ONE, have a look at the delay option here - https://docs.lansa.com/14/en/lansa048/i ... 8_8470.htm
Introduced in EPC142057.
It might help.

Re: VLF One - Multiple Filters with avCloseForm

Posted: Sat Feb 15, 2020 3:42 am
by dhunt
First we have 3 filters, then we start an axes screen
Annotation 2020-02-14 094419.png
Annotation 2020-02-14 094419.png (28.89 KiB) Viewed 33850 times
if we go to the next filter it removes the axes form because we used code to close both the filter/instance list and axes screen on terminate of a filter using an ancestor but if we have multiple filters we want to keep all three axes screens if they are opened and hop back and forth from each axes screen and instance list as we click on each filter.
Annotation 2020-02-14 095105.png
Annotation 2020-02-14 095105.png (13.55 KiB) Viewed 33850 times
then still have the ability to still on click of the X to close close all screens and lists related to the business object.
Annotation 2020-02-14 100228.png
Annotation 2020-02-14 100228.png (16.48 KiB) Viewed 33850 times
is there a way to perhaps know the active filter on terminate? or is there a way to do the above a different way?

Re: VLF One - Multiple Filters with avCloseForm

Posted: Tue Feb 18, 2020 4:15 am
by dhunt
I did try the Delay, but it didn't seem to help what we are wanting to do.

Re: VLF One - Multiple Filters with avCloseForm

Posted: Wed Feb 19, 2020 2:24 pm
by MarkD
Where you say "I have an issue where i have a filter but if i close it, it didn't close the axes session" ..............

The filter pane/form and the command handler pane/form (containing the aXes session) would normally be in separate panes/forms I think.

If you issued avCloseForm from a filter I would expect the filter pane/form to close and leave the aXes (command handler) pane/form open.

And, vice versa - an avCloseForm from the command handler would close the command handler and aXes session.

The problem is that it's not easy to issue an avCloseForm request from a command handler that contains an aXes session.

To do that you need to use some RAMP scripting to request the container pane/form be closed.

Re: VLF One - Multiple Filters with avCloseForm

Posted: Wed Feb 19, 2020 2:26 pm
by MarkD

Re: VLF One - Multiple Filters with avCloseForm

Posted: Thu Feb 20, 2020 3:22 am
by dhunt
this is the code we use in our filter ancestor:

Code: Select all

Mthroutine Name(uTerminate) Options(*REDEFINE)

#COM_OWNER.avSignalEvent Withid(CloseSession) To(FRAMEWORK) Sendainfo1(#com_owner.avObjectType)

* Do ancestor last
#COM_ANCESTOR.uTerminate

Endroutine
And then in JS file we have

Code: Select all

	if(objBusinessObject.uUserObjectType.includes(WithAInfo1)
			&& (WithId == "CLOSESESSION"))
		{
			/* Close this command handler, since the task is now done  */
			AVCLOSEFORM();
		}

How can we do this and know if the terminate is done on the close and not a filter change? Can the delay be added to this close form?

Re: VLF One - Multiple Filters with avCloseForm

Posted: Thu Feb 20, 2020 6:47 am
by rgjohnson
Hey Mark ... Just to make sure it is clear, we have one business object with three filters. Any of the three filters populate the instance list and when the user selects from the instance list, the axes session is launched to display the command handler.

We wanted to make sure the axes session was closed automatically if the user clicked on the X to close the filter/instance list pane so added an event to the uTerminate of the filter that results in AVCLOSEFORM running to close the axes session. That works perfectly.

Our issue is that uTerminate executes for a filter even if the user is just changing from one filter to another within that same business object. We only want to close the axes session if the user is actually closing the filter/instance list pane, not when they are simply selecting a different filter. Is there a way for us to know if the user is clicking a tab to select a different filter as opposed to clicking the X to close the entire pane so that uTerminate can close the axes session in one instance but not in the other?

Re: VLF One - Multiple Filters with avCloseForm

Posted: Thu Feb 20, 2020 12:39 pm
by MarkD
Hopefully I understand now.

It's default behaviour (I think) for a filter to execute uTerminate when you change tabs to activate a different one.
i.e. The active filter gets destroyed before the new one gets initialized.

That behaviour is controlled by this property in your filter's definition - https://docs.lansa.com/14/en/lansa048/c ... lf0345.htm

So if you set all your filters in the business object to use stay active YES, then their uTerminates should only execute when they are all being closed because the main pane is being closed.

Re: VLF One - Multiple Filters with avCloseForm

Posted: Fri Feb 21, 2020 3:48 am
by rgjohnson
Thanks Mark. That was an easy solution that I should have already known!

Working fine now.