Using Dynamically Created Menus

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
caseywhite
Posts: 192
Joined: Thu May 26, 2016 1:17 am

Using Dynamically Created Menus

Post by caseywhite »

I have created a push button that has a popup menu that has dynamically created menu items and also a dynamically created submenu.

There are some things I can do so as a test I set up something similar that doesn't use dynamic creation to verify it has nothing to do with building the menu system dynamically. Here are my issues.

1. I want to allow the user to click on a menu item that has a submenu and have it handle the click event instead of showing the submenu. The submenu will only appear if you hover. This doesn't appear to work. Is there a work around to this or a property I can set to make this functionality available.

2. It seems like you have to set the height of the popup menu because LANSA doesn't automatically size the popup menu to fit all the menu items. The propery MenuSizing is available but it won't let me select Popup. It just goes back to None. I tried setting the Size to Content Width and Height. The height got sized correctly, but it makes the width too small. So I supposed the answer is to just set the appropriate width and then set the size to Content Height. Any thoughts?
User avatar
Stewart Marshall
Posts: 417
Joined: Thu Nov 05, 2015 5:25 pm

Re: Using Dynamically Created Menus

Post by Stewart Marshall »

Hi Casey

1 - Once a submenu has been attached to a menuitem, the click event is used to show the submenu. As far as I'm aware, there's no way around this without manually coding the appearance of the submenu using the MouseHover event.

It does seem like a slightly odd requirement though. Typically, the first item on the submenu is used in place of the item with the submenu.

2 - MenuSizing is the property you want but it appears to be a bug in SP1. I've tried it in the latest build and it's working as expected, so it will be fixed in the upcoming EPC. For now, you'll have to set the height of the popup in code.

Regards
Stewart Marshall

Independent IT Consultant
www.marshallfloyd.com.au
caseywhite
Posts: 192
Joined: Thu May 26, 2016 1:17 am

Re: Using Dynamically Created Menus

Post by caseywhite »

Thanks Stewart.

Makes sense on #1. Go to know that #2 will work with the next EPC.
Post Reply