Hi, I would like to know how can I save the sorted list using the drag and drop Mobile (https://www.outsystems.com/forge/component-overview/2254/drag-and-drop-mobile).

For instance, I have a list of orders for production and I want to change the priority by sorting the list the way I want. Then,  I want to move to another screen and keep these changes to see the orders that I sorted before when returned to the screen.


Thank you very much!


Solution

Hi Matheus,

You can check here how to do it: https://success.outsystems.com/Documentation/SILK_UI_Framework/Drag_and__Drop_Component

Go to the Sort section. While the document is still for SilkUI, it should be the same for OutSystems UI.

Cheers.

Solution

I can think of a couple of solutions, but really depends on the case. If it makes sense, e.g. if those are a list of Orders per batch, you can simply have a column in the Order Entity to save their position in said batch, and when leaving the first screen, just update each order with its new position, so it's position is retrieved in the next screen preparation and you can just sort it by that.

If this doesn't make sense, you can have a session variable with a list of Id's, where you'll store the list of the Order Id's in the positions you chose when leaving the first screen, and in the next screen's Preparation after retrieving the Orders, just iterate the session variable and append the Orders retrieved to a Local List in the screen following the session variables' order.

Depending on your specific case there might be better solutions though.

Nuno Lopes wrote:

I can think of a couple of solutions, but really depends on the case. If it makes sense, e.g. if those are a list of Orders per batch, you can simply have a column in the Order Entity to save their position in said batch, and when leaving the first screen, just update each order with its new position, so it's position is retrieved in the next screen preparation and you can just sort it by that.

If this doesn't make sense, you can have a session variable with a list of Id's, where you'll store the list of the Order Id's in the positions you chose when leaving the first screen, and in the next screen's Preparation after retrieving the Orders, just iterate the session variable and append the Orders retrieved to a Local List in the screen following the session variables' order.

Depending on your specific case there might be better solutions though.


Thank you for the reply, but I didn't achieve the result I want so far. I need to create that on mobile so I don't have session variables. 

Hi Matheus,

You had problems with the instructions in the link I sent? 

The actual component is too different (it shouldn't)?  

Cheers.

Eduardo Jauch wrote:

Hi Matheus,

You had problems with the instructions in the link I sent? 

The actual component is too different (it shouldn't)?  

Cheers.

Hi Eduardo, 

I had seen what you sent but It doesn't present anything related to the issue. The link just say about using the component in the list but anything related to saving the state of the final sorted list.

Thank you!


Hi,

I did this small test module based on the document I pointed you (it was necessary some adaptation).
I couldn't make it work using a list directly from an aggregate (rendering problem in the screen), so I used a Local list instead.

Hope this can help you.

Cheers.