Dinamically populate a list view?

0
Hi everyone, i’m having trouble with a list view.   I’m building an application to insert daily reports on electrical consumption. The app users have to log in and view a calendar, and after clicking on a specific day, i trigger this mf:   I have a list of meter, and for each list of meter i have to create an object of type report, which is linked to a meter in the domain model. Basically, for every meter i have to create a daily report with the measurement results and some text notes. In the next page “MeasurementList_View” i want to show a list view with all the “report” object created in loop, with the free text areas to insert the measurement and the notes. I really can’t understand how to populate the listview with the list “ReportList” i have created in this mf.     This is the page with the list view. Mendix force me to insert it into a dataview, but the list is always empty. How can i resolve this? Should i create a new entity between report and meter to pass data to the list view?   Thanks in advance  
asked
4 answers
2

Hi Alessio anghileri,

Step 1: You have to add commit activity to the commit report list that a newly created object.
Step 2: You should remove the data view widget from the page calls “Measurement List View”. If you want to see a list of reports that created newly means, you have two options.

The first one is, add a list view widget on the respective page and retrieve the reports list from the database, In this case, you no need to pass the object in the show page activity.

The second one is you can use Listen to the widget option that available in the data view widget. For this, you have to show the list of Meter objects on the respective page and add one more data view to show the associated Report object by selecting the Meter object from the list view.

I hope it might be helpful to you.

answered
1

Hi Alessio,

          In the show page activity, do you pass any input parameter of Report entity ?

          If you pass any input parameter, it will force you to create dataview for the context entity. In your microflow, I don’t see any commit activity. But you are trying to retrieve the ReportList from database. Without committing the objects, it will not be stored in the database. Add one commit activity before the show page activity to commit the ReportList. If this solves your problem, you can mark this answer as Accepted.

 

Thanks and Regards,

Vijayabharathi.

answered
0

Hi Alessio,

 

Here's my take on it.

In your calendar page, you can set that when user clicks on a day you execute a nano/microflow which takes the date object. In that flow,  add action to show the report page and pass date object to it in context.

On the report page, place list view with data source set to microflow.

This microflow will take the date object as a parameter and return list of reports. As you probably noticed, this is very similar to the microflow you already have, with the difference that now you need a return value, instead of Show page activity.

 

I hope this helps.

answered
0

Hi Alessio,

The reports you are creating are not commited, but your list is retrieving from database.

If you want to keep the microflow without commit, you has to retrieve by association. Link these reports to a object page context, and retrieve by association from this page context., and you will be able to do the page with these inline edition.

answered