Tapestry
  1. Tapestry
  2. TAPESTRY-1240

LinkSubmit with parameters causes exception although it has validators attached

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.1, 4.1.1, 4.1.2
    • Fix Version/s: 4.1.2
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      last test was with Tapestry 4.1.2-20070121

      Description

      A LinkSubmit component causes an exception if the bound listener requires one or more parameters and
      the values of the parameters binding are null. This behavior is correct as long as the bound parameters
      don't come from a TextField with a "required" validator.

      Looking at the code below i would have expected that when the page is submitted, the TextField component
      gets validated before the LinkSubmit. If so Tapestry would report the validation error and not the exception.

      .page file
      <component id="lnk_read" type="LinkSubmit">
      <binding name="listener" value="listener:readGPList" />
      <binding name="parameters" value="searchFieldValue" />
      </component>

      <component id="txtSearchField" type="TextField">
      <binding name="value" value="searchFieldValue" />
      <binding name="validators" value="validators:required" />
      </component>

      <property name="searchFieldValue" />

      .java file
      public void readGPList(String txtSearchField) {}

      g,
      kris

        Activity

        Hide
        Jesse Kuhnert added a comment -

        I agree...Fixed up the listener invoker to be a lot more forgiving about parameters being null. Now as long as there is at least a matching method name the method will be invoked - even if most of the arguments are null.

        Show
        Jesse Kuhnert added a comment - I agree...Fixed up the listener invoker to be a lot more forgiving about parameters being null. Now as long as there is at least a matching method name the method will be invoked - even if most of the arguments are null.

          People

          • Assignee:
            Jesse Kuhnert
            Reporter:
            Kristian Marinkovic
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development