VLF-ONE (web) V15 and default tab

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

VLF-ONE (web) V15 and default tab

Post by kno_dk »

Hi.

I have a filter where I have 8 commands tabs attached. I would like to have one of the tabs to be the one show when I select an entry in the filter list. I have marked the tab as the default tab and that works the first time I open the filter and select one of the entries. But If I have navigated to one of the other tabs and then select anoteher entry in the filter list the active tab is the one from the previus entry.

Is it possible to force one of the tabs to be the activ one when a list entry is selected?

/klaus
User avatar
Dino
Posts: 477
Joined: Fri Jul 19, 2019 7:49 am
Location: Robbinsville, NC
Contact:

Re: VLF-ONE (web) V15 and default tab

Post by Dino »

Hi Klaus

What you describe is the expected result in VLF, if you select another entry in the instance list, it will remain in the same command handler tab and just switch the value to the new entry selected... even if you close the tabs and select another entry, it will show first the last tab used.

Even if you create a custom handler, you will have a routine like this in it:

Code: Select all

Evtroutine Handling(#VisualizedInstanceList.ItemGotFocus)

Define_Com Class(#vf_lm003O) Name(#DataItem) Reference(*DYNAMIC)
If (#COM_OWNER.UIisLocked.Not)
#DataItem <= #VisualizedInstanceList.CurrentItem.RelatedReference *As #VF_LM003O
* Make this the current item
#DataItem.avIsCurrent := True
* Execute any default command
#DataItem.avExecuteDefaultCommand
Endif
Endroutine
and you can see that the line #DataItem.avExecuteDefaultCommand is the one that transfer the control, but still follows the same procedure as the original instance handler. If you want to change that way you will need to request an enhancement.

Saying so, while not a perfect solution, but an easy one, is that in each of those tabs that are not the default one, you add a code like this in your uExecute (my tabs are called ONE, TWO, THREE, etc. being ONE the default one and my example was created over PSLMST so my akey was EMPNO):

Code: Select all

Mthroutine Name(uExecute) Options(*REDEFINE)
#COM_ANCESTOR.uExecute GotoFreeState(#GotoFreeState) SwitchCallerReference(#SwitchCallerReference)
#EMPNO := #Com_Self.avAssociatedInstance.avAKey1

* * * * * START OF THE CODE
Invoke Method(#AVFRAMEWORKMANAGER.avRestoreValue) WithID1("EMPLOYEE") ToAValue(#STD_STRNG)
If (#STD_STRNG *NE #EMPNO)
* this is a different instance value, lets switch to default
Invoke Method(#AvFrameworkManager.avSaveValue) WithID1("EMPLOYEE") FromAValue(#EMPNO)
#avFrameworkManager.avSwitch Caller(#COM_OWNER) ToObjectNamed("OBJECTONE") Execute("ONE")
Endif
* * * * * END OF THE CODE * * * * *
Endroutine
This code is basically saying that if the key is different to what it was before, so if you change instance entries,
it will switch to the tab called ONE which is my default tab. It works fine. Just tested
kno_dk
Posts: 221
Joined: Tue Feb 23, 2016 12:00 am

Re: VLF-ONE (web) V15 and default tab

Post by kno_dk »

hi Dino.

I have add this code to ofmy handler: #avFrameworkManager.avSwitch Caller(#COM_OWNER) Execute("Forside") ToObjectNamed("OBJECTFORSIDE")

And the settings on the tab "Forside"

But it gives me the error that OBJECTFORSIDE in not.......

/Klaus
Attachments
forside.PNG
forside.PNG (41.5 KiB) Viewed 12297 times
ObjectForside.PNG
ObjectForside.PNG (5.16 KiB) Viewed 12297 times
User avatar
Dino
Posts: 477
Joined: Fri Jul 19, 2019 7:49 am
Location: Robbinsville, NC
Contact:

Re: VLF-ONE (web) V15 and default tab

Post by Dino »

The one you are pointing will be the tab identification i think.

You want to use the Object name, assigned to the Command Definition, which most likely is FORSIDE in your case. (ONE in mine)

Where you find that? Well, from the commands allowed, you can see the commands and their Singular Name. the actual name assigned to the object is what I highlighted in yellow, not the one in blue:
commanddefinition1.png
commanddefinition1.png (84.47 KiB) Viewed 12292 times
And the ID was assigned when you created the command, so if you click COMMAND DEFINITIONS button at the bottom right of the screen:
commanddefinition2.png
commanddefinition2.png (102.72 KiB) Viewed 12292 times
you will find it and can change it:
commanddefinition3.png
commanddefinition3.png (77.98 KiB) Viewed 12292 times
User avatar
Dino
Posts: 477
Joined: Fri Jul 19, 2019 7:49 am
Location: Robbinsville, NC
Contact:

Re: VLF-ONE (web) V15 and default tab

Post by Dino »

and the object name is here:
objectname1.png
objectname1.png (81.28 KiB) Viewed 12289 times
objectname2.png
objectname2.png (44.31 KiB) Viewed 12289 times
kno_dk
Posts: 221
Joined: Tue Feb 23, 2016 12:00 am

Re: VLF-ONE (web) V15 and default tab

Post by kno_dk »

Hi Dino.

It worked - thanks

/klaus
Post Reply