0 Replies Latest reply on Mar 26, 2012 11:09 AM by Dale Ellis

    rich:datatable stops rendering correctly

    Dale Ellis Newbie

      Hi All,


      I have a data table which displays some search results on the first screen. For this table I have implemented a data Model which calls a web service to get its data. Now when I'm on this page, The data scroller works as expected, the calls to the web service are as expected, same is the case for sorting.


      However the issue is when I leave the page and then click a link that returns me to this page, the table does not render correctly (used to work before I Implemented a data model and just cached all results), the table renders but it has lost the style it had and the datascroller no longer renders as buttons but text all squashed together and javascript error is thrown.


      Uncaught TypeError: undefined is not a function


      The error seems to be caused by this line...


      <script type="text/javascript">

      new RichFaces.ui.DataScroller("caseSearchResultsForm:caseResults:j_idt352",function(event,element,data){RichFaces.ajax("caseSearchResultsForm:caseResults:j_idt352",event,{"parameters":{"caseSearchResultsForm:caseResults:j_idt352:page":data.page} ,"incId":"1"} )},{"digitals":{} ,"buttons":{} ,"currentPage":1} )



      Comparing the HTML when it's fine and when it's erroring the difference appears to be that javascript and stylesheets for the table is no longer loaded..


      <script type="text/javascript" src="/PAM2/javax.faces.resource/datatable.js.jsf?ln=org.richfaces"></script>

      <link type="text/css" rel="stylesheet" href="/PAM2/rfRes/datatable.ecss.jsf?db=eAH7fupXLwAIvwNJ&amp;ln=org.richfaces" />

      <script type="text/javascript" src="/PAM2/javax.faces.resource/datascroller.js.jsf?ln=org.richfaces"></script>

      <link type="text/css" rel="stylesheet" href="/PAM2/rfRes/datascroller.ecss.jsf?db=eAH7fupXLwAIvwNJ&amp;ln=org.richfaces" />


      What could cause these to no longer load? I never used to have this issue so I'm pretty certain is to do with my data model but I see no errors in the logs and everything seems to get called as expected. I have attached my dataModel, I assume it has got to be something to do with that but can't figure it out.


      Any help great appreciated, could post table code and other, not sure what would be need but I'm hoping someone will know what it takes for the dataTable javascript to not load and that should hopefully point me in the right direction to solve this.


      As a workaround at the moment, I'm including the scripts in my page template which seems to be ok but id like to understand what is going on...


              <script type="text/javascript" src="javax.faces.resource/jsf.js.jsf?ln=javax.faces"></script>

              <script type="text/javascript" src="javax.faces.resource/jquery.js.jsf"></script>

              <script type="text/javascript" src="javax.faces.resource/richfaces.js.jsf"></script>

              <script type="text/javascript" src="javax.faces.resource/richfaces-base-component.js.jsf"></script>

              <script type="text/javascript" src="javax.faces.resource/richfaces-event.js.jsf"></script>



              <script type="text/javascript" src="javax.faces.resource/datatable.js.jsf?ln=org.richfaces"></script>

              <script type="text/javascript" src="javax.faces.resource/datascroller.js.jsf?ln=org.richfaces"></script>