7 Replies Latest reply on Feb 12, 2008 5:54 AM by Dongyao Zhao

    Modalpanel position upper left corner after a non ajax reque

    Jonas Buechel Novice

      This is not a 3.1.4.GA issue.

      I'm using a modal panel for displaying faces messages. If there is a faces message present, the modal panel containing the message has to be shown.

      This works fine (the modal panel is displayed in the center of the screen) as long as the request is an ajax one.

      But if there is a "normal " request or a redirect, the center of the modal panel is displayed at the top left corner of the view port...
      The problem consists only in firefox! In ie7 it's displayed correctly disregard issue http://jira.jboss.com/jira/browse/RF-2143.

      Modal panel:

      <rich:modalPanel id="#{dialogHtmlId}" rendered="#{! empty facesContext.maximumSeverity}" autosized="true" width="#{fwcWidth}"
       showWhenRendered="true">...
      


      Button:
      <h:commandButton value="#{messages['controls_save']}" action="#{filetreeFileAction.acceptCreate}" />
      


      Action which adds the faces message:
      public void acceptCreate() {
      
       FileTreeFile filetreeFile = ((FileTreeFile) createdTreeLeaf);
      
       // This is needed for making sure the filename doesn't contain the
       // pathname.
       // Needed for internet explorer.
       filetreeFile.setName(FilenameUtils.getName(filetreeFile.getName()));
      
       if (filetreeFile.getFile() == null || filetreeFile.getFile().length == 0)
       FacesMessages.instance().addFromResourceBundle(FacesMessage.SEVERITY_WARN,
       "com.frox.fwc.validator.noFileUploaded");
       else
       mutableTreeLeafAction.acceptCreate();
       }
      


      How can i work around this easily? Any help would be very appreciate.



        • 1. Re: Modalpanel position upper left corner after a non ajax r
          Nick Belaevski Master

          The only workaround for now is to open modal panel on window.onload

          • 2. Re: Modalpanel position upper left corner after a non ajax r
            Jonas Buechel Novice

            Thanks for your reply, Nick!

            Will there be a fix for this in future releases? Or is it a firefox "issue"?

            • 3. Re: Modalpanel position upper left corner after a non ajax r
              Dongyao Zhao Novice

              i habe the same problem with contextMenu with version 3.2-snapshot, the position is false, upper left corner. but with version 3.1.3 it works well.

              • 4. Re: Modalpanel position upper left corner after a non ajax r
                Ilya Shaikovsky Master

                show please the code for context menu..

                • 5. Re: Modalpanel position upper left corner after a non ajax r
                  Dongyao Zhao Novice

                  the code of the context menu:

                  <rich:treeNode id="TreeNav_TreeNode2" type="DeviceNode" iconLeaf="#{item.iconPath}"
                   icon="#{item.iconPath}" selectedClass="UnvisibleBox" >
                  
                   <a4j:commandLink value="" reRender="panelbar,Main_TabPanel2"
                   actionListener="#{ctrl.deviceSelected}">
                   <f:param name="devicePhysName" value="#{item.dataItem.physName}" />
                   <h:outputText id="DeviceName" value="#{item.name}"/>
                   </a4j:commandLink>
                   <rich:contextMenu id="contextMenuId" event="oncontextmenu" attached="true" submitMode="none" >
                  
                   <rich:menuItem id="properties" value="Show Property" submitMode="ajax"
                   reRender="detailsMp,modalContent,common_modalpanel,panelbar,Main_TabPanel2"
                   actionListener="#{ctrl.deviceSelected}"
                   oncomplete="Richfaces.showModalPanel('detailsMp')" >
                   <f:param name="devicePhysName" value="#{item.dataItem.physName}" />
                   </rich:menuItem>
                  
                   <rich:menuItem value="Show Connections" id="connectionItem" submitMode="ajax"
                   reRender="detailsConnection,ConnectionContent"
                   actionListener="#{ctrl.deviceSelected}"
                   oncomplete="Richfaces.showModalPanel('detailsConnection')" >
                   <f:param name="devicePhysName" value="#{item.dataItem.physName}" />
                   </rich:menuItem>
                  
                   </rich:contextMenu>
                   </rich:treeNode>
                  


                  • 6. Re: Modalpanel position upper left corner after a non ajax r
                    Jonas Buechel Novice

                     

                    The only workaround for now is to open modal panel on window.onload


                    Nick, can i use the <rich:componentControl> somehow for this?



                    • 7. Re: Modalpanel position upper left corner after a non ajax r
                      Dongyao Zhao Novice

                      the above code of contextMenu works again with version: 3.2.0-SNAPSHOT.
                      new problem:
                      There are 4 nodes in tree, the contextMenu is connected with every node, but only by right mouse click on the first node, the contextmenu shows, no reaction with others nodes. but the following code works well with version:3.1.3

                      <rich:treeNode id="TreeNav_TreeNode2" type="DeviceNode" iconLeaf="#{item.iconPath}"
                       icon="#{item.iconPath}" selectedClass="UnvisibleBox" >
                      
                       <a4j:commandLink value="" reRender="panelbar,Main_TabPanel2"
                       actionListener="#{ctrl.deviceSelected}">
                       <f:param name="devicePhysName" value="#{item.dataItem.physName}" />
                       <h:outputText id="DeviceName" value="#{item.name}"/>
                       </a4j:commandLink>
                       <rich:contextMenu id="contextMenuId" event="oncontextmenu" attached="true" submitMode="none" >
                      
                       <rich:menuItem id="properties" value="Show Property" submitMode="ajax"
                       reRender="detailsMp,modalContent,common_modalpanel,panelbar,Main_TabPanel2"
                       actionListener="#{ctrl.deviceSelected}"
                       oncomplete="Richfaces.showModalPanel('detailsMp')" >
                       <f:param name="devicePhysName" value="#{item.dataItem.physName}" />
                       </rich:menuItem>
                      
                       <rich:menuItem value="Show Connections" id="connectionItem" submitMode="ajax"
                       reRender="detailsConnection,ConnectionContent"
                       actionListener="#{ctrl.deviceSelected}"
                       oncomplete="Richfaces.showModalPanel('detailsConnection')" >
                       <f:param name="devicePhysName" value="#{item.dataItem.physName}" />
                       </rich:menuItem>
                      
                       </rich:contextMenu>
                       </rich:treeNode>