[Infusion-users] Trying to use Pager pageStrategy

Kevin Wilkinson UCI kwilkins at uci.edu
Thu Jan 21 00:41:45 UTC 2010


I have a successful data driven pager component working in my code.  It has
been stable for a couple of months now.  Today when I tried to add the
pageStrategy option to the PageList to look cleaner, the pager fails to
finish rendering properly with this error.

headlumps is undefined
findChild()                   fluidRenderer.js (line 1062)
renderRecurse()         fluidRenderer.js (line 1124)
renderTemplates()     fluidRenderer.js (line 1254)
reRender()                  fluidRenderer.js (line 1371)
(?)()                             Pager.js (line 173)
fire()                           Fluid.js (line 608)
fireModelChange()    Pager.js (line 459)
(?)()                             Pager.js (line 686)
fire()                           Fluid.js (line 608)
pagerImpl()                Pager.js (line 735)
pager()                       Pager.js (line 54)
(?)()                            render...veTab=7 (line 381)
success()                    jquery....min.js (line 29)
handleError()             jquery....min.js (line 28)
 return headlumps === null ? null : headlumps[0];    fluidRenderer.js (line
1062)

Can you point me to a problem that I've caused somehow?  I only added in one
line of code, and in firebug the error appears to be caused when the pager
is created with the pagerOptions element.

Original code was:

    var ajaxPath = "<c:url value="/ajax"/>";
    $.post(ajaxPath, {
            action: "all",
            param: ""
          },
          function (data) {
              if(data.error) {
                window.alert(data.error);
              } else {
                orgs = data.model;
              }

               var pagerOptions = {
                       dataModel: orgs,
                       columnDefs: [
                         {key: "org", valuebinding: "*.org"},
                         {key: "category", valuebinding: "*.category"},
                         {key: "viewLink", valuebinding: "*.id",
                             components: {
                                 target:
"javascript:<portlet:namespace/>showOrg(${'${'}*.id});"
                              }
                         }
                       ],
                       bodyRenderer: {
                         type: "fluid.pager.selfRender",
                         options: {
                           selectors: {
                            root: "#<portlet:namespace/>body-template"
                        },
                           row: "row:"
                         }
                       },
                       pagerBar: {
                               type: "fluid.pager.pagerBar", options: {
                                 pageList: {
                                     type: "fluid.pager.renderedPageList",
                                       options: {
                                         linkBody: "a"
                                       }
                                 }
                            }
                       }
                   };

                   <portlet:namespace/>pager =
fluid.pager("#<portlet:namespace/>orgTable", pagerOptions);

          },
          "json"
    );

New code is now:

    var ajaxPath = "<c:url value="/ajax"/>";
    $.post(ajaxPath, {
            action: "all",
            param: ""
          },
          function (data) {
              if(data.error) {
                window.alert(data.error);
              } else {
                orgs = data.model;
              }

               var pagerOptions = {
                       dataModel: orgs,
                       columnDefs: [
                         {key: "org", valuebinding: "*.org"},
                         {key: "category", valuebinding: "*.category"},
                         {key: "viewLink", valuebinding: "*.id",
                             components: {
                                 target:
"javascript:<portlet:namespace/>showOrg(${'${'}*.id});"
                              }
                         }
                       ],
                       bodyRenderer: {
                         type: "fluid.pager.selfRender",
                         options: {
                           selectors: {
                            root: "#<portlet:namespace/>body-template"
                        },
                           row: "row:"
                         }
                       },
                       pagerBar: {
                               type: "fluid.pager.pagerBar", options: {
                                 pageList: {
                                     type: "fluid.pager.renderedPageList",
                                       options: {
                                         linkBody: "a",
                                         pageStrategy:
fluid.pager.gappedPageStrategy(4, 2)
                                       }
                                 }
                            }
                       }
                   };

                   <portlet:namespace/>pager =
fluid.pager("#<portlet:namespace/>orgTable", pagerOptions);

          },
          "json"
    );
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://fluidproject.org/pipermail/infusion-users/attachments/20100120/710d33a3/attachment.html>


More information about the Infusion-users mailing list