how to read drag and drop list as shown on screen

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
adale
Posts: 210
Joined: Wed Apr 08, 2020 9:18 pm
Location: Poplarville, MS

how to read drag and drop list as shown on screen

Post by adale »

I have built a VL web dialog, based upon the xDemoWebDragandDrop, to build a Left list of items to choose from, and a Right list for the selected items, and allow changing of the items sequence. All good so far, till comes time to save the values from the list.

When an item is dragged from the Left to the Right, the item.entry value is recorded. When I use SelectList to read the Right list, it reads the list in the item.entry sequence, not the display shown sequence.

How can I read the Right list, in the sequence as shown on the display (top down)?

End result I am trying to achieve, is read the list as shown in order of the Right list displayed, incrementing a sequence field, and then I will save this to a file in the correct sequence.
Arlyn Dale
Servias LLC
adale
Posts: 210
Joined: Wed Apr 08, 2020 9:18 pm
Location: Poplarville, MS

Re: how to read drag and drop list as shown on screen

Post by adale »

Adding a few more details for clarification.
The xDemoWebDragandDrop provided the structure or ability to drag & drop items from a "left" list to a "right" list. It also provided the ability to drag & drop items in the "right" list to change the display order or display sequence in the "right" list.

When an item is dropped from the left list, it records an "item.entry" value for item in the right list.

When you drag & drop the items in the right list, the display sequence changes on the screen, but the item.entry value is not changed or updated.

When I use SelectList to read the right list, it is read in the item.entry sequence, not the screen display sequence.

- How can a read the list, in the sequence as displayed on the screen?

- Or, what or where is the "display" sequence value stored? Is this able to be retrieved in an "For Each" intrinsic?
Arlyn Dale
Servias LLC
davidbalansa
Posts: 92
Joined: Mon Feb 01, 2016 10:08 am

Re: how to read drag and drop list as shown on screen

Post by davidbalansa »

Hi adale,

You can read the list in display order using the following code:

For Each(#row) In(#RightList.items)

Get_Entry Number(#row.entry) From_List(#RightList)

...

Endfor
adale
Posts: 210
Joined: Wed Apr 08, 2020 9:18 pm
Location: Poplarville, MS

Re: how to read drag and drop list as shown on screen

Post by adale »

Perfect!
Thank you!
Arlyn Dale
Servias LLC
Post Reply