Filter a DataList by an associated entity attribute

0
Hi, I have spent a lot of time already on this and can’t find a solution in any of the Mendix Docs I have looked at. I want to filter a list of tasks in one entity by an attribute from an associated entity. E.g. A list of tasks will be for repair to one particular seat and any individual task can only be associated with one seat. I have attached my Domain Model. What I want to do is … List all tasks initially Have a filter that allows a user to select the SeatCode they want the tasks listed for and refresh the list according to their choice. Are there any Docs that describe a similar ‘How to’ for this scenario. Thanks for your help. Gareth.
asked
4 answers
0

Domain model and Datalist

answered
0

As i understood you need to filter your list based on the Seat , there are several ways for that but here is one :

- Make an outer dataview “Task” either as page parameter or from Microflow > just create new object from Task.

- Inside it put a reference selector for the “Seat”.

- Make an inner dataview “Seat” by association with the outer one  “Task”.

- Put your list in the inner datavew , use xpath or Microflow as your Datasource , for xpath

[MyFirstModule.Task_Seat = '[%CurrentObject%]'] 

But if you want to display all the Tasks initially on load , use a Microflow and check the passed object to it .

Hope this is helpful.

Regards,

Sufian.

answered
0

Screen shots as per my response

answered
0

Hi Sufian,

Thanks for your help with this. I’m not getting it to work but will try again tomorrow. The XPath is the problem as it doesn’t recognise the constraint and when I save the final list view, it remains as an unknown source. Please see attached image ...

answered