1 2 Previous Next 21 Replies Latest reply on Aug 18, 2009 6:42 AM by sam-user

    Error evaluate oncomplete function undefined on modalPanel

    sam-user

      Hello,

      I have a modalPanel that I invoke by clicking on an a4j:commandButton that itself is positioned withing a rich:tab.
      It all works fine until I switch to another tab and then back to this one. Once I do that the modalPanel is not rendered anymore.
      I had a look at the log messages and notices this one:

      Error evaluate oncomplete function undefined


      One other detail - my modalPanel is shown via the oncomplete event of the commandbutton.

      Any ideas what might be causing this?
      Thanks

        • 1. Re: Error evaluate oncomplete function undefined on modalPan
          ilya_shaikovsky

          show the code.

          • 2. Re: Error evaluate oncomplete function undefined on modalPan
            sam-user

            Hello,
            Apologies for the late replay, but here it is:

            This is the excerpt from the main tabPanel :

            <rich:tabPanel switchType="ajax" ">
            
             <rich:tab label="Tab1" id="tab1" >
             <ui:include src="/Tab1.xhtml" />
             </rich:tab>
            
             <rich:tab label="Notes">
             <ui:include src="/Notes.xhtml" />
             </rich:tab>
            
             <!-- more tabs -->
            </rich:tabPanel>




            and here is the Notes.xhtml

            <ui:composition xmlns="http://www.w3.org/1999/xhtml"
             xmlns:s="http://jboss.com/products/seam/taglib"
             xmlns:ui="http://java.sun.com/jsf/facelets"
             xmlns:f="http://java.sun.com/jsf/core"
             xmlns:h="http://java.sun.com/jsf/html"
             xmlns:a="http://richfaces.org/a4j"
             xmlns:rich="http://richfaces.org/rich">
             <h:form styleClass="association" id="notesChildren">
             <h:outputText value="There are no notes associated with this object."
             rendered="#{empty objectHome.notes}"/>
            
             <rich:datascroller for="notesTable" maxPages="5"/>
             <a:commandButton id="addNote" value="Add"
             action="#{objectHome.preRemove}"
             oncomplete="Richfaces.showModalPanel('addNote');" />
             <rich:spacer height="10" />
             <rich:dataTable value="#{objectHome.notes}"
             var="_note" rows="5"
             rowClasses="rvgRowOne,rvgRowTwo"
             id="notesTable">
            
             <rich:column sortBy="#{_note.noteDate}" sortOrder="DESCENDING" >
             <f:facet name="header">Date</f:facet>
             <h:outputText value="#{_note.noteDate}" >
             <f:convertDateTime pattern="dd/MM/yyyy HH:mm:ss" />
             </h:outputText>
             </rich:column>
             <rich:column sortBy="#{_note.userId}">
             <f:facet name="header">User</f:facet>
             <h:outputText value="#{_note.userId}"/>
             </rich:column>
             <rich:column sortBy="#{_note.noteText}" >
             <f:facet name="header">Note</f:facet>
             <h:outputText value="#{_note.noteText}" />
             </rich:column>
             </rich:dataTable>
             </h:form>
             <f:subview 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:a="http://richfaces.org/a4j"
             xmlns:rich="http://richfaces.org/rich">
             <a:outputPanel id="notesPanel" layout="none">
            
             <rich:modalPanel id="addNote" width="800" height="40
             <f:facet name="header">
             <h:panelGroup>
             <h:outputText value="Note"></h:outputText>
             </h:panelGroup>
             </f:facet>
             <f:facet name="controls">
             <h:panelGroup>
             <h:graphicImage value="img/close.png" styleClass="hidelink" id="hidelink"/>
             <rich:componentControl for="addNote" attachTo="hidelink" operation="hide" event="onclick"/>
             </h:panelGroup>
             </f:facet>
             <ui:include src="/AddNote.xhtml" />
             </rich:modalPanel>
            
             </a:outputPanel>
             </f:subview>
            </ui:composition>



            The button that opens the modal panel is in bold.
            Thank you for your help.

            • 3. Re: Error evaluate oncomplete function undefined on modalPan
              sam-user

              Hello,
              anyone any ideas?

              • 4. Re: Error evaluate oncomplete function undefined on modalPan
                sam-user

                Hello,

                Can anyone help with this?
                Thanks

                • 5. Re: Error evaluate oncomplete function undefined on modalPan
                  ilya_shaikovsky

                  there was such issues in previous versions. Check latest please.

                  • 6. Re: Error evaluate oncomplete function undefined on modalPan
                    sam-user

                    Hello,

                    I'm afraid moving to RF 3.3.1 did not make much of a difference. It behaves in exactly the same way as with the previous version I used ( 3.2.2)

                    Here's some debug info ( it'd be nice to be able to attach these as a file, as it makes the post too long)

                    When I select the Note tab for the first time I can successfully open the modalPanel and add a note.
                    Then I select another tab and then select the Note tab again. Below is the debug info from that last action

                    
                    debug[11:05:31,211]: Have Event [object Object] with properties: target: undefined, srcElement: [object], type: click
                    debug[11:05:31,211]: Query preparation for form 'notesChildren' requested
                    debug[11:05:31,211]: Append hidden control notesChildren with value [notesChildren] and value attribute [notesChildren]
                    debug[11:05:31,226]: Append hidden control javax.faces.ViewState with value [j_id5] and value attribute [j_id5]
                    debug[11:05:31,226]: parameter notesChildren:addNote with value notesChildren:addNote
                    debug[11:05:31,226]: Look up queue with default name
                    debug[11:05:31,226]: NEW AJAX REQUEST !!! with form: notesChildren
                    debug[11:05:31,226]: Start XmlHttpRequest
                    debug[11:05:31,226]: Reqest state : 1
                    debug[11:05:31,226]: QueryString: AJAXREQUEST=_viewRoot&notesChildren=notesChildren&javax.faces.ViewState=j_id5&notesChildren%3AaddNote=notesChildren%3AaddNote&
                    debug[11:05:32,186]: Reqest state : 2
                    debug[11:05:32,186]: Reqest state : 3
                    debug[11:05:32,186]: Reqest state : 4
                    debug[11:05:32,186]: Reqest end with state 4
                    debug[11:05:32,186]: Response with content-type: text/xml;charset=UTF-8
                    debug[11:05:32,186]: Full response content: <?xml version="1.0"?>
                    <html xmlns="http://www.w3.org/1999/xhtml"><head><link class="component" href="/ABC/a4j/s/3_3_1.GAorg/richfaces/renderkit/html/css/basic_classes.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__" rel="stylesheet" type="text/css" /><link class="component" href="/ABC/a4j/s/3_3_1.GAorg/richfaces/renderkit/html/css/extended_classes.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__" media="rich-extended-skinning" rel="stylesheet" type="text/css" /><link class="component" href="/ABC/a4j/s/3_3_1.GAcss/toolBar.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__" rel="stylesheet" type="text/css" /><script src="/ABC/a4j/g/3_3_1.GAorg.ajax4jsf.javascript.PrototypeScript" type="text/javascript">
                    </script><script src="/ABC/a4j/g/3_3_1.GAorg.ajax4jsf.javascript.AjaxScript" type="text/javascript">
                    </script><script src="/ABC/a4j/g/3_3_1.GAscripts/menu.js" type="text/javascript">
                    </script><link class="component" href="/ABC/a4j/s/3_3_1.GAcss/dropdownmenu.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__" rel="stylesheet" type="text/css" /><script src="/ABC/a4j/g/3_3_1.GAorg/richfaces/renderkit/html/scripts/utils.js" type="text/javascript">
                    </script><script src="/ABC/a4j/g/3_3_1.GAorg/ajax4jsf/javascript/scripts/form.js" type="text/javascript">
                    </script><script src="/ABC/a4j/g/3_3_1.GAorg/richfaces/renderkit/html/scripts/form.js" type="text/javascript">
                    </script><script src="/ABC/a4j/g/3_3_1.GAorg/richfaces/renderkit/html/scripts/menu.js" type="text/javascript">
                    </script><link class="component" href="/ABC/a4j/s/3_3_1.GAcss/menucomponents.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__" rel="stylesheet" type="text/css" /><link class="component" href="/ABC/a4j/s/3_3_1.GAcss/panel.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__" rel="stylesheet" type="text/css" /><script src="/ABC/a4j/g/3_3_1.GAorg/richfaces/renderkit/html/scripts/events.js" type="text/javascript">
                    </script><script src="/ABC/a4j/g/3_3_1.GAorg/richfaces/renderkit/html/scripts/json/json-dom.js" type="text/javascript">
                    </script><script src="/ABC/a4j/g/3_3_1.GAorg/richfaces/renderkit/html/scripts/scriptaculous/effects.js" type="text/javascript">
                    </script><script src="/ABC/a4j/g/3_3_1.GAorg/richfaces/renderkit/html/scripts/jquery/jquery.js" type="text/javascript">
                    </script><script src="/ABC/a4j/g/3_3_1.GAorg/richfaces/renderkit/html/scripts/JQuerySpinBtn.js" type="text/javascript">
                    </script><script src="/ABC/a4j/g/3_3_1.GAorg/richfaces/renderkit/html/scripts/calendar.js" type="text/javascript">
                    </script><link class="component" href="/ABC/a4j/s/3_3_1.GAorg/richfaces/renderkit/html/css/calendar.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__" rel="stylesheet" type="text/css" /><script src="/ABC/a4j/g/3_3_1.GAorg.ajax4jsf.javascript.ImageCacheScript" type="text/javascript">
                    </script><script src="/ABC/a4j/g/3_3_1.GAorg/richfaces/renderkit/html/scripts/browser_info.js" type="text/javascript">
                    </script><script src="/ABC/a4j/g/3_3_1.GAscripts/tabPanel.js" type="text/javascript">
                    </script><link class="component" href="/ABC/a4j/s/3_3_1.GAcss/tabPanel.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__" rel="stylesheet" type="text/css" /><script src="/ABC/a4j/g/3_3_1.GAorg/richfaces/renderkit/html/scripts/datascroller.js" type="text/javascript">
                    </script><link class="component" href="/ABC/a4j/s/3_3_1.GAcss/datascroller.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__" rel="stylesheet" type="text/css" /><link class="component" href="/ABC/a4j/s/3_3_1.GAcss/table.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__" rel="stylesheet" type="text/css" /><script src="/ABC/a4j/g/3_3_1.GAorg/richfaces/renderkit/html/scripts/modalPanel.js" type="text/javascript">
                    </script><script src="/ABC/a4j/g/3_3_1.GAorg/richfaces/renderkit/html/scripts/modalPanelBorders.js" type="text/javascript">
                    </script><link class="component" href="/ABC/a4j/s/3_3_1.GAorg/richfaces/renderkit/html/css/modalPanel.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__" rel="stylesheet" type="text/css" /><script src="/ABC/a4j/g/3_3_1.GAorg/richfaces/renderkit/html/scripts/available.js" type="text/javascript">
                    </script><script src="/ABC/a4j/g/3_3_1.GAorg/richfaces/renderkit/html/script/controlUtils.js" type="text/javascript">
                    </script><script src="/ABC/a4j/g/3_3_1.GAorg/richfaces/renderkit/html/scripts/skinning.js" type="text/javascript">
                    </script><link class="user" href="/ABC/a4j/g/3_3_1.GAstylesheet/mpss.css" rel="stylesheet" type="text/css" /><link class="user" href="/ABC/stylesheet/theme.css" rel="stylesheet" type="text/css" /><meta name="Ajax-Update-Ids" content="" /><title></title></head><body><span id="ajax-view-state"><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="j_id5" /></span><meta id="Ajax-Response" name="Ajax-Response" content="true" /><span id="org.ajax4jsf.oncomplete">Richfaces.showModalPanel('addNote');</span></body></html>
                    debug[11:05:32,201]: Header Ajax-Expired not found, search in <meta>
                    debug[11:05:32,201]: search for elements by name 'meta' in element #document
                    debug[11:05:32,201]: Find <meta name='Ajax-Update-Ids' content=''>
                    debug[11:05:32,201]: Find <meta name='Ajax-Response' content='true'>
                    debug[11:05:32,201]: Header Ajax-Update-Ids not found, search in <meta>
                    debug[11:05:32,201]: search for elements by name 'meta' in element #document
                    debug[11:05:32,201]: Find <meta name='Ajax-Update-Ids' content=''>
                    warn[11:05:32,201]: No information in response about elements to replace
                    debug[11:05:32,201]: call selectSingleNode for id= org.ajax4jsf.oncomplete
                    debug[11:05:32,201]: Call request oncomplete function after processing updates
                    debug[11:05:32,201]: call selectSingleNode for id= ajax-view-state
                    debug[11:05:32,201]: Hidden JSF state fields:
                    debug[11:05:32,201]: Namespace for hidden view-state input fields is undefined
                    debug[11:05:32,217]: search for elements by name 'input' in element span
                    debug[11:05:32,217]: Replace value for inputs: 48 by new values: 1
                    debug[11:05:32,217]: Input in response: javax.faces.ViewState
                    debug[11:05:32,217]: Found same input on page with type: hidden
                    debug[11:05:32,217]: Found same input on page with type: hidden
                    debug[11:05:32,217]: Found same input on page with type: hidden
                    debug[11:05:32,217]: Found same input on page with type: hidden
                    debug[11:05:32,217]: Found same input on page with type: hidden
                    debug[11:05:32,232]: Found same input on page with type: hidden
                    debug[11:05:32,232]: Found same input on page with type: hidden
                    debug[11:05:32,232]: Found same input on page with type: hidden
                    debug[11:05:32,232]: search for elements by name 'INPUT' in element span
                    debug[11:05:32,232]: Replace value for inputs: 48 by new values: 0
                    debug[11:05:32,232]: call selectSingleNode for id= _A4J.AJAX.focus
                    debug[11:05:32,232]: No focus information in response
                    debug[11:05:32,248]: call selectSingleNode for id= _ajax:data
                    error[11:05:32,248]: Error evaluate oncomplete function undefined
                    



                    I don't understand if I'm doing anything wrong or there's a problem with the RF controls?
                    Thanks for your help.

                    • 7. Re: Error evaluate oncomplete function undefined on modalPan
                      ilya_shaikovsky

                      try please #{rich:component('addNote')}.show();

                      • 8. Re: Error evaluate oncomplete function undefined on modalPan
                        sam-user

                        That, I'm afraid, made it wors. The modalPanel is not being rendered at all. I get

                        Error evaluate oncomplete function undefined
                        the first time I click the Add button

                        • 9. Re: Error evaluate oncomplete function undefined on modalPan
                          sam-user

                          What is the diferenece between :

                          #{rich:component('addNote')}.show()


                          and

                          Richfaces.showModalPanel('addNote');



                          anyway?

                          • 10. Re: Error evaluate oncomplete function undefined on modalPan
                            ilya_shaikovsky

                            #{rich:component} is just our new function (since 3.3.0) to be used in order to call api on any component.

                            here is sample where modal invoked at oncomplete
                            http://livedemo.exadel.com/richfaces-demo/richfaces/dataTable.jsf?tab=editDataTable&cid=2882160

                            • 11. Re: Error evaluate oncomplete function undefined on modalPan
                              sam-user

                              I see.
                              But in my case it didn't work even the first time I tried to open the modalPanel. I just got the same exception: Error evaluate oncomplete function undefined.

                              Could this be related to the fact that the modal panel is included in a tab control - in the example it isn't?

                              • 12. Re: Error evaluate oncomplete function undefined on modalPan
                                sam-user

                                Hello,
                                any chance for help with this issue?
                                Thanks

                                • 13. Re: Error evaluate oncomplete function undefined on modalPan
                                  nbelaevski

                                  Does simple oncomplete="alert(1)" work?

                                  • 14. Re: Error evaluate oncomplete function undefined on modalPan
                                    sam-user

                                    Yes, it does.

                                    1 2 Previous Next