Page 1 of 1

VLF-ONE (web) V15 and default tab

Posted: Thu Nov 24, 2022 12:05 am
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

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

Posted: Thu Nov 24, 2022 9:28 am
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

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

Posted: Thu Nov 24, 2022 10:01 pm
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

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

Posted: Fri Nov 25, 2022 12:52 am
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 12294 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 12294 times
you will find it and can change it:
commanddefinition3.png
commanddefinition3.png (77.98 KiB) Viewed 12294 times

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

Posted: Fri Nov 25, 2022 12:59 am
by Dino
and the object name is here:
objectname1.png
objectname1.png (81.28 KiB) Viewed 12291 times
objectname2.png
objectname2.png (44.31 KiB) Viewed 12291 times

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

Posted: Fri Nov 25, 2022 7:26 pm
by kno_dk
Hi Dino.

It worked - thanks

/klaus