7 Replies Latest reply on Jul 11, 2011 9:44 AM by Phil Wilson

    Rich faces:dataGrid,datascroller with JavaScript causes error

    Phil Wilson Newbie

      Hi Guys,

       

      I have an issue with the datascroller and JavaScript within a dataGrid.

       

      It works correctly the first time it loads the page. When I hit the next page or arrow for next it get an error.

       

       

      <rich:dataGrid id="linksData" value="#{linksList.linksList}"

                      border="0"  width="860" var="linksData" columns="1" elements="4" >

       

                    <f:facet name="header">

                      <rich:datascroller

                              renderIfSinglePage="false"

                              onclick="jQuery.blockUI();"  

                              oncomplete="jQuery.unblockUI();">

                     </rich:datascroller>

                  </f:facet>

       

      <rich:panel id="memberGridLinks"   style="padding: 1px 1px 1px 1px; " >

         <rich:effect event="onclick"  type="Highlight" params="duration:1.0" />

         <rich:effect event="onclick"  for="memberGridLinks"  type="Appear" params="delay:0.1,duration:0.9" />

       

       

      <table   align="center"  border="0"  width="860" cellpadding="1" cellspacing="1">

       

      --- this row causing the error..but works the first time the page loads.

       

      <td>

      <div class="thumb2"  style="border: thin solid black">

               <h:outputText value="<script type=\""/>

               <h:outputText value="text/javascript\">wsr_snapshot('"/>

               <h:outputText value="#{linksData.url}',"/>

               <h:outputText value="'keycodehere', 't')"/>        

               <h:outputText value=";</"/>       

               <h:outputText value="script>"/>         

      </div>    

      </td>

       

      above produces this in the page...

      <td>

      <div class="thumb2"  style="border: thin solid black">                                        

            <script type="text/javascript">wsr_snapshot('http://www.espn.com/','keycodehere', 't');</script>        

      </div>    

      </td>

       

      </table>

      </rich:panel>

      </rich:dataGrid>

       

       

      Thanks

      Phil