Hello Tim,

It appears that there is actually no event attached to this refresh action. The latest 1.5beta build does not support this situation so a Javascript error occurs (I don't know whether a warning should be displayed or if it better just to ignore "unreachable" actions).

Please try again with an embedding xf:action for xf:setvalue followed by xf:refresh (which might be useless BTW).

The next build should just ignore this.

Thanks!

--Alain


Le 28/02/2020 à 04:16, Tim Thompson a écrit :
Hello, Alain,

Thanks again for the latest updates! I have another test for you.

Here is my use case: I want to display an ephemeral "Loading" message when I trigger a submission. To achieve this, I have an instance:

<instance id="state">
  <data xmlns="">
    <status loading="false" ready="false">...Loading...</status>
  </data>
</instance>

When the submission is triggered, I call xf:setvalue to change the @loading attribute to "true." This causes the loading message to display. When the submission completes, the @loading attribute is set to "false" again.

For the value change to take effect, I find that I have to call xf:refresh, or else the binding won't be registered.

In the latest version of beta1.5, if I call xf:refresh from within an xf:submit element, the following error is thrown. This does not occur in XSLTForms 1.4.

XSLTForms Exception
--------------------------

Incorrect Javascript code generation:

XsltForms_abstractAction.prototype.init@https://www.tat2.io/basex2/static/xsltforms.js:11252:35
XsltForms_dispatch@https://www.tat2.io/basex2/static/xsltforms.js:11462:7
anonymous@https://www.tat2.io/basex2/static/xsltforms.js line 5740 > Function:3:181
schback/<@https://www.tat2.io/basex2/static/xsltforms.js:5759:125
schback@https://www.tat2.io/basex2/static/xsltforms.js:5759:66
schloader@https://www.tat2.io/basex2/static/xsltforms.js:5780:11
XsltForms_class.activateAll@https://www.tat2.io/basex2/static/xsltforms.js:5815:11
xsltforms_init@https://www.tat2.io/basex2/static/xsltforms.js:16516:22


TypeError

mainaction.hasAttribute is not a function

However, if I call xf:refresh from within an xforms-submit action, no error is thrown.

See examples:

*1. xf:setvalue with xf:refresh inside xf:submit (1.5beta)*:
https://www.tat2.io/basex2/static/xsltforms_setvalue_refresh_test_2020-02-27_1.5beta.xml

*2. xf:setvalue inside xf:submit, xf:refresh inside xforms-submit action (1.5beta):*
https://www.tat2.io/basex2/static/xsltforms_setvalue_refresh_test_2020-02-27_1.5beta_v2.xml

*3. xf:setvalue with xf:refresh inside xf:submit (1.4):*
https://www.tat2.io/basex2/static/xsltforms_setvalue_refresh_test_2020-02-27_1.4.xml


Best regards,
Tim


--
Tim A. Thompson
Discovery Metadata Librarian
Yale University Library

On Mon, Feb 17, 2020 at 4:56 PM Tim Thompson <[email protected] <mailto:[email protected]>> wrote:

    Thank you, Alain!

    If you don't mind, I have another test form that works in
    XSLTForms 1.4 but not 1.5beta.

    This one is testing xf:var again.

    In 1.5beta, an error is thrown:
    Assertion failed: Binding evaluation didn't returned a nodeset but
    '1' for XPath expression: count(ancestor::item)
    
https://www.tat2.io/basex2/static/xsltforms_var_test_2020-02-17_with_var_1.5beta.xml

    In 1.4, the form works as expected:
    
https://www.tat2.io/basex2/static/xsltforms_var_test_2020-02-17_with_var_1.4.xml

    Best regards,
    Tim


    --
    Tim A. Thompson
    Discovery Metadata Librarian
    Yale University Library


    On Mon, Feb 17, 2020 at 3:54 PM Alain Couthures
    <[email protected]
    <mailto:[email protected]>> wrote:

        Hello Tim,

        This issue is now fixed (and some more actually...).

        The new build can be downloaded at the same URL:
        www.agencexml.com/1.5beta/xsltforms.zip
        <http://www.agencexml.com/1.5beta/xsltforms.zip>

        Thank you again for your contributions!

        --Alain

        Le 15/02/2020 à 01:15, Tim Thompson a écrit :
        Hello, Alain,

        Another test for you:

        In XSLTForms 1.5beta, the DOMActivate event is not being
        evoked for input controls. See this test form:

        
https://www.tat2.io/basex2/static/xsltforms_DOMActivate_test_2020-02-14_1-5beta.xml

        Pressing "enter" in the input field does nothing, whereas
        clicking the button triggers the event.

        Compare this to a form running XSLTForms 1.4:

        
https://www.tat2.io/basex2/static/xsltforms_DOMActivate_test_2020-02-14_1-4.xml

        Here, the DOMActivate enter works in both the input field
        with the "enter" key and with the button.

        All best,
        Tim

        --
        Tim A. Thompson
        Discovery Metadata Librarian
        Yale University Library

        On Wed, Feb 12, 2020 at 5:51 PM Tim Thompson
        <[email protected] <mailto:[email protected]>> wrote:

            Great! Works perfectly now. Looking forward to the XML
            Prague proceedings and video for your presentation with
            Steven Pemberton.

            Thanks again,
            Tim


            --
            Tim A. Thompson
            Discovery Metadata Librarian
            Yale University Library



            On Wed, Feb 12, 2020 at 4:00 PM Alain Couthures
            <[email protected]
            <mailto:[email protected]>> wrote:

                Hello Tim,

                (1) The xf:group processing was not correct: in the
                new approach, an xf-bound attribute has to be
                automatically added to each xforms-* element when
                xf-ref (or xf-bind) is evaluated as a non empty
                nodeset. CSS attribute selectors are, then, used to
                display/hide xforms-* elements accordingly.

                (2) The xf:var processing was not functional: it
                should now work, at least, outside of actions.

                (3) The profiler is actually just another external
                form: I have added the corresponding file into the
                updated .zip file at
                www.agencexml.com/1.5beta/xsltforms.zip
                <http://www.agencexml.com/1.5beta/xsltforms.zip>

                Thank you very much for your contributions!

                --Alain

                Le 09/02/2020 à 20:51, Tim Thompson a écrit :
                Hello, Alain,

                I've been testing an existing form with the new
                release and have some feedback. First, the
                performance improvement seems impressive, and CSS
                styling with Bootstrap now seems much easier. Thank you!

                I did notice some issues after testing, however.

                (1)
                There seems to be a bug with XPath predicate
                filtering in xf:group elements. For example, a group
                binding such as <xf:group
                ref="instance('response')/response[*]">...</xf:group>,
                where the response element should initially be empty
                (before a submission is executed) does not seem to
                work.

                See the test form copied below. Example form at:
                https://www.tat2.io/basex2/static/xsltforms_test_2020-02-09.xml

                (2)
                I see that the xforms:var element is not currently
                supported. When loading a form with an XForms
                variable defined, I get an error message:

                Error initializing:

                xforms:var is not supported

                (3)
                I also see that the XSLTForms Profiler does not seem
                to be available. When I try to open it, I get an error:

                File not found (404):
                https://www.tat2.io/basex2/static/xsltforms_profiler.xhtml

                *
                *
                *--Test form for XPath predicate bug--*
                *
                *
                <?xml-stylesheet type="text/xsl" href="..."?>
                <html
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
                xmlns:xsd="http://www.w3.org/2001/XMLSchema";
                xmlns:xf="http://www.w3.org/2002/xforms";
                xmlns:h="http://www.w3.org/1999/xhtml";
                xmlns:ev="http://www.w3.org/2001/xml-events";
                xmlns="http://www.w3.org/1999/xhtml";>
                  <head>
                    <meta http-equiv="Content-Type"
                content="text/html; charset=UTF-8" />
                    <title>XForms/XPath Predicate Test</title>
                    <style type="text/css"/>
                    <model xmlns="http://www.w3.org/2002/xforms"; id="m">
                      <instance id="default">
                        <data xmlns="">
                          <default/>
                        </data>
                      </instance>
                      <instance id="response">
                        <data xmlns="">
                          <response/>
                        </data>
                      </instance>
                      <instance id="response-test">
                        <data xmlns="">
                          <response>
                <testing>Testing</testing>
                          </response>
                        </data>
                      </instance>
                    </model>
                  </head>
                  <body>
                    <div class="container-fluid">
                      <hr class="blue" />
                      <h1>XForms/XPath predicate test</h1>
                      <xf:group ref="instance('response')/response[*]">
                        <h2 style="color: red;">This should not
                display!</h2>
                        <xf:output value="concat('Value of
                &quot;serialize(.)&quot;: ', serialize(.))"/>
                      </xf:group>
                      <xf:group
                ref="instance('response-test')/response[*]">
                        <h2 style="color: blue;">This should
                display.</h2>
                        <xf:output value="concat('Value of
                &quot;serialize(.)&quot;: ', serialize(.))"/>
                      </xf:group>
                    </div>
                  </body>
                </html>



                --
                Tim A. Thompson
                Discovery Metadata Librarian
                Yale University Library

                On Sun, Feb 9, 2020 at 11:06 AM Tim Thompson
                <[email protected] <mailto:[email protected]>> wrote:

                    Hello, Alain,

                    Congratulations on this milestone! I am very
                    eager to try and test the new release. Is
                    XSLTForms now using Fleur for XPath parsing?
                    Does this mean that XPath 3.0 functions are now
                    supported? I guess I can test this myself :)

                    It's quite amazing to see the xsltforms.xsl file
                    down to just over 500 lines.

                    Thanks again for all your work.

                    Best regards,
                    Tim


                    --
                    Tim A. Thompson
                    Discovery Metadata Librarian
                    Yale University Library

                    On Wed, Feb 5, 2020 at 3:16 PM Alain Couthures
                    <[email protected]
                    <mailto:[email protected]>> wrote:

                        Hello,

                        Please find a new release for XSLTForms at
                        www.agencexml.com/1.5beta/xsltforms.zip
                        <http://www.agencexml.com/1.5beta/xsltforms.zip>

                        It has not yet been fully tested because a
                        lot of changes have been made and you are
                        welcome to locate remaining issues with your
                        own forms.

                        The XSLT part has been reduced to minimal
                        for better performance. Instead of parsing
                        the XPath expressions and transforming all
                        the XForms elements into HTML elements, it
                        basically just transposes the non-HTML
                        elements into sort-of custom elements:
                        xforms:* elements become xforms-* elements
                        with xf-* and ev-* attributes.

                        Have a look with your favorite browser
                        debugger! Actually, authors could even
                        prefer to directly write/generate forms with
                        this new notation and forget about the XSLT
                        step. You can compare two sources for the
                        same form: hello.xml and hello.htm

                        XSLTForms Javascript classes constructors
                        are obtaining their properties directly from
                        xf-* attributes and XPath parsing is then
                        performed.

                        No ids are automatically added as previously.

                        Extra xf-* attributes and extra xforms-*
                        elements are used to embed effective HTML
                        rendering elements, for example, xforms-body
                        or xforms-repeat-item while, before, span or
                        div elements where used.

                        XSLTForms classes for xforms:select and
                        xforms:itemset had to be partially rewritten.

                        SVG support has been basically tested too.

                        CSS styling is not anymore based on xforms-*
                        classes but on custom element names and
                        attribute selectors. For example, the extra
                        xf-bound attribute, when present, says that
                        the XForms control is bound to a node,
                        eventually a not relevant one, and the extra
                        xf-notrelevant attribute can, then, be
                        checked...

                        Thank you for your contribution!

                        --Alain
                        _______________________________________________
                        Xsltforms-support mailing list
                        [email protected]
                        <mailto:[email protected]>
                        
https://lists.sourceforge.net/lists/listinfo/xsltforms-support




_______________________________________________
Xsltforms-support mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xsltforms-support

Reply via email to