1 Reply Latest reply on Apr 3, 2008 12:35 PM by Steven Bell

    Can't get richfaces to work.  Javascript error.

    Steven Bell Newbie

      I cant seem to get richfaces to work properly. The problems I'm having all seem to be javascript related.

      In firebug I get an error when the page loads:

      Component returned failure code: 0x80004005 (NS_ERROR_FAILURE)[nsIChannel.open]

      I'm trying to get the scrollable data table and a modalPanel working right now.

      The scrollableDataTable doesn't sort. I click the header, the icon shows up but the row order stays the same. No javascript errors there.
      If I set the rows attribute it doesn't seem to track the rows properly, never shows the last row, and once you move off the first row it doesn't come back, just has a blank space for them. Also as you scroll down you always have a bit of a blank gap at the bottom.

      The modalPanel just won't display. The call the RichFaces.showModalPanel('id') results in a javascript error that the method doesn't exist.

      The page is pretty simple, and I can't seem to find any problems. The prebuilt war of the richfaces demo runs fine (I'm using Tomcat 6.0.14 by the way).

      I'll put some relevant snippets of code at the bottom, if more is needed to help just ask. Thanks in advance for any help I can get on this.

      modalPanel:
       </h:form>
       <rich:modalPanel id="gciSearchDialog">
       <f:facet name="header">
       <h:outputText value="Search for Service Providor" />
       </f:facet>
       <h:form id="gciSearchForm">
       <h:outputText value="Yahoo!" />
       </h:form>
       </rich:modalPanel>
       </ui:define>
      
      link to show modal:
       <a href="javascript:RichFaces.showModalPanel('gciSearchDialog');" id="searchLink">
       <h:graphicImage id="searchImage" value="images/magnifier.gif" />
       </a>
      
      scrollableTableData:
       <rich:scrollableDataTable rowKeyVar="payableRK" id="unpostedTable" sortMode="single"
       value="#{homeBean.unpostedPayables}" var="payable" height="200px">
       <rich:column id="referenceCol">
       <f:facet name="header"><h:outputText value="Reference" /></f:facet>
       <h:commandLink id="payableLink" action="#{homeBean.selectPayable}">
       <h:outputText value="#{payable.vendorDocRef}" />
       </h:commandLink>
       </rich:column>
      
       ...
      
       <rich:column id="statusCol">
       <f:facet name="header"><h:outputText value="Status" /></f:facet>
       <h:outputText value="#{payable.transaction.status}"
       converter="#{dataBean.payableStatusConverter}" />
       </rich:column>
       </rich:scrollableDataTable>
       </h:form>
      


        • 1. Re: Can't get richfaces to work.  Javascript error.
          Steven Bell Newbie

          I took out the RichFaces.showModalPanel call and changed it to

           <h:outputLink value="#" id="searchLink">
           <h:graphicImage id="searchImage" value="images/magnifier.gif" />
           <rich:componentControl for="gciSearchDialog" attachTo="searchLink" operation="show" event="onclick" />
           </h:outputLink>
          


          Now I get an error:
          this.markerId has no properties

          error seems to be coming from modalPanel.js

          It seems like the javascript 'engine' isn't getting initialized, but I can't figure out why. I dont' think I mentioned this earlier, but I'm using the 3.2 release of richfaces.