Tapestry 5
  1. Tapestry 5
  2. TAP5-774

Initialization JavaScript needs help when order counts

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.1.0.5
    • Fix Version/s: 5.2.0
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      Tapestry currently has no API to control in what order initialization JavaScript occurs; in fact, much of the initialization (when using RenderSupport.addInit()) will be in an arbitrary order (determined by Map key traversal, which is unpredictable).

      It would be nice if there was some control to ensure that certain initializations occurred before or after others.

      A canonical example is a mixin that adds a confirmation dialog to a link; that event handler for the dialog must come FIRST before any other event handlers for the click event of the link. Since Prototype doesn't seem to provide a way to establish that ordering, Tapestry needs to.

      RenderSupport.addInit() needs new overrides (or perhaps a new method, addScheduledInit()) where a prioritization is added; the priority is a number; all initializations for a particular priority level occur before initializations for a numerically higher level. The default priority should be some reasonable number (0, 100, 1000 ... but fixed) to make it easier to say "before" or "after" ... much as the CSS z-order property is used.

        Activity

        Hide
        Howard M. Lewis Ship added a comment -

        This has shown up as the new JavascriptSupport environmental service.

        Show
        Howard M. Lewis Ship added a comment - This has shown up as the new JavascriptSupport environmental service.

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Howard M. Lewis Ship
          • Votes:
            5 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development