remove one item from a list in mobile

Hi guys, 

I am using a local variable in a list. I want to remove one list item from the list. Is there something like "list clear" for one item of the list (List Item Clear)? 

Thanks! 

Tobias

Solution

You can use ListRemove action.

Before using it, you need to iterate on your list, find out the row number of the item want to delete, and after the for each loop is complete you use the ListRemove using the row number as input parameter.

Solution

Hi Joao,

I guess ListRemove is only possible for Web Apps 

Nop. You can use a client action called ListRemove for mobile apps as well.

Thank you Joao! 

It works out well!!! 

It did not implement the iteration because removing something within an iteration causes errors ("list is beeing iterated remove is not allowed".)

Have a great evening! 

Tobias 


That's why I told you to find out the row number within the iteration, and only after the for each loop you use the ListRemove action... ;)

Nice you figured that out!

Sorry dude, it was a pretty hot day today ;) 

João Melo wrote:

You can use ListRemove action.

Before using it, you need to iterate on your list, find out the row number of the item want to delete, and after the for each loop is complete you use the ListRemove using the row number as input parameter.

Hi João.

I'm new to outsystems (1º project after the tutorials) and i'm trying to do something similar to what BigSlikTobi asked but im not understanding how to implement yor suggestion.


What im trying to do is to remove from the list, the selected item in this list record when i press the trash can:


And at the same time to remove from the source record list of this list record, because otherwise if i refresh the page the deleted item will show up again since it still in the source of the list record.


The problem is that i'm not being able to send the id of the selected item in the list record to the correspondent item in the list local variable.


Can you provide some oml example or try to explain your suggestion in a different way to see if i get it?


What i have at the moment:


Im using outsytems 11 and im tring to do this in a tradicional web app.


Regards,

Leonardo Abrantes.

Hi Leonardo, 

You are responding to an old thread that already has an answer. Please create a new thread for your question.  

Vincent Koning wrote:

Hi Leonardo, 

You are responding to an old thread that already has an answer. Please create a new thread for your question.  

Ok.