Hi fellow Mendix’ers, I have a main entity "Trip” that is linked (many to many) with a sub-entity “TripDay” (a trip consists of more days, but a day can be used in another trip as well). When I want to view the different days of a trip, I want to constrain this to only show the days belonging to that trip and not of other trips. I do not want to use the “by association” as I need my on screen sort option which is unavailable for association-data. As you can see on the picture, the TripDay-listview is nested into a Trip-dataview. Why can't I select the "Trip" parameter as a variable in my Xpath constraint for the Tripday to filter the shown data? Is it possible to do get my data by writing an Xpath-constraint or do I really need to use the "by association”? If this is the case, what is the best option to sort my items on-screen? I have wasted hours on trying to solve this issue, but I can't seem to find the correct solution. Thanks for your help! -Stijn
asked
Stijn Berkvens
3 answers
1
You should be able to use [Viax.TripDayCopy_TripCopy = ‘[%CurrentObject%]’] as way of checking if one of the Trips linked to this day is the trip in the parent dataview. This would also make your first constraint obsolete.
answered
Thijs van der Meer
1
Your almost there: Try something like [MyFirstModule.Tripdays_Trip = '[%CurrentObject%]'] in the XPath to only show the tripdays that refer to the trip.
Regards,
Ronald
[EDIT]
Here a screenshot
answered
Ronald Catersels
0
Hi Thijs & Ronald,
Thanks for the quick response and solution! Also clarified the X-path constraint a little bit better. Is the [%CurrentObject%] always the parameter variable you insert or how should I see this?