Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-4883

Clients.submitForm does not submit form

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 9.5.1.2
    • Fix Version/s: None
    • Component/s: ZK Client Engine
    • Labels:
    • Environment:

      Java 14

      Spring Boot 2.4.5

      ZKSpringBoot 2.3.0

      ZK 9.5.1.2

      Description

      Steps to Reproduce

      Create a form and submit it using Clients.submitForm().

      Example :

      ZUL :

       

      <button label="Submit" onClick="@command('submitForm',form=myForm)"/>
      <h:form id="myForm" name="myForm" action="" method="post" xmlns:h="http://www.w3.org/1999/xhtml"/>

       

      ViewModel :

      @Command
      public void submitForm(@BindingParam("form") Form form) {
          try {
              form.setDynamicProperty("action", "https://anyurl");
              final String xmlContent = '<any xml content>';
              final Input inputXml = new Input();
              inputXml.setParent(form);
              inputXml.setDynamicProperty("type", "hidden");
              inputXml.setDynamicProperty("name", "xmlContent");
              inputXml.setValue(xmlContent);
              final Input inputEncoding = new Input();
              inputEncoding.setParent(form);
              inputEncoding.setDynamicProperty("type", "hidden");
              inputEncoding.setDynamicProperty("name", "encoding");
              inputEncoding.setValue("utf-8");
              log.info("before submit");
              Clients.submitForm(form);
              log.info("after submit");
          } catch (JAXBException e) {
              logger.error("problem to submit form");
              e.printStackTrace();
          }
      }

      Current Result

      Nothing happens, no error/exception.

      It works with previous versions of ZK but not with 9.5.1.2.

      Expected Result

      Expected form to be submitted using ZK 9.5.1.2.

      Debug Information

      Example above displays :

       

      > before submit
      > after submit
      

       

      But form is not submitted.

      Workaround

      Downgrade to ZK version 9.5.1.1

        Attachments

        1. 9.5.1.2.png
          9.5.1.2.png
          173 kB
        2. error_zk_submit_form.png
          error_zk_submit_form.png
          106 kB
        3. image-2021-04-29-14-11-34-866.png
          image-2021-04-29-14-11-34-866.png
          60 kB
        4. image-2021-05-06-11-05-31-480.png
          image-2021-05-06-11-05-31-480.png
          95 kB
        5. test-ZK-4883.zip
          4 kB

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            YannUnil YannUnil
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: