Wicket
  1. Wicket
  2. WICKET-546

SubmitLink issue : Need for handling user's own onclick javascript call + default && modification in onComponentTag call.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.2.4
    • Fix Version/s: 1.2.7
    • Component/s: wicket
    • Labels:
      None
    • Environment:
      Any OS

      Description

      Wicket version 1.2.4

      Note: The scenario explained below works perfectly well for a Link.

      Usage :

      I am using a submit Link in my form to perform a delete operation .
      I disable the link when there is nothing to delete
      [ I maintain a list for this ] and when the user checks some items to
      be deleted , i enable the link and add a onClick attribute to call a javascript
      confirmation box via a behavior. Finally i use AjaxRequestTarget.addComponent to render.

      Problem :

      Wicket complains that the delete link cannot be found even though i set
      markupid to true in all relevant places.

      So while debugging i figured out that onComponentTag of SubmitLink
      does not call super.onComponentTag . By introducing this call in the method,
      I could see the id value[markup id] in source code.

      HOWEVER this did not solve my problem fully because onClick did not
      call my Javascript function. So on examining the Ajax Debug window
      output, I could see 2 onclicks added for submitlink response.

      This issue needs to address the following 2 questions...

      1> why doesnt current onComponentTag call super.onComponetTag ?

      2> How do i ensure that my javascript call gets invoked before the submit operation?

      -Thanks
      swaroop belur

        Activity

        Hide
        Jean-Baptiste Quenot added a comment -

        For reference, is there a discussion on a mailing-list about this?

        Show
        Jean-Baptiste Quenot added a comment - For reference, is there a discussion on a mailing-list about this?
        Hide
        swaroop belur added a comment -

        AFAIK ,

        Eelco had made a comment - but was not sure how to go abt it...

        Reference : http://www.nabble.com/A-problem-with-using-SubmitLink-tf3684826.html#a10299671

        Show
        swaroop belur added a comment - AFAIK , Eelco had made a comment - but was not sure how to go abt it... Reference : http://www.nabble.com/A-problem-with-using-SubmitLink-tf3684826.html#a10299671
        Hide
        Eelco Hillenius added a comment -

        bulk set issues to next version. I only did a quick check (and filtered some out for 1.3.1), but we can always bump em again.

        Show
        Eelco Hillenius added a comment - bulk set issues to next version. I only did a quick check (and filtered some out for 1.3.1), but we can always bump em again.
        Hide
        Igor Vaynberg added a comment -

        1.3.0 does call super properly so the id will be output

        if you want your javascript executed before the submit it is pretty simple

        oncomponenttag(tag)

        { super.oncomponenttag(tag); string onclick=tag.get("onclick"); onclick="if (!confirm('msg')) return; "+onclick; tag.put("onclick", onclick); }
        Show
        Igor Vaynberg added a comment - 1.3.0 does call super properly so the id will be output if you want your javascript executed before the submit it is pretty simple oncomponenttag(tag) { super.oncomponenttag(tag); string onclick=tag.get("onclick"); onclick="if (!confirm('msg')) return; "+onclick; tag.put("onclick", onclick); }
        Hide
        Igor Vaynberg added a comment -

        added super.oncomponenttag call

        Show
        Igor Vaynberg added a comment - added super.oncomponenttag call

          People

          • Assignee:
            Igor Vaynberg
            Reporter:
            swaroop belur
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development