46
Views
10
Comments
Solved
How to achieve this "complex" context in Outsystems?

Hi! Im trying to achieve this context with Outsystems:

Basically there are processes and a Process can have several Sections and each Section can have several Items (a item can be some text or a radio button).

I already have the context almost functional but Im stuck in a part of the ProcessDetail screen. In this screen there is the button "Add Section". When this button is clicked the popup "New Section" opens to create a new section. After creating the section the popup  closes and the new added section appears in the process detail screen in an accordion format.


Then for each section is possible to add new items. To create new items there is also a popup like the sections popup. 


This is working fine.


Issue:


But Im stuck in the part of this scenario where a item can be a text or a radio button. For example in the image first the user creates an item "Example of question?" and the item appears in the corresponding section (Section 1 in the case of the image). There is a column in the Items table ParentItem, and in this case the ParentItem is this item itself.

But then in the image example, the user creates another item, a radio button "Yes". The parent of this radio button is the item "Example of question?". And the indentation is 10px which means that this radio button item "Yes" will appear with a margin-left of 10px to give some indentation. My doubt is how to properly show the items, how to show text/radio button depending on the selected type, how  properly handle the indentation and ParentItems part. Do you know how to properly achieve this context? 


I have this working example in the image in the OML.


Thanks!

test.oml

Rank: #68
Solution

Hi Jake,


You can control the content to display based on a If condition, in this way you can display an expression if type is text or a radio button if type is radio button, like this:



You were also missing some fields saving the item in the database, so in the NewItemPopup I binded all the inputs to the Form and used the Form as the input for the CreateItems action:


OML in attachment.

Hope it helps.


Cheers,
João

app.oml