Unable to search on one to many relationship items in Grid2

0
We seem to have lost the ability to search on one to many relationship entities attributes.  This is very limiting.  The use of data source MFs for this purpose is very inefficient and difficult to setup - this would be big step backwards unless there is some other way of doing this I am not aware of?
asked
4 answers
0

Hi - do we know if and when this will be resolved?  It is quite important as losing this functionality means we will not be able to move from Grid 1 to Grid 2?  

answered
0

+1, and we NEED an update on this. It also shouldn't stop at Data Grid 2: pluggable widgets in general need a way to search along association paths, including from the 1 side to the many side and across multiple hops, the way Data Grid 1 search fields always could.

Example: a grid on Sales.Order where users search by participant name:

Sales.OrderLine_Order/Sales.OrderLine/Sales.OrderLine_Participant/Admin.Account/Name

Data Grid 1 handles that with one search field and builds the XPath on the server. Today a pluggable widget can only filter on the list entity's own attributes or one direct association, and at runtime it gets a handle for the attribute, not the path, so it can't even pass the path on.

A lot of enterprise apps started on the Dojo client with Data Grid 1. We have thousands of these grids. "Use an NPE and a microflow" means a helper object and a microflow for every grid, plus hand-built paging in each one if you want it, so in practice the official answer is "maintain thousands of microflows." That isn't a migration path at that scale. We've also tried page variables, browser-side joins, a custom request handler, and private client APIs. Each one either adds model work per grid, doesn't scale, or breaks on upgrade.

What would fix it: let a datasource-linked attribute property hold an association path, picked with the same Select Attribute tree Data Grid 1 uses, and let the filter builders use it, with the XPath built on the server. The path stays in the page model, so security works the same as Data Grid 1.

I've opened a support ticket and posted an Idea: [link]. Please upvote if this affects you.

answered
-1

Hello Joe ;) 

 

I believe there's a way of doing this by implementing the filter mechanism in the following way. You can use a non-persistent helper object to capture the selection of the *many objects and then filter the grid based on that. Also the grid should have a datasource microflow where the filtering process is done. 

 

So if you have 1 Car has many Colors. In the non persistent filter helper entity we capture the selection of colors (Via a combo box for example). Then when the selection is done (on combo box on change event, for example) we refresh the helper filter wrapping object which should trigger the datasource microflow in the grid. In the datasource microflow in the grid we use the helper to retrieve the list of colors and for each color we could retrieve the cars which contain that color. At the end we can apply the union operator (list operations) on all the lists and the result should be okay. 

 

Hope this helps. 

answered
-1

Hi Joe,

You can achieve this using the Association Filter in Data Grid 2. You do not necessarily need a Microflow data source for this scenario.

In recent versions of Data Widgets, association filtering is configured through the dedicated Drop-Down Filter widget.

Solution: Configure an Association Filter

For example, assume you have the following domain model:

  • Car (parent entity)

  • Color (child entity)

  • One Car can have multiple Color objects (one-to-many association).

Follow these steps:

  1. Keep your Data Grid 2 data source as Database/XPath, with Car as the entity.

  2. Add a Drop-Down Filter widget to the Data Grid 2 filter area.

  3. Set Filter By to Association.

  4. Under Entity, select the association between Car and Color.

  5. Configure Selectable Objects to retrieve the available Color objects.

  6. Set Caption Source to Attribute and select the relevant attribute, such as ColorName.

  7. Enable Filterable and Multiselect if users need to search and select multiple colors.

  8. If you use an expression for the caption, configure the Search Attribute with the string attribute used for searching.

  9. Run the application and select a color. The grid should display only cars associated with the selected color.

Expected result

For example:

Car

Associated colors

Car A

Red, Blue

Car B

Green

Car C

Red, Yellow

If the user selects Red, the grid displays Car A and Car C.

Important version note

If you are using Data Widgets 3.x, association filter configuration has changed. The association must now be configured directly in the Drop-Down Filter rather than in the Data Grid 2 column configuration.

Official documentation:

This approach retains the Database/XPath data source and built-in paging, without requiring a custom Microflow data source.

Hope this helps! If you find this answer helpful, please mark it as the accepted answer.

answered