4 Replies Latest reply on Feb 10, 2009 11:00 PM by thomas.m

    "Error evaluate oncomplete function undefined"

    thomas.m

      Hello,

      I've got a page with a tabPanel. Each tab shows a dataTable, and for each row of the dataTable, several action buttons are available.

      It is the SAME CODE for both tabs, only a small property (archived) value is changed between the two tabs.

      Here is my dataTable code (shared for both tabs):

      <rich:dataTable id="#{tableId}" value="#{eventConsult.eventsDataTable.rowsDataModel}" var="event">
      
      [...]
      <rich:column id="richcolumn_6">
      [...]
      <a4j:commandButton image="..." title="..." actionListener="#{eventConsult.showInfos}" reRender="eventDrawingLotDetailPanel_10" oncomplete="#{rich:component('eventDrawingLotDetailPanel_10')}.show()" />
      
      <a4j:commandButton image="..." title="..." action="#{eventConsult.showExport}" reRender="eventExportPanel" oncomplete="#{rich:component('eventExportPanel')}.show()" />
      
      
      </rich:column>
      


      each commandButton first re-render a hidden modal panel content (with current row data) and then show it.

      The tricky thing is it is working on the first tab, but for the second tab, the exact same code does nothing.

      Well in fact it call the action method, and in a4j log I see that the request is done, but at the end of a4j log I get : "Error evaluate oncomplete function undefined"...

      Could someone explain this ?



        • 1. Re:
          nbelaevski

          Hello,

          Please check whether id='eventExportPanel' component exists in view and is rendered to the client.

          • 2. Re:
            thomas.m

            Yes it is, I see it in the HTML output. And I see the panel being refreshed as I put breakpoints in the panel getters... Only the oncomplete part with the panel being shown is not working.

            • 3. Re:
              thomas.m

              I did a quick test and replaced oncomplete="#{rich:component('eventExportPanel')}.show() with oncomplete="alert('toto'); and it works...

              Maybe it's the rich:component part that does not work well ?

              • 4. Re:
                thomas.m

                I found the solution to this problem.
                For those who are interested I replaced this code :

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


                or

                #{rich:component('eventDrawingLotDetailPanel_10')}.hide()
                


                by this one

                Richfaces.showModalPanel('eventDrawingLotDetailPanel_10');
                


                or

                Richfaces.hideModalPanel('eventDrawingLotDetailPanel_10');
                


                on dataTable buttons and it works. I still don't know why the previous implementation did not work, since it worked on one of the two tabs...

                Maybe this should be investigated.