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

Initialization JavaScript needs help when order counts


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


      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.




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


              • Created: