• DojoMenuRenderer

    By Mark Ambler 1 decade ago

    DojoMenuRenderer not rendering correctly and throwing off the rest of the xpage if the menu is at the top.  Seems there is an omitted comma when a custom styleClass or custom style have been applied to the menu.  It works fine when no custom style, styleClass has been applied.  There is a boolean value "hasp" that is marked as false that is used to append the comma to the script StringBuilder variable.  Below is the code fragment w/ my temp. fix applied, and the .css I'm using for the menu.

     

            if(component!=null) {
              // boolean hasp = false;
                String style = (String)component.getAttributes().get("style");// $NON-NLS-1$
                if(StringUtil.isNotEmpty(style)) {
                    script.append(',');
                  // if(hasp) script.append(","); else hasp=true;
                    script.append("style:");// $NON-NLS-1$
                    JavaScriptUtil.addString(script, style);
                }
                String styleClass = (String)component.getAttributes().get("styleClass");// $NON-NLS-1$
                if(StringUtil.isNotEmpty(styleClass)) {
                    script.append(',');
                  // if(hasp) script.append(","); else hasp=true;
                    JavaScriptUtil.addString(script, "class");//$NON-NLS-1$
                    script.append(":");// $NON-NLS-1$
                    JavaScriptUtil.addString(script, styleClass);
                }
            }

     

    css entry used in the app where the bug surfaced after upgrading to 9.0.1.

    /* Menus */
    .customStyle .dijitReset .dijitMenuItem {
        background: none repeat scroll 0 0 white;
    }

    .customStyle.dijitReset .dijitMenuItem .dijitMenuItemLabel {
        color: black;
    }

    .customStyle.dijitMenu .dijitReset .dijitMenuSeparator {
        background-color: white;
    }

    .customStyle.dijitMenu .dijitReset .dijitMenuSeparator .dijitMenuSeparatorTop
        {
        margin: 0px 0px 0px 0px;
        border-bottom: black 1px solid;
    }

    .customStyle.dijitMenu .dijitMenuItemSelected {
        background-color: #D8D8D8 !important;
    }

    .customStyle.dijitMenu .dijitMenuItemSelected .dijitMenuItemLabel {
        color: black !important;
    }

     

    • Thank Mark

      By Paul Hannan 1 decade ago

      Do you have a sample for this issue to investigate further?

      Regards,

      Paul.

       

      • markup from options menu

        By Mark Ambler 1 decade ago

        Hi Paul,

        Below is the XPage markup used in my options menu custom control.  Based on my eval of the source seems that hasp variable will never be set to true so the styles are ignored, and the client side javascript expression isn't properly terminated causing the entire page to fail.  It works fine in Domino 9.  Problem only surfaced when I upgraded my local dev to 9.0.1.  Let me know if you need any more info...

         

         



            
                
                    
                

                             style="padding-right:3.0px" height="16" width="16">
                

            

            styleClass="customStyle">
                
                                     image="/home-opt.png">
                             return "/main.xsp";

        }else{

            return "/main.xsp";
        }}]]>

                    

                                     image="/chat-opt.png"
                        rendered="#{javascript:!mobileUtils.isMobile();}">
                         var win=window.open(url, '_blank');
        win.focus();]]>

                    

                                     title="keyword admin" label="keyword admin"
                        image="/keywords-opt.png">
                        
                    

                                     title="workflow admin" label="workflow admin"
                        image="/workflow-opt.png">
                        
                    

                                     href="/emailadmin.xsp" title="email admin" label="email admin">
                        
                    


                                     title="logout" image="/logout-opt.png">
                    

                

                             refreshMode="complete" immediate="true">
                     if(action.equals("logout")){
        var webPath:String ="/" + database.getFilePath().replace("\\","/");
        facesContext.getExternalContext().getSession( false ).invalidate();
        facesContext.getExternalContext().getResponse().sendRedirect(webPath + "?logout&redirectto=" + webPath);
        }

        }]]>

                

            


         

      • reproduce the issue???

        By Mark Ambler 1 decade ago

        Hi Paul,

        Were you able to reproduce the issue?  Seems the bug is still there with the latest release (901v00_02.20131212-1115).

        • Yes,we're able to reproduce this now.

          By Paul Hannan 1 decade ago

          Bug logged with the core product - PHAN9EFE2E

    • Bug logged

      By Paul Hannan 1 decade ago

      Thanks Mark for the sample and sorry that you're hitting this issue which I've now been able to reproduce. This bug is a regression in 901 and we're tracking it with the following id "PHAN9EFE2E".

      Thanks again.

       

      • By Paul Hannan 1 decade ago

        This bug will be fixed in the coming release (Release 03) of the 9.0.1 ExtLib to OpenNTF.