Uploaded image for project: 'Tapestry'
  1. Tapestry
  2. TAPESTRY-2251

ButtonLinkRenderer overwrites onclick event handler

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 4.1.5
    • 4.1.7
    • Contrib
    • None

    Description

      i've started using the buttonlinkrenderer and have noticed that a neat trick i use with direct link does not work with buttonlinkrenderer.

      to have the user confirm their action before submitting a request, i add an onclick event hander ie: onclick="return confirm('sure?');" this would be called before the actual direct link href was called, and returning false would cancel the request altogether.

      as buttonlinkrenderer utilises the onclick attribute of the button, this trick is not available with a buttonlinkrenderer.

      is it possible to have buttonlinkrenderer append to any existing onclick handler? so instead of:

      onclick="window.location='/.....'"

      can it render:

      onclick="myscript;window.location='/.....'" where myscript is my onclick hander.

      thx. paul.

      Attachments

        1. ButtonLinkRenderer2.java
          3 kB
          Paul Stanton

        Activity

          People

            andyhot Andreas Andreou
            paul.stanton Paul Stanton
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: