Hi, I have pretty significant issue with the way you data source and filter data and do complex retrieves on your database.
Problem
When you have an overview page for an entity that has many attributes, you will want to filter on those attributes. When that data set is large, the filtering method must be very optimized. Right now, if you want to filter on those, you will need to create microflows that have way too many and confusing paths to select the correct retrieve action. Since you do NOT want to retrieve all of the data and than subtract and iterate over those lists for all those attributes (because major performance impact), you will have to create a path for every possible filter combination. For example; with two attributes that is no problem; only four paths. But with five attributes this grows exponentially to 32!
I have read about people suggesting java actions to do this. But there are so many reasons as to why this is a bad idea:
I really want to inform people to be very careful with java actions as complex as this. I also want people to stop suggesting these kinds of things, since there can be major issues resulting from that, where problem solving is incredibely complex. Especially through the complex system and stacktraces that mendix supplies.
ONLY USE JAVA ACTIONS WHEN ARE AN EXPERIENCED DEVELOPER, KNOW WHAT YOU ARE DOING, AND ONLY AS LAST LAST RESORT.
My solution
Make it possible to build an xpath fully dynamic, instead of sort of hardcoding it into the retrieve action. It can be as simple as being able to pass a string variable into the xpath box of the retrieve action, and then build up that string variable in the microflows using exclusive splits. In the example case of filtering on five attributes, this would give the option to create a microflow with only five splits after each other followed by a single retrieve. Way easies, way more good practice.
Luca,
This capability currently exists in the Grid Search widget package. You can find it here: https://appstore.home.mendix.com/link/app/49364/
The AnySearch widget enables you to create dynamic XPath as a Mendix developer without any Java work needed. I have used this successfully and it works really well. See a snippet from the documentation below:
Hope that helps,
Mike