Re: [Xsltforms-support] Problem with form refresh
Brought to you by:
alain-couthures
From: Tim T. <tim...@gm...> - 2020-03-14 15:07:22
|
Hi, Alex, I've tested your form in BaseX using RESTXQ and, after some modifications, it seems to be working. I haven't used eXist for a while, but the approach should be similar there. Here's what I changed: (1) Populate the XForms instance from the database directly. Instead of <xf:instance id="my-category-list" src="{$file}" xmlns="" />, do <xf:instance id="my-category-list" xmlns="" ><data>{$file}</data></xf:instance>. (2) Define the submission to have @replace="instance" instead of @replace="all": <xf:submission id="save-to-local-file" method="post" resource="..." replace="instance" instance="my-category-list">...</xf:submission> (3) Remove <xf:reset/> from your xforms-submit-done action. This seems to reset the instance data to its initial state after each submission. Therefore, you won't see your updates, even though they are being saved to the database. My updated version of your XQuery is attached. (Note that the database functions are specific to BaseX--for example, update:output is a shortcut to return the modified data after saving it to the database.) Just let me know if you have any questions. Tim -- Tim A. Thompson Discovery Metadata Librarian Yale University Library On Fri, Mar 13, 2020 at 4:05 AM Alessandro via Xsltforms-support < xsl...@li...> wrote: > Hi Tim, > > By working refresh, do you mean just clearing data from the form once it > has been saved? > > not exactly, data are loaded into the htlm table of the XForm, rows with > new data are added or old rows deleted and the refresh should update the > shown data, loading again into the table what just saved to the xml > database file. > > I have attached the two minimal working files. In my case everything runs > within exist-db 5.2 > Many thanks > Alex > -- > Inviato in modo sicuro con Tutanota. Ottieni la tua mailbox crittografata > e senza pubblicità: > https://tutanota.com > > > > > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support > |