Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-801

Add Trigger component to trigger a component event during rendering

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.1.0.5
    • Fix Version/s: 5.2.0
    • Labels:
      None

      Description

      It would be nice if it were possible to trigger an arbitrary component event during rendering; this is often useful to add JavaScript to a page (via calls to the RenderSupport environmental).

      Currently this can be accomplished using Delegator and providing a Renderable object (as an anonymous inner class) ... but that's ugly, i.e.

      <t:delegate to="wireEventHandlers"/>

      public Renderable getWireEventHandlers()
      {
      return new Renderable()
      {
      public void render(MarkupWriter writer)

      { ... }

      };
      }

      I would rather something like:

      <t:triggerevent event="wireEventHandlers"/>

      void onWireEventHandlers()
      {
      ...
      }

      The MarkupWriter could be passed as the event context, for handlers that need to write markup as well as perform other functions.

        Attachments

          Activity

            People

            • Assignee:
              igor.drobiazko Igor Drobiazko
              Reporter:
              hlship Howard M. Lewis Ship
            • Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: