12
Views
8
Comments
Solved
How to change value of dropdown list based on another dropdown value inside a table?
Question
Application Type
Reactive
Service Studio Version
11.10.0 (Build 34712)

I have two list inside a table, Difficulty and Level.

In Level entity, I have referenced the Difficulty Id in order to filter it in this table.

What I want to happen if I select Easy in difficulty dropdown, I will be able to filter the levels that have Easy difficulty.

But what happens currently is all level dropdowns in the table changes whenever I select a difficulty in the Difficulty column

on the screenshot above, in the Easy row, I want to select only Level 1, on Medium only Level 2, on Hard only Level 3. But all rows list is being changed when I change only on the current row.

On my Difficulty Dropdown OnChange:

On my levels list Aggregate:

My table:


EDIT: I have uploaded a much cleaner OML for you to check, if you can. I'm really struggling to make this simple thing work lol. Just add some rows for Stage and Difficulty page, then Add row on Record page and play around by adding at least two row, and change Difficulty dropdown and all Stage dropdown rows will change as well (this is the bug I'm trying to work on).

SampleApp.oml

mvp_badge
MVP
Rank: #75
Solution

Hi Kenneth,

Sorry for the late reply. As per the requirement, I have incorporated some code changes in the shared .oml file. 

Please refer to the attached .oml file.

Implemented Points

  • As all the stage Dropdown widget List property was referring to a common aggregate List as its source, which was getting refreshed within the OnChange of the Difficulty Dropdown, it was reflecting/updating all the stage dropdown in the Table widget.
  • As a solution, I have encapsulated the Stage dropdown widget within a separate block called StageDropdownBlock and referred to the same in the Table widget stage column.
  • Within the StageDropdownBlock, I have defined an event called Event_PassStageId  (with an input parameter called StageIdwhich is responsible to pass the selected stageId to the parent screen.
  • In the Main Screen, I have defined the event handler action flow called StageDropdownBlockPassStageId (for the event defined in the StageDropdownBlock), within which I assigned the handler input parameter value i.e. StageId value to the GetRecords.List.Current.Record.StageId

Hope this helps you!


Kind regards,

Benjith Sam

SampleApp.oml

mvp_badge
MVP
Rank: #75

Hi Kenneth,

Make sure that the dropdown widget in each record/row of the table in the Level column is mapped with a separate variable. i.e. GetMappingList.List.Current.EntityName.LevelIdentifier

Note: As the dropdown widget is defined within the Table widgets, each dropdown widget's variable property should be mapped with the List.Current.Entity.Attribute container instead of mapping the variable property with a Local variable as shown below

Hope this helps you!


Kind regards,

Benjith Sam

Rank: #4751

It is mapped on the Current.Mapping.LevelId. I have uploaded the .oml to check

mvp_badge
MVP
Rank: #75

Hi Kenneth,

If possible could you please share the sample .oml file which includes the same implementation with us?


Kind regards,

Benjith Sam

Rank: #4751

I have uploaded it in main post. thank you

Rank: #4751

I have uploaded a cleaner OML so you can have a better understanding. Hope someone can help.

SampleApp.oml

mvp_badge
MVP
Rank: #75
Solution

Hi Kenneth,

Sorry for the late reply. As per the requirement, I have incorporated some code changes in the shared .oml file. 

Please refer to the attached .oml file.

Implemented Points

  • As all the stage Dropdown widget List property was referring to a common aggregate List as its source, which was getting refreshed within the OnChange of the Difficulty Dropdown, it was reflecting/updating all the stage dropdown in the Table widget.
  • As a solution, I have encapsulated the Stage dropdown widget within a separate block called StageDropdownBlock and referred to the same in the Table widget stage column.
  • Within the StageDropdownBlock, I have defined an event called Event_PassStageId  (with an input parameter called StageIdwhich is responsible to pass the selected stageId to the parent screen.
  • In the Main Screen, I have defined the event handler action flow called StageDropdownBlockPassStageId (for the event defined in the StageDropdownBlock), within which I assigned the handler input parameter value i.e. StageId value to the GetRecords.List.Current.Record.StageId

Hope this helps you!


Kind regards,

Benjith Sam

SampleApp.oml

Rank: #4751

I thought it would just gonna be some variable changes. It works though. Thank you very much!

mvp_badge
MVP
Rank: #75

You're welcome, Kenneth.

Glad to help you :)


Kind regards,

Benjith Sam