4 Replies Latest reply on Apr 3, 2009 4:48 PM by freemarket

    extendedDataTable inside modalPanel gives JS error

    cprietom

      Hi,

      I'm facing problems when opening a rich:modalPanel that contains a rich:extendedDataTable. When it is opened from an a4j:commandLink that executes this code in the oncomplete event:

      Richfaces.showModalPanel('panelDoc');

      the following javascript error appears (I've used the 'firebug' extension of FF3 for locating the exact javascript error):

      this.selectionManager is undefined
      http://10.0.145.11:8080/Application1/a4j/g/3_3_0.GAorg/richfaces/renderkit/html/scripts/extended-data-table.js
      Line 24


      The modalPanel is as simple as this:

      <rich:modalPanel id="panelDoc" width="650" height="650">
       <f:facet name="header">
       <h:panelGroup>Doc</h:panelGroup>
       </f:facet>
       <f:facet name="controls">
       <h:panelGroup>
       <h:graphicImage value="/img/break.gif" style="cursor: pointer;">
       <rich:componentControl for="panelDoc" operation="hide" event="onclick"/>
       </h:graphicImage>
       </h:panelGroup>
       </f:facet>
       <rich:extendedDataTable value="#{p7.fields}" var="field1">
       <rich:column>#{field1.label}</rich:column>
       </rich:extendedDataTable>
       </rich:modalPanel>


      I've made some tests for stretching the problem even more, althogh the javascript error clearly indicates that the problem is in the extended-data-table:
      1. If I place the extendedDataTable outside the modalPanel it renders fine without javascript errors,
      2. If I substitute the rich:extendedDataTable for a rich:scrollableDataTable the modalPanel renders fine without javascript errors.

      Has anyone experienced this problem? Any suggestions for solving it?

      Thanks in advance.

        • 1. Re: extendedDataTable inside modalPanel gives JS error
          nbelaevski

          Hello,

          Works fine for me:

          <rich:modalPanel id="panelDoc" width="650" height="650">
           <f:facet name="header">
           <h:panelGroup>Doc</h:panelGroup>
           </f:facet>
           <f:facet name="controls">
           <h:panelGroup>
           <h:graphicImage value="/img/break.gif" style="cursor: pointer;">
           <rich:componentControl for="panelDoc" operation="hide" event="onclick"/>
           </h:graphicImage>
           </h:panelGroup>
           </f:facet>
           <rich:extendedDataTable value="#{forum5Bean.data}" var="field1">
           <rich:column>#{field1}</rich:column>
           </rich:extendedDataTable>
           </rich:modalPanel>
          
          
          <h:form>
          
          <a4j:commandLink value="open panel" oncomplete="Richfaces.showModalPanel('panelDoc');"/>
          </h:form>


          Try to surrond rich:extendedDataTable with form.

          • 2. Re: extendedDataTable inside modalPanel gives JS error
            cprietom

            Thanks for your hint nbelaevski.

            You're right, I simplified the code of my application too much when pasting it in this forum and what I paste works fine. What fails is the the fact of reRendering the extendedDatatable after showing the modalPanel. This is the code that fails and generates the JS error of my first post:

             <rich:modalPanel id="panelDoc" width="650" height="650">
             <f:facet name="header">
             <h:panelGroup>Doc</h:panelGroup>
             </f:facet>
             <f:facet name="controls">
             <h:panelGroup>
             <h:graphicImage value="/img/break.gif" style="cursor: pointer;">
             <rich:componentControl for="panelDoc" operation="hide" event="onclick"/>
             </h:graphicImage>
             </h:panelGroup>
             </f:facet>
             <rich:extendedDataTable id="extData" value="#{p7.fields}" var="field1">
             <rich:column>#{field1.label}</rich:column>
             </rich:extendedDataTable>
             </rich:modalPanel>
            
            <a4j:commandLink value="open panel" action="#{someAction.method()}" reRender="extData" oncomplete="Richfaces.showModalPanel('panelDoc');">


            I need to invoke the action in the link prior to opening the modalPanel because that action is the one that fills everything in the "p7" object the extendedDataTable reads from. And I need to reRender extData after invoking the action for the extendedDataTable to be updated.

            Any ideas of how to solve it? Could I manage the same effect of updating the extendedDataTable of the modalPanel in a different way? Could it be a bug in the "extended-data-table.js" of Richfaces-3.3.0.GA?

            Thanks (again) in advance.

            • 3. Re: extendedDataTable inside modalPanel gives JS error
              nbelaevski

              Hi,

              Thank you for submitting the issue! I've filed this as: https://jira.jboss.org/jira/browse/RF-6439

              • 4. Re: extendedDataTable inside modalPanel gives JS error
                freemarket

                 

                "nbelaevski" wrote:
                Hi,

                I too have voted for this as this prevents me from using the extendeddatatable within a modalpanel context.

                Henry


                Thank you for submitting the issue! I've filed this as: https://jira.jboss.org/jira/browse/RF-6439