[Infusion-users] Trying to use Pager pageStrategy

Antranig Basman antranig.basman at colorado.edu
Tue Jan 26 04:44:20 UTC 2010


Hi there Kevin - thanks for supplying these tests. Using these, I can 
see that the issue is that you have failed to supply a piece of markup 
matching the selector

             pageLinkSkip: ".flc-pager-pageLink-skip",
which is part of the pagerBar. This markup is only demanded by the 
gappedPageStrategy, and represents a piece of markup such as "..." to be 
used to signal that there is a gap in the listed page range. However 
this really highlights a bug in the framework, since we should have a 
much more readable summary of the error condition than we do. I have 
JIRAed it as
http://issues.fluidproject.org/browse/FLUID-3485
If you go ahead and give something like a <li 
class="flc-pager-pageLink-skip">...</li> in amongst the page links your 
example should now work with the gappedPageStrategy. Let us know how you 
get on,
Cheers,
Antranig.


On 25/01/2010 14:44, Kevin Wilkinson UCI wrote:
> We hosted the two different versions for you to see.  All the html code
> should be viewable to you through firebug or simply "view page source".
>
> Working version-->https://portal.uci.edu/static/test/orgs-working.html
> Broken version(with page strategy)-->
> https://portal.uci.edu/static/test/orgs.html
>
> One thing that we do do differently is changing the model/data and
> firing the pager against after it has rendered itself.  We weren't sure
> if this is a cause, but we are calling
> fireModelChange() again which is in the stack trace.  Anyway you can see
> it in our code.  Hope it helps and thanks again!
>
> On Sun, Jan 24, 2010 at 9:58 PM, Antranig Basman
> <antranig.basman at colorado.edu <mailto:antranig.basman at colorado.edu>> wrote:
>
>     Hi there Kevin - thanks for sending this along. I think the best
>     thing here is if you can prepare a ZIP file which can be run
>     self-contained to demonstrate the problem - since I can see you are
>     in a portalised environment this might not be completely
>     straightforward but on the other hand might just be as simple as
>     running "Save as HTML" in the browser once the view is running :)
>     There is clearly something a bit odd going on here and it would help
>     a lot to have a test case to refer to -
>     Cheers,
>     Antranig.
>
>
>     On 21/01/2010 16:03, Kevin Wilkinson UCI wrote:
>
>         Yes, I am following the "flc-pager-links" and "flc-pager-pageLink"
>         syntax properly I believe.  Here is code for my lower nav bar.
>
>         <ul class="flc-pager-bottom" style="margin: 0pt; padding: 0pt;">
>         <li style="display:none;">
>         <ul class="pager-links flc-pager-links" style="margin: 0pt;">
>         <li value="1" class="flc-pager-pageLink"><a
>             href="javascript:;">1</a></li>
>         <li value="2" class="flc-pager-pageLink"><a
>             href="javascript:;">2</a></li>
>         <li value="3" class="flc-pager-pageLink"><a
>             href="javascript:;">3</a></li>
>         </ul>
>         </li>
>         <li class="flc-pager-previous"><a href="javascript:;">«
>             previous</a></li>
>         <li class="flc-pager-next"><a href="javascript:;">next
>         »</a></li>
>         <span class="flc-pager-summary">1-10 of 500 organizations</span>
>         </ul>
>
>
>         Like I said, it was working fine before and still works fine if
>         I take
>         out the pageStrategy option.
>         o_O
>
>         -Kevin W
>
>
>         On Thu, Jan 21, 2010 at 10:09 AM, Antranig Basman
>         <antranig.basman at colorado.edu
>         <mailto:antranig.basman at colorado.edu>
>         <mailto:antranig.basman at colorado.edu
>         <mailto:antranig.basman at colorado.edu>>> wrote:
>
>             Hi there Kevin - on the face of it, hard to tell exactly what is
>             causing this problem. I tried adjusting one of our standard
>         samples
>             to include the fluid.pager.gappedPageStrategy(4, 2) option
>         which you
>             show and it doesn't show the problem you are reporting.
>         http://source.fluidproject.org/svn/fluid/infusion/trunk/src/webapp/integration-demos/sakai
>         "headlumps is undefined" usually indicates some problem in fetching
>             markup to form as the template - in this case the markup is
>         expected
>             to be the set of <li> tags inside the container holding the CSS
>             class "flc-pager-links". Can you check that this structure
>         is still
>             present in your markup?
>             The page link elements themselves should also continue to be
>             identified by the selectors defined at the pagerBar level, for
>             example with classes flc-pager-pageLink etc.
>
>             Cheers,
>             A.
>
>
>
>             On 20/01/2010 17:41, Kevin Wilkinson UCI wrote:
>
>                 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)
>                 [Break on this error] 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"
>                      );
>
>
>
>                 _______________________________________________
>                 Infusion-users mailing list
>         Infusion-users at fluidproject.org
>         <mailto:Infusion-users at fluidproject.org>
>         <mailto:Infusion-users at fluidproject.org
>         <mailto:Infusion-users at fluidproject.org>>
>
>         http://fluidproject.org/mailman/listinfo/infusion-users
>
>
>
>
>




More information about the Infusion-users mailing list