Lost Schema in Data Binding Picker for Repeat when filtering collection

Wappler Version: 5.3.1
Operating System: macOS

Expected behavior

When using the data binding picker for a repeat item, the data bindings are not displayed if a collection is filtered, eg using the ‘where’ function. The schema is lost entirely.

For example. I have built a todo list.

It uses the datastore component with 3 fields: todo, complete, added

When creating a ‘repeat’ and setting the ‘repeat’ expression to the value of the datastore collection, it correctly displays the items that are selectable from the datastore collection.

See screenshot where the $index, $key,$value, $id, todo, complete, added, are all displayed correctly…

<ul class="list-group" is="dmx-repeat" id="repeatTodo" dmx-bind:repeat="datastoreTodos.data">
                <label class="list-group-item" dmx-on:click="datastoreTodos.update({$id: $id},{1: 0})"><input class="form-check-input me-1" type="checkbox" value="" dmx-bind:checked="complete?1:0">
                    {{todo}}  {{complete}}</label>
            </ul>

Actual behavior

If the dmx-bind expression is adjusted to filter the collection then the display in the bindings screen is lost
For example, if the dmx-bind is changed from:

dmx-bind:repeat="datastoreTodos.data"

to

dmx-bind:repeat="datastoreTodos.data.where(`complete`, 1, '==')" 

with the following resultant code:

<ul class="list-group" is="dmx-repeat" id="repeatComplete" dmx-bind:repeat="datastoreTodos.data.where(`complete`, 1, '==')">
            <label class="list-group-item" dmx-on:click="datastoreTodos.update({$id: $id},{1: 0, complete: (complete == 0)?1:0})"><input class="form-check-input me-1" type="checkbox" value="" dmx-bind:checked="complete?1:0">
                {{todo}} {{complete}}</label>
        </ul>

then the data bindings page now doesn’t display the items from the datastore collection

Any acknowledgement of this bug would be great, or if it’s a mistake my side??

It is difficult to guess what the schema will be after where filters. Will investigate if we can improve this.

It might be wiser to use a data view as intermediate filter component.

Found the problem, it was related to content pages and repeat expressions in them.

Will be fixed in the next update.

1 Like

Fixed in Wappler 5.3.2

This topic was automatically closed after 47 hours. New replies are no longer allowed.