[Bug-12931] Perspective Table Filtering

Stumbled on a potential issue. I’m digging around to see if it could be something I’m doing. If I enableFiltering on a table in Perspective, the table throws an error whenever a value is typed into the filter box. Below is the information from the console.

Edit: a bit more info. Table is populated from a Named query

11:27:11.989 [Browser Events Thread] INFO Perspective.Designer.BrowserConsole - [mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: 'Reaction[Reaction@29922]'
11:27:11.994 [Browser Events Thread] INFO Perspective.Designer.BrowserConsole - TypeError: Cannot read property 'toString' of null
11:27:11.997 [Browser Events Thread] INFO Perspective.Designer.BrowserConsole - ui.ErrorBoundary: Component error caught in error boundary: undefined

Hi grietveld,

Unfortunately I haven’t much success in reproducing the issue you are seeing. What version of the ignition 8 beta are you on? Have you tried downloading the latest version and seeing if you can reproduce the issue? Here are some of the steps I followed to try and reproduce the issue:

1)Created a named query.
2) Added a table to a perspective view.
3) Created a named query binding to the table
4) enabledFiltering = True
5) type value into the filter box

If i missed a step you can add to it.
You could also provide me with a gateway backup for easy reproduction of the issue.

Thanks,
Anthony

I am using the version posted this morning( 8.0.0-beta0 (b2019030802)) . Those steps seem to be pretty much what I followed.

Give me a couple minutes to scrub some of the customer information from the system I’ve been playing with and I can send you a backup.

Edit: I will say that this was an updated project from 7.9.10, not a new project in 8. Not sure if that would add anything, but since this is a perspective issue, I’m guessing not.

Hi grietveld.

That would be much appreciated

Hi grietveld

I know we spoke a few day ago was just checking in was wondering if you were able to make a gateway backup for the issue you were seeing?

Thanks,
Anthony

I believe I had sent a link to a download in a message on here. It didn’t want to let me upload the file to the blog. I can send it elsewhere if that is preferred.

Hi Grietveld

I was able to download the gateway backup you sent me, However I haven’t been able to reproduce the issue that you are seeing here are some of the things I tried: -

  1. I created my own query and bound it to the table you were using and enabled Filtering and put the designer in preview mode. I was able to filter using the filter bar no error was displayed in the console. I did the binding on the props > data in the Perspective Property Editor.

  2. Toggled the enableFiltering multiple times between true and false and enter values in the filter bar

At this point I am not completely sure what causing it but will continue to investigate. In the mean time you can try and recreate the project and see if you are able to reproduce the issue with more precise steps and add any information you think would be helpful in reproducing the issue.

I believe that the filtering functionality is working and as such you can continue to use it. If anything changes I will keep you updated.

Thanks

@anjoroge, I was able to reproduce what @grietveld reported. If the table contains any NULL data you get table error when filtering.

2 Likes

Just did a different named query without Null Data, and it seems to work, so that would seem to be the same issue I’m having.

It looks like we have an internal ticket for this. I’ve updated it and pointed it to this forum post. Thanks for bringing this up.

1 Like

I had the same issue here. What I did to work around while IA will be working on it was:
1 - Creating a project script (optional to make it easy):

def removeDatasetNulls(ds):
pyDs = system.dataset.toPyDataSet(ds)
for rowIndex,row in enumerate(pyDs):
for colIndex,col in enumerate(row):
cName = str(pyDs.getColumnNames()[colIndex])
if col is None:
pyDs = system.dataset.setValue(pyDs, rowIndex, cName, '')
return pyDs

2 - Call it from a transform after the named query. Boom, filter is working!

Note: be careful with this transformation since it's changing null to empty strings. Depending on what you're doing with the data it might affect resources using it.

1 Like

More info to add on this bug.

If you filter for some regex quantifiers or operators like +, \, *, [ ], ? you get table errors as well.

This issue was fixed in the nightly 8.0.2 build that was uploaded today (4/26).