VLF One - Multiple Filters with avCloseForm

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
dhunt
Posts: 39
Joined: Fri Feb 08, 2019 3:06 am

VLF One - Multiple Filters with avCloseForm

Post by dhunt » Fri Feb 14, 2020 9:55 am

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.
Last edited by dhunt on Tue Feb 18, 2020 4:15 am, edited 1 time in total.

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

Re: Multiple Filters with avCloseForm

Post by MarkD » Fri Feb 14, 2020 1:37 pm

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.

dhunt
Posts: 39
Joined: Fri Feb 08, 2019 3:06 am

Re: VLF One - Multiple Filters with avCloseForm

Post by dhunt » Sat Feb 15, 2020 3:42 am

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 372 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 372 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 372 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?

dhunt
Posts: 39
Joined: Fri Feb 08, 2019 3:06 am

Re: VLF One - Multiple Filters with avCloseForm

Post by dhunt » Tue Feb 18, 2020 4:15 am

I did try the Delay, but it didn't seem to help what we are wanting to do.

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

Re: VLF One - Multiple Filters with avCloseForm

Post by MarkD » Wed Feb 19, 2020 2:24 pm

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.

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

Re: VLF One - Multiple Filters with avCloseForm

Post by MarkD » Wed Feb 19, 2020 2:26 pm


dhunt
Posts: 39
Joined: Fri Feb 08, 2019 3:06 am

Re: VLF One - Multiple Filters with avCloseForm

Post by dhunt » Thu Feb 20, 2020 3:22 am

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?

rgjohnson
Posts: 6
Joined: Thu May 26, 2016 12:42 am

Re: VLF One - Multiple Filters with avCloseForm

Post by rgjohnson » Thu Feb 20, 2020 6:47 am

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?

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

Re: VLF One - Multiple Filters with avCloseForm

Post by MarkD » Thu Feb 20, 2020 12:39 pm

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.

rgjohnson
Posts: 6
Joined: Thu May 26, 2016 12:42 am

Re: VLF One - Multiple Filters with avCloseForm

Post by rgjohnson » Fri Feb 21, 2020 3:48 am

Thanks Mark. That was an easy solution that I should have already known!

Working fine now.

Post Reply