3 Replies Latest reply on Feb 8, 2010 8:15 AM by jsf geeks

    iframe not working properly with richfaces

    jsf geeks Master

      hello,

      In my project i am using iframe to display html file and object tag for flash file.but sometimes buttons not working when iframe is rendered.

      any idea?

      my code is like below

      <a4j:loadScript id="scrpt1"      src="js/content_rate.js"/>
                      <a4j:loadScript id="scrpt2"   src="js/quiz_marks.js"/> in head section

       

        <a4j:outputPanel ajaxRendered="true" id="Pnl_contentviewmain" style="font-size: 10px; left: 10px; top: 50px; position: absolute">
                          <rich:toolBar  style="left:0px;top:0px;position:absolute;width:966px" id="tlbrbtns_top" height="34" width="966px"  itemSeparator="line">
                              <rich:toolBarGroup>
                                  <a4j:commandButton  ajaxSingle="true" limitToList="true" reRender="pnl_contentmain" action="#{content_view.btn_text_action}" binding="#{content_view.btn_text}"  id="btn_text" style="; font-weight: bold; height: 23px; width: 75px" value="#{cntentview['topicview.Text']}"/>
                              </rich:toolBarGroup>
                              <rich:toolBarGroup>
                                  <a4j:commandButton ajaxSingle="true" limitToList="true" reRender="pnl_contentmain" action="#{content_view.btn_video_action}" binding="#{content_view.btn_video}" id="btn_video" style="; font-weight: bold; height: 23px; width: 75px" value="#{cntentview['topicview.Video']}"/>
                              </rich:toolBarGroup>
                              <rich:toolBarGroup>
                                  <a4j:commandButton ajaxSingle="true" limitToList="true"  reRender="pnl_contentmain" action="#{content_view.btn_simulation_action}" binding="#{content_view.btn_simulation}" id="btn_simulation" style="; font-weight: bold; height: 23px; width: 90px" value="#{cntentview['topicview.Simulation']}"/>
                              </rich:toolBarGroup>
                              <rich:toolBarGroup>
                                  <a4j:commandButton ajaxSingle="true" limitToList="true" oncomplete="licopened();" reRender="pnl_contentmain"  action="#{content_view.btn_quiz_action}" binding="#{content_view.btn_quiz}" id="btn_quiz"
                                                     style=" font-weight: bold; height: 23px; width: 75px" value="#{cntentview['topicview.Quiz']}"/>
                              </rich:toolBarGroup>
                              <rich:toolBarGroup>
                                  <a4j:commandButton ajaxSingle="true" limitToList="true"  reRender="pnl_contentmain" action="#{content_view.btn_notes_action}" binding="#{content_view.btn_notes}" id="btn_notes"
                                                     style="font-weight: bold; height: 23px; width: 70px" value="#{cntentview['topicview.note']}"/>
                              </rich:toolBarGroup>
                              <rich:toolBarGroup>
                                  <a4j:commandButton ajaxSingle="true" limitToList="true"  reRender="pnl_contentmain"  action="#{content_view.btn_links_action}" binding="#{content_view.btn_links}" id="btn_links"
                                                     style="; font-weight: bold; height: 23px; width: 75px" value="#{cntentview['topicview.Links']}"/>

       

                              </rich:toolBarGroup> <rich:toolBarGroup>
                                  <a4j:commandButton ajaxSingle="true" limitToList="true" reRender="pnl_contentmain"  action="#{content_view.btn_keywords_action}" binding="#{content_view.btn_keywords}" id="btn_keywords"
                                                     style="; font-weight: bold; height: 23px; width: 85px" value="#{cntentview['topicview.keywords']}"/>
                              </rich:toolBarGroup>
                              <rich:toolBarGroup rendered="false">
                                  <a4j:commandButton ajaxSingle="true" limitToList="true" reRender="pnl_contentmain"  action="#{content_view.btn_mindmap_action}" binding="#{content_view.btn_mindmap}" id="btn_mindmap"
                                                     style="; font-weight: bold; height: 23px; width: 70px" value="#{cntentview['topicview.mindmap']}"/>
                              </rich:toolBarGroup>
                              <rich:toolBarGroup rendered="false">
                                  <a4j:commandButton ajaxSingle="true" limitToList="true" reRender="pnl_contentmain"  action="#{content_view.btn_image_action}" binding="#{content_view.btn_image}" id="btn_image"
                                                     style="; font-weight: bold; height: 23px; width: 45px" value="#{cntentview['topicview.image']}"/>
                              </rich:toolBarGroup>

       

                              <rich:toolBarGroup>
                                  <a4j:commandButton ajaxSingle="true" limitToList="true" reRender="pnl_contentmain"  action="#{content_view.btn_quiz_evaluation_action}" binding="#{content_view.btn_quiz_evaluation}"
                                                     id="btn_quiz_evaluation" style="; font-weight: bold; height: 23px; width: 95px" value="#{cntentview['topicview.evaluation']}"/>
                              </rich:toolBarGroup> <rich:toolBarGroup>
                                  <a4j:commandButton  reRender="pnl_contentmain"  ajaxSingle="true" limitToList="true" ignoreDupResponses="true" action="#{content_view.btn_back_to_view_action}" binding="#{content_view.btn_back_to_view}" id="btn_back_to_view"
                                                     style=" font-weight: bold; height: 23px; width: 145px" value="#{cntentview['topicview.backtotopic']}"/>
                                  <h:outputText value="#{content_view.simulation_path}"/>
                              </rich:toolBarGroup>
                          </rich:toolBar>
                      </a4j:outputPanel>
                      <h:panelGroup binding="#{content_view.pnl_contentmain}" id="pnl_contentmain" style=" color: rgb(0, 0, 153); height: 545px; left: 10px; top: 85px; position: absolute; width: 965px">

       

                          <c:if test="${content_view.two_panel==true}">
                               <h:panelGroup  id="split_panel2" style=" width:485px ; height: 545px; left: 50%; top: 1px; position: absolute">

       

                                    <object codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"
                                          name="obj_quiz" hspace="0" vspace="0" width="480" height="540"
                                          align="middle" id="obj_quiz" type="application/x-shockwave-flash">
                                      <param name="allowFullScreen" value="true" />

       

       

       

                                      <c:if test="${sessionScope['content_type']=='021' || sessionScope['content_type'] =='1'}">
          <param name="src" value="${content_view.video_path}" />

       

                                      </c:if>
                                      <c:if test="${sessionScope['content_type']=='161'}">

       

                                       <param name="src" value="${content_view.shdknw_path}"/>
                                      </c:if>
                                      <c:if test="${sessionScope['content_type']=='171'}">

       

                                           <param name="src" value="${content_view.cldknw_path}"/>
                                      </c:if>

       

                                  </object>
                                   
                              </h:panelGroup>
                              <h:panelGroup id="split_panel1" style=" width: 480px; height:540px; left: 0px; top: 0px; position: absolute">
                                  <c:if test="${sessionScope['content_type']=='021'}">
                                      <iframe  id="iframe_text" frameborder="1" scrolling="auto"  marginheight="0px" marginwidth="0px" style="z-index:0" width="480px" height="540px" src="${content_view.text_path}"/>
                                  </c:if>
                                  <c:if test="${sessionScope['content_type']=='161'}">

       

                                      <h:selectOneListbox binding="#{content_view.listbox_shouldknow}" id="listbox_shouldknow"

       

                                                          onchange="common_timeoutSubmitForm(this.form, 'listbox_shouldknow');"

       

                                                          style="left:0px;top:0px;width: 480px; height: 540px; position: absolute;" valueChangeListener="#{content_view.listbox_shouldknow_processValueChange}">
                                          <f:selectItems value=" #{content_view.sholudknw_list_items}"/>
                                      </h:selectOneListbox>
                                  </c:if>
                                  <c:if test="${sessionScope['content_type']=='171'}">
                                      <h:selectOneListbox binding="#{content_view.listbox_couldknow}" id="listbox_couldknow"

       

                                                          onchange="common_timeoutSubmitForm(this.form, 'layout_couldknw_list:listbox_couldknow');"

       

                                                          style="left:0px;top:0px;width: 480px; height: 540px; position: absolute;" valueChangeListener="#{content_view.listbox_couldknow_processValueChange}">
                                          <f:selectItems value="#{content_view.coudknw_list_items}"/>
                                      </h:selectOneListbox>
                                  </c:if>
                                  <c:if test="${sessionScope['content_type']=='1'}">
                                      <h:inputTextarea binding="#{content_view.intxt_note}" cols="200" id="intxt_note" onclick="getCaretPositions(this,event);"
                                                       onkeydown="translate(event);" onkeypress="translate(event);" onkeyup="getCaretPositions(this,event);" style="height: 500px; left: 0px; top: 40px; position: absolute; width: 475px"/>

       

                                      <a4j:commandButton  process="form1:intxt_note,alert_notes,form1:intxt_note" reRender="alert_notes" action="#{content_view.notesaving_action}" binding="#{content_view.notesaving}" id="notesaving"
                                                          style=";font-weight:bold;width: 100px; left: 0px; top: 15px; position: absolute" value="#{cntentview['topicview.notesave']}"/>
                                      <h:panelGroup id="note_error"  style="width: 300px; left: 120px; top: -9px; position: absolute" >
                                          <rich:messages ajaxRendered="true" infoClass="info" errorClass="error" globalOnly="true" showSummary="true" binding="#{content_view.alert_notes}" id="alert_notes"/>
                                      </h:panelGroup>
                                  </c:if>
                              </h:panelGroup>
                                     
                                    
                          </c:if>

       

                          <c:if test="${content_view.two_panel==false}">
                            
                              <c:if test="${sessionScope['content_type']=='011' || sessionScope['content_type']=='041' || sessionScope['content_type']=='051' ||  sessionScope['content_type']=='141'}">
                                  <h:panelGroup id="pnl_cntnt_big" style=" width: 960px; height: 540px; left: 10px; top: 0px; position: absolute">

       

      <object codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"
                                          name="obj_quiz" hspace="0" vspace="0" width="960" height="540"
                                          align="middle" id="obj_quiz" type="application/x-shockwave-flash">
                                      <param name="allowFullScreen" value="true" />
                                          <c:if test="${ sessionScope['content_type']=='011'}">

       


                                              <param name="src" value="${content_view.video_path}"/>

       

                                          </c:if>
                                          <c:if test="${ sessionScope['content_type']=='051'}">

       

                                              <param name="src" value="${content_view.simulation_path}"/>
                                          </c:if>
                                          <c:if test="${ sessionScope['content_type']=='041'}">

       

                                              <param name="src" value="${content_view.quiz_path }"/>
                                          </c:if>
                                          <c:if test="${ sessionScope['content_type']=='141'}">

       

                                              <param name="src" value="${content_view.pretest_path}"/>
                                          </c:if>

       

       

       

                                      </object>
                                  </h:panelGroup>
                              </c:if>
                               <c:if test="${sessionScope['content_type']=='021' ||sessionScope['content_type']=='031' || sessionScope['content_type']=='091' || sessionScope['content_type']=='081'}">
                                  <c:if test="${sessionScope['content_type']=='031'}">
                                      <iframe id="iframe_links" frameborder="1" scrolling="auto" marginheight="0px" marginwidth="0px" style="z-index:0" width="960px" height="540px"  src="${content_view.links_path}"/>
                                  </c:if>
                                  <c:if test="${sessionScope['content_type']=='091'}">
                                      <iframe id="iframe_keywords" frameborder="1" scrolling="auto" marginheight="0px" marginwidth="0px" style="z-index:0" width="960px" height="540px"  src="${content_view.keywrds_path}"/>
                                  </c:if>
                                  <c:if test="${sessionScope['content_type']=='081'}">
                                      <iframe id="iframe_lessons" frameborder="1" scrolling="auto" marginheight="0px" marginwidth="0px" style="z-index:0" width="960px" height="540px"   src="${content_view.lsnpnl_path}"/>
                                  </c:if>
                              </c:if>
                          </c:if>
                      </h:panelGroup>

       

      it shows objext expected error when i click on button.