Uploaded image for project: 'MyFaces Tomahawk'
  1. MyFaces Tomahawk
  2. TOMAHAWK-1428

t:toggleLink onclick does not allow javascript than could prevent toggle

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.1.9
    • Toggle Components
    • None

    Description

      Just take a look at the example of toggleLink.jsf

      The link with this code:

      <t:toggleLink for="editNames" onclick="return confirm('do you really want to edit this stuff?')">

      renders on onclick:

      onclick="return confirm('do you really want to edit this stuff?');MyFacesToggleLinkUtils.toggle(......."

      and it should render this:

      onclick="var cf = function()

      {return confirm('do you really want to edit this stuff?')}

      ;var oamSF = function()

      {MyFacesToggleLinkUtils.toggle('_idJsp0:editNames','_idJsp0:_idJsp10','_idJsp0:_idJsp9_hidden','');}

      ;return (cf()==false)? false : oamSF();"

      This is very similar as h:commandLink does on jsf 1.2 and the idea is allow user to put a javascript to prevent toggling. This does not have any side effect and preserve old behavior.

      When promoting t:toggleLink, this code was deleted without notice it.

      Attachments

        Activity

          People

            lu4242 Leonardo Uribe
            lu4242 Leonardo Uribe
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: