2 Replies Latest reply on Dec 17, 2008 3:08 PM by joblini

    generated markup is quite verbose

    vladimir.kovalyuk

      rich:menuItem generates the following inline script:

      <script id="frmMenu:j_id9_menu_script" type="text/javascript">
      1new RichFaces.Menu.Layer('frmMenu:j_id9_menu',50,800).asDropDown('frmMenu:j_id9','frmMenu:j_id9_span','onmouseover','onmouseout',{'onitemselect':function(event){;return true;},'oncollapse':function(event){;return true;},'horizontalOffset':0,'verticalOffset':0,'direction':'auto','onexpand':function(event){;return true;},'ongroupactivate':function(event){;return true;},'disabled':false,'jointPoint':'auto'} ).addItem('frmMenu:j_id10',{'onmouseout':function(event){;return true;},'selectStyle':'','flagGroup':1,'selectClass':'','iconClass':'','closeOnClick':0,'disabled':false,'onmouseover':function(event){;return true;}} ).addItem('frmMenu:j_id14',{'selectStyle':'','flagGroup':0,'selectClass':'','iconClass':'','closeOnClick':1,'disabled':false} ).addItem('frmMenu:j_id15',{'selectStyle':'','flagGroup':0,'selectClass':'','iconClass':'','closeOnClick':1,'disabled':false} ).addItem('frmMenu:j_id16',{'selectStyle':'','flagGroup':0,'selectClass':'','iconClass':'','closeOnClick':1,'disabled':false} ).addItem('frmMenu:j_id17',{'selectStyle':'','flagGroup':0,'selectClass':'','iconClass':'','closeOnClick':1,'disabled':false} );
      </script>
      


      I believe that code should accept reasonable default values in order to make generated html cleaner and short. Some logic should be executed at page load event in a manner as jQuery is built. So if nothing special is applied to menuitems there should be zero script generated.

      The problem is in the fact that our generated menu is 200 kBytes. It takes additional 1 second to load via 2mb channel. It isn't acceptable and there isn't a reason for the overhead.