Create widget / Pass value to a widget dynamically in the same page

0
I have a page where I have a reference selector. I choose the value from the drop down and click a button which calls a microflow and shows another page which displays the another widget displaying relative to what I selected. Instead of showing in a seperate page, I want it to get displayed in the same page. Is it possible to create a widget in the page / or keeping it inactive, but after chosing the value it should be active? I tried having different data views but it throws error stating page parameter must have the same entity. Case:  
asked
3 answers
0

My ideas:

- Place your 2nd data view (MyDocument) within your 1st one (MyDocRef)

- Create an association 1-1 between MyDocument and MyDocRef called “SelectedDoc” for example

- Use this association as DataSource for your 2nd data view

- Add an OnChange microflow (or OnLeave) on your dropdown.

In this event microflow, set the association with the selected document, and refresh your page.

answered
0

Seems to me that all you need is a nested data view

https://docs.mendix.com/refguide/entity-path-source#2-properties

Drag the MyDocument dataview inside the dataview and select the path to the context object just like you did in the dropdown

 

You can set an empty entity message to make it look nicer

https://docs.mendix.com/refguide/data-view#4-4-empty-entity-message

answered
0

I actually figured it out. I placed a Data grid widget and gave it’s source as my entity which has my documents. Filled it automatically and deleted the unnecessary buttons. I placed a Data view inside the grid and chose ‘Listen to widget’ as it’s Data Source and selected the grid from the drop down. Then I placed the Document viewer inside the Data view. When I choose a particular pdf in the Data Grid, that pdf gets opened in the Data View.

answered