23
Views
6
Comments
Solved
Need help grouping dropdown elements.
Application Type
Mobile

I need help grouping dropdown items. I have already installed this forge extension, but I don't know how to apply it to my program. I am new to Outsystems, I'm pretty sure it's an easy solution, but I am not figuring it out.

Here is an example of how it's looking without the grouping...



My main idea would be to, order the "Produto" dropdown, then based on what item I selected on the "Produto" dropdown, I would only have the "Job" dropdown options related to the "Produto" item.


*For exampling purposes, I grouped the table for the screenshot, but it's currently without the grouping in the OML*

So when I choose "861-A000" in the "Produto" dropdown, I'd get the only 2 "Job" options related to it. (I know in this example, those 2 are the only ones in total, but there will be more.)


Thanks for the help,

Alexandre.

ExpedicaoApp.oml
Solution

Here's my updated sample with grouping in the main aggregate, but I would suggest you to reconsider your database structure. 

The current way you're not able to determine which record of ones with the same label is actually selected. 

It looks like Job need to be a separate entity with one-to-many relation to Produto. This way you're able to keep your ProdutoCods unique.

Sample.oml

Hi Alexandre,

Please check the attached sample. Hope it's the behaviour you want to achieve. 

Sample.oml

Hello Daryna,

Thank you for the answer. 

The sample is working like I want for one part, which is the refreshing the data and associating the "DependentDetails" to the "MainDetails".

Now I am missing the Grouping of the "MainDetails". I have grouped on their table, but the aggregate is messing up with the dropdown, because the variables I had to choose in the dropdown got limited to only 1 and it's not working fully as intended.

Here is without the "Group By":

Table:

Dropdown properties:

Here is the "Group By" attempt:

Table:

Dropdown Properties:


Apologies for the lack of knowledge on my side and thank you for your time :)

Solution

Here's my updated sample with grouping in the main aggregate, but I would suggest you to reconsider your database structure. 

The current way you're not able to determine which record of ones with the same label is actually selected. 

It looks like Job need to be a separate entity with one-to-many relation to Produto. This way you're able to keep your ProdutoCods unique.

Sample.oml

That works how I needed, how did you do that?

I will change how the database works, according to your suggestion, I appreciate it.

Thanks Daryna :D !!!

Hi Alexandre Martins ,

You can keep another temp productJobList (same as product list -GetProdutoes) on page and bind to the second dropdown (which is the job drop down).

After this , on change of product (the first dropdown) filter the product list with selected product and assign to temp productjobList, so in second drop down you will get the related jobs.

hope this help.

Thanks,

Rafi 


Hello Rafi, 

Thanks for your answer.

You are saying that I should separate the "Job" Column from the Products List, so it's possible to order the Products in one List and use the JobList for the second dropdown? 

The JobList being associated with the Products list by Foreign Key and ProductID, right?


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