1 Reply Latest reply on Feb 22, 2008 3:36 AM by Henady Zakalusky

    ContextMenu problems

    Henady Zakalusky Newbie

      1. There is ff2 exception NS_ERROR_XPC_JS_THREW_STRING with ContextMenu ( richfaces 3.1.4 ). It appears when mouse cursor goes from the contextmenu to the textarea element. The situation may be fixed like similar ToolTip bug. This code works normally, please check:

      RichFaces.Menu.isWithin = function (event, element) {
       var within = false;
       Event.extend(event);
       var targetElement = event.relatedTarget;
       var srcElement = Event.element(event);
      
       try { // FF fix
       if (targetElement && targetElement.className=="anonymous-div")
       return false;
       } catch (e) {
       return false;
       }
      
       if (targetElement) {
       within = targetElement == element ||
       $(targetElement).descendantOf(element);
       }
      
       return within;
      };
      


      2. ContextMenu does not work with myfaces 1.1.5. I temporary fixed that by code
       evalScripts: function() {
       return this.extractScripts().map(function(script) {
       /* richfaces RF-1794 bug fix */
       return eval( script.replace(/^<!--\n/,'') );
       });
       },
      


      3. Richfaces 3.2.0 snapshot including last build from the SVN repository does not work with OC4J 101330 / myfaces 1.1.5 / facelets 1.1.2. There is facelets error: facelets asks to fill every attribute in richfaces components on the page.

      4. Generated javascript code for context menu is toooo big: aproximately 1 KB per item. Do you plan to optimize context menu in next builds?