jsf-extensions
  1. jsf-extensions
  2. JSF_EXTENSIONS-71

Regression: jMaki Widgets not correctly re-added when DOM update happens elsewhere in the page.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Blocker Blocker
    • Resolution: Incomplete
    • Affects Version/s: current
    • Fix Version/s: milestone 1
    • Component/s: www
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: Sun

    • Issuezilla Id:
      71

      Description

      Here's the problem.

      Greg, now in jmaki.js you have:

      /**

      • Load a widget
      • @param widget Object representing widget to load
        */
        this.loadWidget = function(_jmw) {
        // see if the widget has been defined.
        if (_jmaki.attributes.get(_jmw.uuid) != null) { return; }

        var targetName ="jmaki.widgets." + _jmw.name + ".Widget";
        var con = this.findObject(targetName);
        if (typeof con != "function")

        { logError("Could not find widget constructor for: " + targetName + ". Please make sure the widget constructor is properly defined.", document.getElementById(_jmw.uuid)); }

        var wimpl;

      When I do DOM replacement of the table in which the scriptaculous
      inplace editor widget instances reside, I'm ok as long as the _jmw.uuid
      hasn't been encountered before. The moment I try to load one that has
      already been encountered, problems result.

      This is new jMaki behavior. This is not a problem on the DynaFaces side.

      Ed

        Activity

        Hide
        Ed Burns added a comment -

        >>>>> On Tue, 17 Apr 2007 18:41:34 -0700, Gregory Murray
        <Gregory.Murray@Sun.COM> said:

        GM> Hi Ed,
        GM> We have an API just for this kind of thing:

        GM> See the jMaki clear widgets?

        GM> jmaki.clearWidgets(DOM_NODE);

        GM> jMaki will find all jMaki created widgets under the DOM node:

        GM> 1. jMaki will call the destroy function on the widget. A destroy
        GM> function is not required but if present will remove any listeners and
        GM> make sure data is synced up.
        GM> 2. The widget will be div will be removed from the document.
        GM> 3. The widget will be removed from the jmaki.attributes map.

        GM> If you can call this before re-injecting new widgets your problem
        GM> should go away. I think this is the best approach because it give the
        GM> widgets the opportunity to de-register events as well. This API has
        GM> been around for a few releases and is what the injector uses.

        GM> Let me know if this will work, otherwise we will figure out another
        GM> solution.

        GM> -Greg

        Show
        Ed Burns added a comment - >>>>> On Tue, 17 Apr 2007 18:41:34 -0700, Gregory Murray <Gregory.Murray@Sun.COM> said: GM> Hi Ed, GM> We have an API just for this kind of thing: GM> See the jMaki clear widgets? GM> jmaki.clearWidgets(DOM_NODE); GM> jMaki will find all jMaki created widgets under the DOM node: GM> 1. jMaki will call the destroy function on the widget. A destroy GM> function is not required but if present will remove any listeners and GM> make sure data is synced up. GM> 2. The widget will be div will be removed from the document. GM> 3. The widget will be removed from the jmaki.attributes map. GM> If you can call this before re-injecting new widgets your problem GM> should go away. I think this is the best approach because it give the GM> widgets the opportunity to de-register events as well. This API has GM> been around for a few releases and is what the injector uses. GM> Let me know if this will work, otherwise we will figure out another GM> solution. GM> -Greg
        Hide
        Ed Burns added a comment -

        Mark as invalid because clearWidgets() was being called.

        Show
        Ed Burns added a comment - Mark as invalid because clearWidgets() was being called.

          People

          • Assignee:
            Ed Burns
            Reporter:
            Ed Burns
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: