Topic
6 replies Latest Post - ‏2012-12-10T20:06:16Z by mburati
SystemAdmin
SystemAdmin
9029 Posts
ACCEPTED ANSWER

Pinned topic Server side pagination with WEF

‏2012-12-06T14:24:37Z |
HI,
we want to implement server side pagination,filtering and sorting.
the table data is generated by using a repeated region.

so if i call service in normal way(REST Service call builder and calling this) for these operations and reloading the region,
the response may not be quick..correct me if i am wrong
is there any better way to do it?
Thanks,
Saikiran V
Updated on 2012-12-10T20:06:16Z at 2012-12-10T20:06:16Z by mburati
  • mburati
    mburati
    2551 Posts
    ACCEPTED ANSWER

    Re: Server side pagination with WEF

    ‏2012-12-07T15:50:02Z  in response to SystemAdmin
    Is there a reason you have to use Repeated Region instead of Data Page and WEF's higher level page automation builders?
    Those higher level builders do a lot of the work of setting up paging, filtering, sorting etc between the generated UI in the consumer and a data provider talking to a back end. Note, Data Page leverages Repeated Region under the covers, but it also automates a lot of the additional work you're trying to do there.

    A REST service that provides its own paging capability (lets you specify how many rows to return and the starting row) is going to be more efficient than one that returns everything whether you need it or not.

    There is a WEF Custom Data Retriever sample (sample of how to do your own custom data retriever that provides paging to a backend that WEF doesn't provide paging to out of the box) on the WEF Wiki Samples directory (I believe against a web service) at:
    http://www-10.lotus.com/ldd/pfwiki.nsf/dx/Web_Expereince_Factory_Samples_Categorized#Additional+data+access+techniques

    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.
  • SystemAdmin
    SystemAdmin
    9029 Posts
    ACCEPTED ANSWER

    Re: Server side pagination with WEF

    ‏2012-12-10T11:54:05Z  in response to SystemAdmin
    Thanks for the reply,

    the table has different sorts of data..some columns are WebSphere Portal Links, almost on click of all the columns something is going to happen.to make these things possible some body suggested to use repeated region.

    if we use data page,looks we have to deal with the data in the
    <rowset>
    <row>

    </row>
    <row>

    testData - 2a


    testData -2b
    • SystemAdmin
      SystemAdmin
      9029 Posts
      ACCEPTED ANSWER

      Re: Server side pagination with WEF

      ‏2012-12-10T12:05:41Z  in response to SystemAdmin
      sorry accidentally posted the message without completing, we don't have option to edit our post?

      any way here is my complete reply,

      the table has different sorts of data..some columns are WebSphere Portal Links, almost on click of all the columns something is going to happen.to make these things possible some body suggested to use repeated region.

      if we use data page,looks like we have to deal with the data in the form
      <rowset>
      <row>
      </row>
      <row>
      </row>
      </rowset>

      if we use data page, how to get custom styles for the table data,like i mentioned above how to get dynamic behavior for the table data(like Web Sphere Portal links, onclick firing some events)

      and in the example mentioned above, can only see pagination. how to do sorting(based on a column) and filtering.
      for the pagination we need to give the option of how many records user want to select.

      and we don't need WEF styles for the data and paging links, we need to provide custom styles for all the buttons.
      Thanks,
      Saikiran V
      • mburati
        mburati
        2551 Posts
        ACCEPTED ANSWER

        Re: Server side pagination with WEF

        ‏2012-12-10T15:06:26Z  in response to SystemAdmin
        One of the few reasons to choose Repeated Region over Data Page and higher level page automation builders, is the rare case when the "structure" of the response data is unknown or unpredictable (eg, you only know it's going to repeat, but not what children the repeated structure is going to return).

        If the structure of the response data is consistent across requests (eg, first child is a URL, second is an id of the record, third is a displayable name or label etc) then you can and should typically use Data Page and higher level page automation builders to leverage what they generate for you rather than rebuilding existing functionality from scratch.

        There are multiple ways to modify what Data Page and Page Automation builders generate for you, including using Data Field Settings to specify what the field type is for particular columns, Data Field Modifier to specify a control type for a particular field on a particular page, Data Column Modifier to reorder columns etc. You may also apply other builder(s) (such as Link etc) over a particular column name to change what's displayed in the repeating rows for that column, and reference the data fhat's in that cell via the row loop variable that Data Page (actually Repeated Region that's used by Data Page) generates and populates as the JSP for that page is being rendered. If you are new to WEF and/or any of the above is new information then you may want to go through the Learning Roadmap on the WEF Wiki (link below) to learn more about what the various WEF builders automate and generate for you, to avoid unnecessary work/code and to leverage best practices using WEF builders and automation.

        If you post a sample (with no confidential info or intellectual property) showing what you're having trouble with, it might make it easier for someone to quickly spot what's wrong with it.

        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.
        • SystemAdmin
          SystemAdmin
          9029 Posts
          ACCEPTED ANSWER

          Re: Server side pagination with WEF

          ‏2012-12-10T16:48:30Z  in response to mburati
          Thanks for the reply...Yes im new to WEF,

          and one more constraint we have is we shouldn't depend on the WEF features which internally uses DOJO.
          does these uses DOJO internally?

          Thanks,
          • mburati
            mburati
            2551 Posts
            ACCEPTED ANSWER

            Re: Server side pagination with WEF

            ‏2012-12-10T20:06:16Z  in response to SystemAdmin
            WEF 7.0.1 and later does use Dojo by default for inputs, and it provides some nice features for rich web applications, but if you are not allowed to use it for a particular project for some reason then there are ways to avoid using it.

            - You can skip use of any of the Dojo * builders.
            - You can change the base Rich Data Definition (RDD) file that a particular model uses via Theme builder with override settings, or for a whole project by creating a custom theme (uitheme XML file) that extends and existing WEF theme file and sets the default RDD to the base rdd instead of to the Dojo RDD).
            - In WEB-INF/config/override.properties, you can remove the Dojo RDD from the list of default RDD files to use for the project
            (eg, defaults to the following for 7.0.1 and 8.0.0.x):
            bowstreet.baseRddFile=/WEB-INF/factory/data_definitions/dojo_base_datadef.xml;/WEB-INF/factory/data_definitions/base_datadef.xml

            - If you need to avoid ALL use of Dojo (as opposed to just the Dojo input types) then you'll need to either disable Smart Refresh (againg via Theme builder or custom Theme file) and/or remove the Dojo feature set from the project entirely, so that it's not pulled in for Smart Refresh (which uses an internal Dojo Content Pane widget to do partial page refresh).

            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.