"Modal" popups

This forum allows developers to post programming tips and coding techniques that may be useful to other Visual LANSA developers. 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
User avatar
Stewart Marshall
Posts: 417
Joined: Thu Nov 05, 2015 5:25 pm

"Modal" popups

Post by Stewart Marshall » Thu Sep 08, 2016 5:38 pm

Unlike forms, which can be modal, Popups (#Prim_PPNL) are really just panels and have no modal capabilities. This can present developers with a couple of issues when trying to build applications with dialogs.

The first is that the page "behind" the popup is accessible.
The second is that it's much harder to loop though a set of items.

The attached export shows how both of these problems are easily solved in RDMLX.
Popup.png
Popup.png (125.98 KiB) Viewed 3412 times
DoubleClicking on a list item shows a details popup. This has been defined as AutoClose(False) which prevents the popup closing whenever there's a click outside the bounds of the popup. It also has a ShroudStyle defined which covers the whole UI, stopping clicks being received by the main page. These two effectively make the popup modal in appearance. The popup now has to be closed before the user can access the main page.

The popup also has buttons to navigate forwards and backwards through the list of employees. When one is clicked, the event is processed by the main page and the appropriate details are passed to the popup to show. The use of event driven processing is necessary because despite the appearance of the popup being modal, it is still just a panel. This means that as soon as the ShowPopup method has finished processing, the next line of code will be processed. Any attempt to show the popup within a loop will result in the loop completing almost instantly.

So, code similar to that below will process the whole of the list with the result that only the last set of details will appear to be shown

Code: Select all

SelectList Named(#Employees)
   #Popup.ShowEmployee(#ID)
Endselect
Attachments
Popups.zip
(15.53 KiB) Downloaded 364 times
Stewart Marshall

Independent IT Consultant
www.marshallfloyd.com.au

Post Reply