4 Replies Latest reply on May 24, 2010 2:41 AM by ilya_shaikovsky

    trouble with modalpanel in ie7 and ie8

    ajanz

      we use richfaces 3.3.2, and got trouble with several modalpanels. sometimes they don't appear.

       

      this is a very critical error for us. if someone could help it would be very nice.

       

      i  found on a website to don't use rerender for the whole modalpanel, as we do. could this be our problem?

       

      code to show the modalpanel is

       

       

      <a4j:commandButton value="Upload" oncomplete="Richfaces.showModalPanel('upload')" onmouseover="this.style.backgroundColor='#FFFF99'" onmouseout="this.style.backgroundColor=''" action="#{WorkflowPage.cleardocnrversion}" limitToList="true" ajaxSingle="true" process="upload" reRender="upload" >

       

       

      and modalpanel is

       

      <?xml version="1.0" encoding="ISO-8859-1"?>
      <ui:composition  xmlns="http://www.w3.org/1999/xhtml"
                       xmlns:ui="http://java.sun.com/jsf/facelets"
                       xmlns:h="http://java.sun.com/jsf/html"
                       xmlns:f="http://java.sun.com/jsf/core"
                       xmlns:rich="http://richfaces.org/rich"
                       xmlns:a4j="http://richfaces.org/a4j"
                       xmlns:s="http://jboss.com/products/seam/taglib">
      <rich:modalPanel id="upload"   height="300"   width="460"  left="30px"   overlapEmbedObjects="true"  zindex="333" rendered="true"   style="overflow:visible">
        <f:facet name="header">
         <h:panelGroup>
          <h:outputText value="Upload"></h:outputText>
         </h:panelGroup>
       
        </f:facet>
          <a4j:form id="uploadform"  style="z-index:333">
               <a4j:queue requestDelay="0" sizeExceededBehavior="dropNew" ignoreDupResponses="true"
          size="50" id="eventQueue" name="eventQueue"/>
         
          <a4j:outputPanel ajaxRendered="true" style="z-index:333">   
          <h:messages id="uploaderror"  styleClass="message"  style="color:red;" />
          </a4j:outputPanel>
             <rich:fileUpload    immediateUpload="true"  addControlLabel="Hinzufügen" maxFilesQuantity="1"    progressLabel="Datei wird übertragen" doneLabel="Datei übertragen" clearControlLabel="Löschen"   clearAllControlLabel="Löschen"  uploadControlLabel="Übertragen"   fileUploadListener="#{Page.listener}" style="z-index:433"  cancelEntryControlLabel="Abbrechen"  listWidth="430px" listHeight="60px"  >
               <a4j:support event="onuploadcomplete"  eventsQueue="eventQueue" action="#{Page.enablesavedoc}"  reRender="btnokupload,docframe" ajaxSingle="true" limitToList="true" ></a4j:support>
             </rich:fileUpload>

        <rich:spacer height="5px"/>
          <rich:separator />
       
             <a4j:commandButton id="btnokupload" value="Speichern" disabled="#{Page.savedok}"  onmouseover="this.style.backgroundColor='#FFFF99'" onmouseout="this.style.backgroundColor=''"
          oncomplete="if ( document.getElementById('uploadform:uploaderror') ==null ) Richfaces.hideModalPanel('upload'); else this.disabled=false;"  
            styleClass="rich-button" action="#{Page.savedok}" reRender="uploadform
            style="width:90px;float:left;margin-left:2px"
            onclick="this.disabled=true"  >
            <rich:toolTip>Speichert das Dokument und schließt den Dialog</rich:toolTip>
         </a4j:commandButton>
             <a4j:commandButton id="btncancelupload" value="Abbrechen" immediate="true"  onmouseover="this.style.backgroundColor='#FFFF99'" onmouseout="this.style.backgroundColor=''"
             onclick="Richfaces.hideModalPanel('upload')" styleClass="rich-button" reRender="upload,docframe" action="#{Page.clearnewmasterdoc}"
            style="width:90px;float:right;margin-right:2px">
            <rich:toolTip direction="bottom-left" >Schließt den Dialog</rich:toolTip>
         </a4j:commandButton>
         </a4j:form>
      </rich:modalPanel>
      </ui:composition>

        • 1. Re: trouble with modalpanel in ie7 and ie8
          ajanz

          here's the a4j:log

           

          there is an error! don't know why

           

          debug[11:30:52,872]: Script evaluation succeeded
          debug[11:30:52,882]: Evaluate script replaced area in document: new ModalPanel('upload', { width: 460, height: 300, minWidth: -1, minHeight: -1, resizeable: true, moveable: true, left: "30px", top: "auto", zindex: 333,onresize: '',onmove: '',onshow: '',onhide: '',onbeforeshow: '',onbeforehide: '', domElementAttachment: "", keepVisualState: false, showWhenRendered: false, selectBehavior: "disable", autosized: false, overlapEmbedObjects: true});
          debug[11:30:52,918]: Script evaluation succeeded
          debug[11:30:52,928]: Evaluate script replaced area in document:
          error[11:30:52,946]: . Error message: Ungültiges Argument.
          debug[11:30:52,955]: call selectSingleNode for id= org.ajax4jsf.oncomplete
          debug[11:30:52,966]: Call request oncomplete function after processing updates
          debug[11:30:52,980]: call selectSingleNode for id= _ajax:data
          • 2. Re: trouble with modalpanel in ie7 and ie8
            ilya_shaikovsky

            Yes, it could be caused by reRender="upload" so please try to add outputPanel inside the modal panel and reRender it instead of whole panel.

            • 3. Re: trouble with modalpanel in ie7 and ie8
              ajanz

              hups...ahem...the sensitive reader knows i got problem with modalpanel...

               

              we even use it like that, to dynamically show modalpanels

               

               

              <a4j:outputPanel id="dlginclude" ajaxRendered="true">

               

              <ui:include src="#{Page.dialogSerializer().dialogURL}" />

               

              </a4j:outputPanel>

               

               

              where dialogURL is a whole modalpanel. so this is no good idea?

               

              instead

               

              <rich:modalPanel...

               

              <a4j:outputPanel>

              <a4j:include view="#{Page.dialogSerializer().dialogURL}" />

              </a4j:outputPanel>

              </rich:modalPanel>

               

               

              would be a good idea?

              • 4. Re: trouble with modalpanel in ie7 and ie8
                ilya_shaikovsky

                both ways should be fine. In first case you updating not the modal panel directly but it's parent. But you should be very carefull with using ajaxRendered=true around panel - that could cause it unexpectedly updated and closed from any ajax controls inside.