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
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
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?
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
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.
added an example with a explicit save action of the user, to match that last remark