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

Incorrect EventListener documentation for intercepting Javascript functions

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 4.1.5
    • Fix Version/s: 4.1.6
    • Component/s: Documentation
    • Labels:
      None
    • Environment:
      Any

      Description

      The documentation at http://tapestry.apache.org/tapestry4.1/ajax/eventlistener.html has an example for intercepting Javascript functions that uses both "targets" and "elements" arguments for the annotation, but the documentation for the annotation itself says you can only use either one or the other. Furthermore, it might make people better realize how much the annotation simplifies client/server communication and how endless the possibilities really are if you added something like this to the Javascript example:

      The required html/Javascript snippet:
      <div id="triggerable"></div>
      <script type="text/javascript">
      var triggerable = document.getElementById('triggerable');
      triggerable.trigger = function(params) {
        alert('calling server with answer ' + params.theAnswer);
      }
      </script>
      
      So, given a Javascript...
      @EventListener(events="trigger", elements="triggerable")
      public void onTriggered( BrowserEvent event ) {
      ...
      }
      

        Attachments

          Activity

            People

            • Assignee:
              mschu Marcus Schulte
              Reporter:
              kaosko Kalle Korhonen
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: