onSuccess of form post not running server connect action with query refresh

Wappler Version : 5.3.3
Operating System : Mac OS
Server Model: PHP
Database Type: Mysql
Hosting Type: Dreamhost

Expected behavior

Data should refresh on success action of form

Actual behavior

Data does not refresh

How to reproduce

<ul class="list-group list-group-flush" is="dmx-repeat" id="repeat1" dmx-bind:repeat="api_track.data.results.trackmatches.track" dmx-hide="api_track.state.executing">
                    <li class="list-group-item">
                        <form id="formAddItem_{{$index}}" is="dmx-serverconnect-form" method="post" action="dmxConnect/api/songAdd.php" dmx-on:success="notifies1.success('Song added');serverconnectTest.load({})" dmx-on:unauthorized="notifies1.danger('Already selected 3 songs.')">
                            <div class="d-flex">
                                <div class="d-flex w-75 align-items-center text-start" dmx-text="name+'-'+artist"></div>
                                <input id="addedLeerling" name="addedLeerling" type="hidden" class="form-control" dmx-bind:value="query1.data.ref">
                                <input id="addedItemName" name="addItemName" type="hidden" class="form-control" dmx-bind:value="name">
                                <input id="addedItemArtist" name="addItemArtist" type="hidden" class="form-control" dmx-bind:value="artist">
                                <div class="d-flex align-items-center justify-content-end w-25 text-end">
                                    <button id="btn2" class="btn mb-0 btn-primary btn-sm" type="submit">
                                        <i class="fas fa-plus"></i></button>
                                </div>
                            </div>
                        </form>
                    </li>
                </ul>

A normal server connect form with server connect query load onsuccess. Data has always refreshed, but not in this case.

Example video where the action is not running after add and delete:

Can you try it with:

serverconnectTest.load({},true)

I did try with that, but let me give it a go again.

Nope, that still does not run the action

May have nothing to do with it but this should be:

dmx-bind:id="formAddItem_{{$index}}"

You can also set a static id at the same time:

id="formAddItem" dmx-bind:id="formAddItem_{{$index}}"

Where is serverconnectTest on the page? Is it on a content page?

You can find the path to it using dmx.app.data - you might find you need something like
content.serverconnectTest.load({},true)

should this not be:

dmx-bind:id="‘formAddItem_’ + $index"

You can do either. It will parse value references in double braces and then anything outside them as a string

1 Like

it is just a straightforward php page.

Open the page in the browser, use dev tools > console to run dmx.app.data and find the path to the serverconnectTest element

In this example:
image

e.g. I would need app_root.main.sc_basedata.load({},true)

Ok, thanks. I knew what to do in console, but I did not know what to look for:

If it helps, the query loads automatically on page load, but onsuccess nothing happens

If you add/delete a song does running

dmx.parse("serverconnectTest.load({},true)")

in the console of your browser reload the list?

I get an ‘undefined’

Also do you have any Data Caching options set for the serverconnectTest element?

no data caching set using the ui. I there somewhere I can check in the code. But as I said nothing done using the UI and no funny code added anywhere manually

It will show undefined but you should see the request in the Network tab

nothing happens in network tab

If you go to the App node in App Structure do you have an id set?

yes: