Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
7 replies Latest Post - ‏2012-11-16T17:36:47Z by HSSH_Sandip_Kulkarni
HSSH_Sandip_Kulkarni
13 Posts
ACCEPTED ANSWER

Pinned topic Split Pager More paging options

‏2012-11-15T16:35:35Z |
When using the split pager builder, we use the factory template "split_default_dropdown_base.html". Here we see multiple preset options for paging like Show 5, Show 10, Show 20, ...Show 100, Show All items"

I need to add an additional functional option something like "Show 250 items". How can this be achieved.

The data page is linked to a provider model whose results are retrieved page wise using pagedxmlretriver.
Updated on 2012-11-16T17:36:47Z at 2012-11-16T17:36:47Z by HSSH_Sandip_Kulkarni
  • mburati
    mburati
    352 Posts
    ACCEPTED ANSWER

    Re: Split Pager More paging options

    ‏2012-11-15T18:20:01Z  in response to HSSH_Sandip_Kulkarni
    You should be able to make a copy of that split pager bottom template into your own location under WebContent (outside of /factory/pages) and then update it with the additional HTML you need and specify that as the split pager bottom page template.

    Note though that even 100 is often too many rows to be showing in a web page, both in terms of browser scrollbar usability with large tables, and then scalability and performance. How many users might simultaneously be trying to pull that many rows down into their session memory? If a lot of them do, you could run into memory/scalability issues under load if you allow them to show 250 rows per page.

    I hope that info helps,
    ..Mike Burati
    http://www-10.lotus.com/ldd/pfwiki.nsf/
    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.
    • HSSH_Sandip_Kulkarni
      13 Posts
      ACCEPTED ANSWER

      Re: Split Pager More paging options

      ‏2012-11-16T02:06:16Z  in response to mburati
      While, I understand the memory/scalability; I still require it it as an option for the user.

      I had already tried adding additional html to the same factory split page to check if it works but somehow the link never became clickable. The "Show 250 items" appears in the paginaion bar dropdown option but when I click it nothing happens. It does not seem to do anything when I click it in the browser. The below line highlighted in bold is the html I had tried.

      Show 5 items
      Show 10 items
      Show 20 items
      Show 50 items
      Show 100 items
      Show 250 items

      Show all items
      • HSSH_Sandip_Kulkarni
        13 Posts
        ACCEPTED ANSWER

        Re: Split Pager More paging options

        ‏2012-11-16T02:08:59Z  in response to HSSH_Sandip_Kulkarni
        The html added for "Show 250 items" can be seen in the attachment.
        • mburati
          mburati
          352 Posts
          ACCEPTED ANSWER

          Re: Split Pager More paging options

          ‏2012-11-16T04:12:41Z  in response to HSSH_Sandip_Kulkarni
          I'm sorry I didn't realize this before, but it looks like that builder may be designed for the particular page sizes listed in the template files (the dropdown and link versions) and not an arbitrary page size number, probably to meet a specific UX requirement for split pagers across builders, since I've seen that UI pattern used elsewhere.

          I don't know this for certain, but here's an option you could try.
          All is almost never a good option to let users select as it could drag back the entire database table and swamp your server heap, so you might be able to leverage the All option (with a new "label" calling it 250) by trying to set the following property in your WEB-INF/config/override.properties file (you may need to redeploy after adding the property):
          bowstreet.SplitPager.MaxRows=250

          At a quick glance, it looks as though that builder implementation may limit you to the # rows specified by that property value, if it is set and if the user is allowed to and chooses the "All" option. Again, I do not know if this will definitely work or not, since I haven't tried it myself, but it looks like it's worth a try if you absolutely have to give the option of retrieving 250 rows (again, which is not recommended due to memory use). If you do this, please make sure the application owners / stakeholders and deployment support understand the risk and that this option could limit the scalability in terms of # of simultaneous users that can use the application for a given heap size.

          I hope that info helps,
          ..Mike Burati
          http://www-10.lotus.com/ldd/pfwiki.nsf/
          The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.
          • HSSH_Sandip_Kulkarni
            13 Posts
            ACCEPTED ANSWER

            Re: Split Pager More paging options

            ‏2012-11-16T09:36:15Z  in response to mburati
            Thank you Mike. The "bowstreet.SplitPager.MaxRows=250" helps return 250 records or any other high value desired(though not recommended) when we click "Show All items".

            1. Is there a way I could override that label "Show All" to "Show 250"

            2. Where do I find the entire list of properties like bowstreet.SplitPager.MaxRows. This property does not exist in bowstreet.properties.

            3. Is there a way to externalise override.properties. Idea to change the bowstreet.SplitPager.MaxRows property outside the deployed build war.
            • mburati
              mburati
              352 Posts
              ACCEPTED ANSWER

              Re: Split Pager More paging options

              ‏2012-11-16T15:58:00Z  in response to HSSH_Sandip_Kulkarni
              1) I don't see a documented / supported way of changing that label, as this trick of setting the property is a workaround for functionality that it didn't yet support in the first place.

              BUT, not everything you build with WEF is set in stone and you shouldn't feel trapped by what it generates for you. When a builder doesn't yet provide functionality you need, the next step is to look at the ways WEF can be customized or extended and figure out what might work best for you.

              Looking at how Split Pager works, it appears to be using a Text builder internally to place labels on the split pager elements from your base page, from the com.bowstreet.builders.webapp.usertext.messages resource bundle (using a Localized Resource builder to load that resource bundle). So, I can think of a couple of ways that you could possibly override what's being generated for you here, but both may have localization concerns: (a) you could look for the split pager resource bundle variable and overwrite the XML associated with what it has loaded (Use Windows -> Preferences -> Web Experience Factory to disable the "Show Hidden" objects checkbox, to see hidden variables in the webapp). (b) In your custom split pager base page, move the element for the label for showAll outside the menu and make it display:none so the automatically generated label will be hidden and then put your own label on the menu element for ShowAll. (Note, if your app needs to run in multiple languages, you would have to deal with that when you overwrite it with your custom label, such as using a Text builder associated with your new show250Label associated with your own LocalizedResource bundle). These are not necessarily recommendations as to how WEF supports customizing the label (which the doc doesn't appear to describe today) but rather ideas for how you can override and modify what WEF generates for you to do something that it doesn't yet support out of the box. I have not tried either of these ideas myself, they're just thoughts on how one could override what this particular builder supports out of the box. You would obviously need to test any overrides you make to ensure that they work for your application and its use case.

              2) That property does not currently appear to be documented. It was likely added to give someone a way to limit the # rows returned for "All" for large databases, to avoid memory issues. Since it didn't allow you to change the label easily, it probably wasn't documented at that time, to avoid confusion. I'll ask that this property be added to the Split Pager doc, since it does seem like a good way to avoid pulling back too much from the database if a user accidentally selects Show All (which I think I'll also ask for a better way to disable Show All going forward).

              3) Not that I know of. WEF Runtime typically expects to find its properties files under WEB-INF/config of the deployed WAR.

              I hope that info helps,
              ..Mike Burati
              http://www-10.lotus.com/ldd/pfwiki.nsf/
              The postings on this site are my own thoughts and do not necessarily represent the positions, strategies, recommendations or opinions of IBM.
              • HSSH_Sandip_Kulkarni
                13 Posts
                ACCEPTED ANSWER

                Re: Split Pager More paging options

                ‏2012-11-16T17:36:47Z  in response to mburati
                Thank you again so much.

                The way you have described the split pager customization is highly appreciable. While I may not do that right away, it does help me think over stuff and how can they be customized.

                Also just for your information - when we do show All in default conditions, it does not bring back all records from the DB. Somehow, it resets to page size of 5. In my case, the select query in the stored procedure in SQL call builder (service provider approach) can return 200k records. We have used pagedxmlretriver for our task. So there is some built-in check from preventing a system crash in case the user selects "Show All".