Problems with DataView filter expression builder

Wappler Version :last
Operating System :Mac OS
Server Model: PHP
Database Type: MySQL
Hosting Type: custom

A filter in a DataView gives an error and an empty dialog when opening previously entered conditions


Can this be fixed without rebuilding everything?

What is your exact expression used there?

filter="(search_student.value == "" || search_student.value == null || name.lowercase().contains(search_student.value.lowercase()))&&(select_stream.selectedValue == "ALL"|| select_stream.selectedValue == activ_sream || (select_stream.selectedValue == "OFF" && activ_sream==null))&&(check_activ_stud.value == 0 ||(check_activ_stud.value == 1 && (activ_sream != null && start_stream.toTimestamp()<=datenow.datetime.toTimestamp()&& end_stream.toTimestamp()>=datenow.datetime.toTimestamp())))

The pop-up error shows that it cannot find "search_student.value" although this field is in the code and the code works

<div class="col align-self-center">
  <input id="search_student" name="text" type="text" class="form-control form-control-sm" placeholder="найти студента">
   </div>

The same error in all filters - cannot find elements in metadata everywhere

What’s interesting is that in a normal expression in other places this variable from input is displayed normally, that is, the problem is in only the dataview filter

@George Is there any hope that you will fix this filter?

Perhaps this problem is also related to the fact that when we receive from SC not just a standard result from a database query, but an array with JSON values, Wappler does not normally see this data structure.

And in general, the main problem with this new filter is that it is impossible to build conditions involving other interface elements, and not just values ​​​​from the data source - for example, selectors or radio buttons

Well the filter is meant for one thing that is filtering the dataview by its own fields… having all kind of expression not related to the data view own data, will really hurt performance as those are executed for each record and is really a bad practice.

Maybe you need to reevaluate the usage of your filters and having optional expressions that run each time…

I don't quite understand what you are trying to do or what results you are getting/expecting but in your expression you have:

search_student.value==search_student.value

Won't that always be true?

@George Well, here's a simple example - I have Select a specific group of students - which by default shows the entire list and you can also select a specific group - and I want to use it in a data filter - in the old approach it all worked great.
Or, for example, I have a checkbox that selects only groups whose period falls on the current date - everything is also simple - comparison with two fields of the current date. Why would I, with the limitations of the new filter, send all these conditions to the backend and re-execute the queries?

@brad This has nothing to do with the expression itself - just a demonstration that the values ​​of other elements can be selected in regular expressions, but not in a DataView filter - see the context above

Ah, I think I understand now. I'm going to try and do some testing. Is it happening on all data view expressions or just that one?

Is it a certain type of input you are having issues with? I tried successfully with text and select inputs.

However, I did find another bug in the expression builder editing that I will report after lunch.

My main problem is in the builder in the DataView filter - I can’t do practically anything there normally and the old one doesn’t work there either

Well you can always edit in code view as you have done before.

I will see if we can make the data view filter visual expression editor just the same as the regular condition visual expression editor, so you can choose any field

Formally, yes, but in reality it doesn’t work - since your auto-editor arbitrarily replaces many of my expressions and instead generates some kind of meaningless nonsense :slight_smile:

It would be great to have an option to disable auto-checking and auto-code generation in it.