I have made an update form and it appears to work. I entered field values in the tabel with PhpMyAdmin, and the form will read the query. When I update fields through the form, that will work too.
BUT: when I refresh the formpage in Wappler it will completely wipe the record and set the fields to NULL.As far as I can tell everything is set as should, so (as usual) I don’t understand why this is happening.
If I understand you correctly, the fields in your Database table all become NULL when you reset the page, if so do you possibly have the server update set to Auto Load in your App Connect section?
If you rather are meaning that you setup the form generator window in Wappler and then want to go back into the Form Generator wizard to make some modifications to what you initially set, and all the options you had set before are gone, and you have to reset everything again, then that is normal behaviour.
If after running the wizard interface you would like to go make an alteration then rather click the form field directly in design view and, use the App Structure Properties panel to make your minor adjustments.
@web-works it would be great if you provide a link to your page, where we can check this,
http://www.testworks2.nl/content/
User: admin/PW:admin1
This is just a testdomain, so no harm can be done.
No, that is not the issue. The issue is:
- The form on a live server will update as expected
- In Wappler when refreshing or saving the page when “target” is the external server, it will empty the record and set field at NULL. Although the imagenames will remain in the record.
Two examples below. Top one is before refresh/save, bottom is after refresh/save
The problem is exactly what Paul suggested.
You added the update action as a server connect component on the page:
<dmx-serverconnect id="indexmainquery" url="../dmxConnect/api/Kienehoef/Content/indexmain.php"></dmx-serverconnect>
And it executes on page load deleting everything.
You should not add the update action as a server connect component on the page, it is only needed in the update record form.
Just to make sure. If I want to fill the fields of a form from the database, I need to make a separate action file with a query which goes below “App”. And another action file for the update that goes with the “Form”?
Yes, but on your page currently both are using the same server action which you are using to update the data.
Got it! Working as expected now. Will try not to forget this (age problem I guess )