VLWeb PRIM_MD.DropDown Click Event

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

VLWeb PRIM_MD.DropDown Click Event

Post by jyoung » Wed Apr 17, 2019 2:49 am

Anyone know how to "fake" a Click event with PRIM_MD.DropDown.

I have a dropdown that has a few options.

Code: Select all

#STD_TEXT := 'This Week'
#STD_TEXTS := 'THIS_WEEK'
#DropDownList.Items.Add value(#STD_TEXTS) caption(#STD_TEXT)

#STD_TEXT := 'Last Week'
#STD_TEXTS := 'LAST_WEEK'
#DropDownList.Items.Add value(#STD_TEXTS) caption(#STD_TEXT)

#STD_TEXT := 'Next Week'
#STD_TEXTS := 'NEXT_WEEK'
#DropDownList.Items.Add value(#STD_TEXTS) caption(#STD_TEXT)

#STD_TEXT := 'Period'
#STD_TEXTS := 'PERIOD'
#DropDownList.Items.Add value(#STD_TEXTS) caption(#STD_TEXT)
The problem arise when "Period" is selected, as this invokes a rather complex period lookup.
If the user selects "Period" then needs to change the period, they cannot, without first changing the dropdown's value.

The other values are not an issue as they can easily be calculated.

It only exposes a "Changed" event whereas I really need a "Click" event.

I was handling this with the old style PRIM_List.Dropdown control, but have been moving the UI to the Material Design control set.

Thanks,
Joe

jyoung
Posts: 637
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: VLWeb PRIM_MD.DropDown Click Event

Post by jyoung » Fri Apr 19, 2019 6:21 am

Try as I may, I could not find an alternative control or display mechanic to handle this that I liked.

So I punted, and made my own. 8-)

With a combination of PRIM_MD.Edit, PRIM_MD.List and the regular PRIM_PPNL popup, I made it work just like a standard PRIM_MD.DropDown.

The only "weird" thing to figure out was the placement and height of the popup, and that just took a bit of experimenting with different values to get something that looked nice.

Post Reply