45
Views
4
Comments
Moving between Record Lsts
Question
Application Type
Mobile

I want the user to be able to.select from a gallery of records. When they click an item, it should appear in a second list and disappear from the first.

Clicking any item in the second list should remove it from the second list, adding back to first for re-election again if desired.

After the user has finished, I should be able to get the selected records from the second list.

Any suggestions to help a newbie out?

Ant

UserImage.jpg
vikas sharma
Champion

Hi,

I guess easy solution may be just maintain one list with some boolean like IsSecondSelected. So initially all the records will be in first list and IsSecondSelected will be false for all. If user clicks on any list item set IsSecondSelected true for that item. Refresh both the lists. First list will have filter IsSecondSelected false and Second list will have filter IsSecondSelected true.

If you want to use 2 different list then initially only first list will have data and second list will be blank. Now on item click you can call ListAppend and ListRemove actions.


regards

UserImage.jpg
Anthony Fearn

Thanks for the suggestions.

I like the second idea of 2 different lists. I have created one mapped to a datasource and the other to a local variable list. How do you then in the ListAppend function access the selected list item in the first list?

2021-09-06 15-09-53
Dorine Boudry
 
MVP

Hi @Anthony Fearn ,

answering this question : in an OnClick of a list item, you can refer to listxxx.Current.data and listxxx.CurrentRowNumber to refer to the clicked one.  So let's say you click in list1, you could do a ListRemove on list1, on list1.CurrentRowNumber, and do a ListAppend on llist2, and vice versa.  If you don't entirely trust or understand that, you could give your OnClick event in input of rownumber, and use that. 

answering this post in general : in attached oml are 2 possible solutions, other than making use of listappend and listremove

  • one just refreshed the data after every change, which is slower
  • the other makes use of a single list to serve both list widgets on the screen, and makes the Visible property dependant on it being selected or not, which gives you a much faster user feedback after the click.

Dorine

PS. If you want user interaction to be even faster, you could postpone saving the changes to the database and do it with a save button, and instead of looking at identifier, add a calculated boolean column IsSelected, as @Vikas Sharma is suggesting.

QDR_DeSelect.oml
2021-09-06 15-09-53
Dorine Boudry
 
MVP

added an example with a explicit save action of the user, to match that last remark

QDR_DeSelect.oml
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.