Tapestry 5
  1. Tapestry 5
  2. TAP5-832

Hidden input field fails with coercion problem on empty value (patch incl)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.2.0, 5.1.0.5
    • Fix Version/s: 5.3
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      If a hidden field has a blanc input "" , it fails with the following stackstrace (my Hidden component is just a copy of the orginal of 5.1.0.5)

      The reason is that there is no nullfieldstrategie assigned to a hidden field as opposed to text fields. The attached patch adds such a strategie.

      1. org.apache.tapestry5.internal.bindings.PropBinding.set(PropBinding.java:71)
      2. org.apache.tapestry5.internal.structure.InternalComponentResourcesImpl$1.write(InternalComponentResourcesImpl.java:540)
      3. de.laliluna.bibabook.components.Hidden._$update_parameter_value(Hidden.java)
      4. de.laliluna.bibabook.components.Hidden.processSubmission(Hidden.java:136)
      5. de.laliluna.bibabook.components.Hidden.access$000(Hidden.java:37)
      6. de.laliluna.bibabook.components.Hidden$ProcessSubmission.execute(Hidden.java:94)
      7. de.laliluna.bibabook.components.Hidden$ProcessSubmission.execute(Hidden.java:86)
      8. org.apache.tapestry5.corelib.components.Form.executeStoredActions(Form.java:480)
      9. org.apache.tapestry5.corelib.components.Form._$advised$onAction(Form.java:378)
      10. org.apache.tapestry5.corelib.components.Form$onAction$invocation_1237b3fe6bd.invokeAdvisedMethod(Form$onAction$invocation_1237b3fe6bd.java)
      11. org.apache.tapestry5.internal.services.AbstractComponentMethodInvocation.proceed(AbstractComponentMethodInvocation.java:71)
      12. org.apache.tapestry5.ioc.internal.services.LoggingAdvice.advise(LoggingAdvice.java:37)
      13. org.apache.tapestry5.internal.transform.LogWorker$1.advise(LogWorker.java:54)
      1. Hidden.patch
        3 kB
        Sebastian Hennebrueder

        Activity

        Hide
        Hudson added a comment -

        Integrated in tapestry-trunk-freestyle #469 (See https://builds.apache.org/job/tapestry-trunk-freestyle/469/)
        TAP5-832: Support a nulls parameter on Hidden to correctly handle null values sent to or received from the client inside the field

        hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1156744
        Files :

        • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Hidden.java
        Show
        Hudson added a comment - Integrated in tapestry-trunk-freestyle #469 (See https://builds.apache.org/job/tapestry-trunk-freestyle/469/ ) TAP5-832 : Support a nulls parameter on Hidden to correctly handle null values sent to or received from the client inside the field hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1156744 Files : /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Hidden.java
        Hide
        Sebastian Hennebrueder added a comment -

        I looked through the existing tests and I am not sure how to build the test in the most efficient manner.

        Shall I use a PageTester http://tapestry.apache.org/tapestry5/guide/unit-testing-pages.html or
        is there a simplere way to simulate a form submit?

        Show
        Sebastian Hennebrueder added a comment - I looked through the existing tests and I am not sure how to build the test in the most efficient manner. Shall I use a PageTester http://tapestry.apache.org/tapestry5/guide/unit-testing-pages.html or is there a simplere way to simulate a form submit?
        Hide
        Ulrich Stärk added a comment -

        could you please write a test that fails if the hidden component throws an exception on a blank value?

        Show
        Ulrich Stärk added a comment - could you please write a test that fails if the hidden component throws an exception on a blank value?
        Hide
        Sebastian Hennebrueder added a comment -

        patch to 5.2 trunk

        Show
        Sebastian Hennebrueder added a comment - patch to 5.2 trunk

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Sebastian Hennebrueder
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development