VLF-ONE Custom Instance List Select Columns Menu

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
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

VLF-ONE Custom Instance List Select Columns Menu

Post by jyoung »

I created a custom instance list (ancestor #VF_AC012O) because I needed to implement a custom "right click" popup menu. I got the menu working properly but I noticed that custom instance lists don't have the "Select Columns" button.

I assume I have to create one myself and I found the SelectColumnsMenu component that is part of VF_AC012O and I can add menu items to it and get events from it. But every time I click an menu, all the items disappear. Not only that but it seems like it's images cannot be found as well.

I am not finding any documentation on how to work with the SelectColumnsMenu, so any advice is appreciated.

Adding a couple items

Code: Select all

evtroutine handling(#COM_OWNER.Initialize)
#SelectColumnsMenu.AddMenuItem text("Number") eventname("NUMBER") useoptionalimagename(False) useoptionalimagesource(False)
#SelectColumnsMenu.AddMenuItem text("Client") eventname("CLIENT") useoptionalimagename(False) useoptionalimagesource(False)
endroutine
Menu Items before click. (download error is a placeholder until I get access to the "organize" image)
new menu items.PNG
new menu items.PNG (4.02 KiB) Viewed 11148 times
Menu Items after click.
after click.PNG
after click.PNG (3.62 KiB) Viewed 11148 times
Handling Click

Code: Select all

evtroutine handling(#SelectColumnsMenu.ItemSelected) eventname(#eventName) associatedreference(#reference) menuitem(#item)

#SYS_WEB.Console.Log( #eventName )
endroutine
Missing Images
missing images.PNG
missing images.PNG (18.2 KiB) Viewed 11148 times
A few questions come from this:
  1. How do I get access to the Framework Manager? Access to the avGetImageReference and avRecordTrace is all on the manager, but I cannot seem to get to it from the custom instance list.
  2. Why are the menu items disappearing and how do I stop it?
  3. How do I get the "True" and "False" images to show up like in the default list?
  4. Is there any documentation regarding the use of this component?
MarkD
Posts: 692
Joined: Wed Dec 02, 2015 9:56 am

Re: VLF-ONE Custom Instance List Select Columns Menu

Post by MarkD »

You should avoid using VLF internal parts unless they are documented.
This is because they are likely to change from version to version and your code will probably no longer function.
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: VLF-ONE Custom Instance List Select Columns Menu

Post by jyoung »

I had assumed we could use them since it was part of the ancestor we have to use when creating a custom instance list.

I ended up recreating almost all the functionally of the list just to get one "new" piece of functionality, a right click menu.

If I may make a suggestion, it would be really nice to have access to the framework manager in custom instance lists, so that we can use tracing and get access to the images.

As it is, I had to create new Bitmap images of existing VLF-ONE graphics to get the "Organize", "Cross" and "Go Tick" images and use SYS_WEB.Console.Log to get feedback from the list while developing it. It would have been much easier to use the #avFrameworkManager.avRecordTrace and avGetImageReference methods.
MarkD
Posts: 692
Joined: Wed Dec 02, 2015 9:56 am

Re: VLF-ONE Custom Instance List Select Columns Menu

Post by MarkD »

You can use #uSystem.uFrameworkManager to get a reference to it most places that #avFrameworkManager is not declared.

If you don't have #uSystem declared do this:

Define_Com Class(#VF_SY001O) Name(#Usystem) Scope(*Application)
Define_Com Class(#VF_SY001X) Name(#UsystemCommon) Scope(*Application)
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: VLF-ONE Custom Instance List Select Columns Menu

Post by jyoung »

Thanks Mark.

Come to find out uSystem is defined in the ancestor. I simply did not know it was there much less that it gave you access to the framework manager.

Is is safe to say then that when inheriting VLF components you should only use methods / components that are prefixed with a "u" i.e. "uSystem", "uInitialize" etc.?

If I may make a follow up request, is it possible to have the documentation, specifically this page http://docs.lansa.com/14/EN/lansa048/in ... 8_6090.htm updated to include notes about getting access to the framework with uSystem, not attempting to use the ancestors components, and that if you need column visibility toggling, column re-ordering and list clearing functionality (things the default instance list will give you) you will need to implement these manually.

Thanks,
Joe
MarkD
Posts: 692
Joined: Wed Dec 02, 2015 9:56 am

Re: VLF-ONE Custom Instance List Select Columns Menu

Post by MarkD »

The safest things are prefixed "av" (stand for 'application visible') - they are stable should never cause you a forward comparability issue.
Generally "u" (User) prefixed things are also okay, but we have some prefixed "u" that are not correct at the moment so we are going rename them in the next version. You should look at the F2 help for "u" things to double check usage recommendations. We are going to use the prefix 'zInt_" to indicate they are VLF internal/private and where the z prefix makes them go to the end of auto-complete prompts.

We will also update the documentation.

It's my impression, formed largely from VLF-WIN users, that people only bother to build custom snap in instance list browsers when they want q quite different instance list visualization (eg: as a calendar, or a carousel, or images). Why do you need to create one?
Eeva
Posts: 1
Joined: Thu Dec 03, 2015 3:03 am

Re: VLF-ONE Custom Instance List Select Columns Menu

Post by Eeva »

A note has been added to the topic describing how to make your own VLF-ONE instance list browser in the Visual LANSA Framework guide (http://docs.lansa.com/14/EN/lansa048/in ... 8_6090.htm).

The note says:
If you create your own instance list browser or browser panel, you may need to also produce your own version of built-in-browsers features such as column visibility toggling, column reordering, item sorting, list searching, conversion to CSV data, etc. Whether you do need to do this depends on whether that feature is relevant to the way that your instance list data is visualized. In addition, future enhancements to the built-in browsers may not be automatically available in your custom version.
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: VLF-ONE Custom Instance List Select Columns Menu

Post by jyoung »

Thanks Mark and Eeva.

The short version is that I needed to implement a "right click" menu on the list and I could not find a way to do this with the default list.

The long version, is that the users tend to copy some information from their 5250 screens that we are replacing with VLF-ONE. They kept trying to copy the Visual Ids displayed on the title of the window and could not, as they just moved the window around.

I've tried a couple different options to get them that copy functionality like a "selectable" label in the details, a "Copy" button, but nothing seemed to work well. What we really wanted was something more akin to the native browser right click "Copy" function.

That presented a couple challenges. First getting the right click menu and secondly getting access the browsers clipboard. I solved the menu problem by implementing a custom instance list and setting its "Popup" property to my "right click" menu. The clipboard was a more difficult to take down because I don't have native access to the clipboard. So I ended up creating a "hidden" widget that uses Clipboard.js to handle the clipboard interactions.

Works pretty well so far and the users seem happy with it.

Thanks for all the help.
Joe
Post Reply