Tapestry 5
  1. Tapestry 5
  2. TAP5-711

Submit component: using image parameter prevents selected event from being fired

    Details

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

      Description

      When I change <t:submit...> to <t:submit t:image="..."..> onSelectedX() handlers stop working.

      1. TAP5-711-5.1.txt
        8 kB
        Ulrich Stärk
      2. TAP5-711.txt
        8 kB
        Ulrich Stärk
      3. VoteForm3.tml
        1 kB
        Sergey Didenko
      4. VoteForm3.java
        0.7 kB
        Sergey Didenko

        Activity

        Hide
        Sergey Didenko added a comment -

        Page class and template

        Show
        Sergey Didenko added a comment - Page class and template
        Hide
        Ulrich Stärk added a comment -

        the problem is this code:

        String value = request.getParameter(elementName);

        if (value == null) return;

        Runnable sendNotification = new Runnable()
        {
        public void run()

        { resources.triggerEvent(event, context, null); }

        };

        With an image submit there is no request parameter with the name of the element, instead there are 2 parameters, name.x and name.y indicating where the user clicked on the image. Thus request.getParameter(elementName) always returns null and the selected event is never fired.

        Show
        Ulrich Stärk added a comment - the problem is this code: String value = request.getParameter(elementName); if (value == null) return; Runnable sendNotification = new Runnable() { public void run() { resources.triggerEvent(event, context, null); } }; With an image submit there is no request parameter with the name of the element, instead there are 2 parameters, name.x and name.y indicating where the user clicked on the image. Thus request.getParameter(elementName) always returns null and the selected event is never fired.
        Hide
        Ulrich Stärk added a comment -

        Patch and test.

        Show
        Ulrich Stärk added a comment - Patch and test.
        Hide
        Igor Drobiazko added a comment -

        Patch review: I think an integration test is a better alternative than an unit test.

        Show
        Igor Drobiazko added a comment - Patch review: I think an integration test is a better alternative than an unit test.
        Hide
        Ulrich Stärk added a comment -

        now with integragtion test

        Show
        Ulrich Stärk added a comment - now with integragtion test
        Hide
        Sergey Didenko added a comment -

        Tested on IE6-8, Firefox 3.5.2, Opera 10, Safari 4.0 for Windows - it works.

        Though I still have TAP5-712 on IE, but that's a different bug.

        Show
        Sergey Didenko added a comment - Tested on IE6-8, Firefox 3.5.2, Opera 10, Safari 4.0 for Windows - it works. Though I still have TAP5-712 on IE, but that's a different bug.
        Hide
        Igor Drobiazko added a comment -

        Thanks for the patch.

        Show
        Igor Drobiazko added a comment - Thanks for the patch.
        Hide
        Ulrich Stärk added a comment -

        patch against 5.1 branch

        Show
        Ulrich Stärk added a comment - patch against 5.1 branch
        Hide
        Stephan Windmüller added a comment -

        It seems like there is a new problem with this component regarding event handlers. Disabled submit events (with javaScript return false) are queued and executed when a submit button with an image on the same page is selected.

        I know, it sounds confusing, I can submit a demo page if needed.

        Show
        Stephan Windmüller added a comment - It seems like there is a new problem with this component regarding event handlers. Disabled submit events (with javaScript return false) are queued and executed when a submit button with an image on the same page is selected. I know, it sounds confusing, I can submit a demo page if needed.

          People

          • Assignee:
            Igor Drobiazko
            Reporter:
            Sergey Didenko
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development