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.
5 replies Latest Post - ‏2012-11-30T00:12:59Z by SystemAdmin
SystemAdmin
SystemAdmin
9029 Posts
ACCEPTED ANSWER

Pinned topic HTML table filter

‏2012-11-12T20:11:30Z |
Does Web Experience Factory have features like a builder which would provide ability to filter html columns in DSUI or Data Page?(Filter like in excel)
Updated on 2012-11-30T00:12:59Z at 2012-11-30T00:12:59Z by SystemAdmin
  • kevintap
    kevintap
    746 Posts
    ACCEPTED ANSWER

    Re: HTML table filter

    ‏2012-11-13T20:12:34Z  in response to SystemAdmin
    Web Experience Factory doesn't have a single builder which can provide this feature, but you can use several builders in combination to create this. I'm attaching a sample set of models which demonstrates how to build this.

    The first assumption here is that your backend supports filtering the data as you desire. I've used a SQL database here and I'm using the SQL Data Services builder's search function to generate a list of matching records. The service provider model here also contains 2 other SQL Call builders used to obtain the distinct set of values for 2 of the columns of data that filtering will be allowed on. (If you're using a web service or other backend here, it would be required that the service support basic filtering of your data. If your backend does not support such filtering, you could use the Transform Filter builder to achieve this.)

    The consumer model uses a Service Consumer builder and a View and Form builder to render the results view. I've used a pair of Select builders to overwrite the column header label for the 2 columns that allow filtering. The select builders obtain their data from the corresponding SQL Call builders in the service provider model. I've also added a pair of HTML Event Action builders to listen for the onchange event on the dropdowns. These in turn invoke the filter Action List. The filter Action List simply updates the values which were submitted from the dropdowns and re-invokes the backend data service to obtain the new filtered results to redisplay.
    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: HTML table filter

      ‏2012-11-14T17:39:35Z  in response to kevintap
      Hi Kevin,
      Thnx for sharing the models. It has helped me a lot. I have hooked up Web Experience Factory 7.0.1 with WAS 7.x. This is the WAS on which my Portal 6.1.5 is running.(SQL Data Source used is jdbc/CloudscapeForWPF)

      I have a few questions.

      a)The sort is server side not client side, correct?

      b)In ColumnFilterTestServiceModel->sql (SQL Data Services Builder), in the List Criteria section the columns mentioned are
      FIRSTNME, LASTNAME.
      What is the use of this List Criteria?
      Also LASTNAME is not used in filter. You are using FIRSTNME and DEPT. So is LASTNAMR a typo or you are using for any particular reason.?

      c)In ColumnFilterTest.model->main ActionList->You are having these 2 calls. DataServices/Service/getFirstnames and DataServices/Service/getDepts. Why are you calling them?

      d)In ColumnFilterTest.model->main ActionList-> why do you call Assignment!DataServices/Service/searchSql/inputs/sqlSearchInputs/FIRSTNME= and Assignment!DataServices/Service/searchSql/inputs/sqlSearchInputs/WORKDEPT=

      e)When I am filtering, the input gets submitted but all the result is displayed again instead of filtered results. I am adding the models(your models only with few changes like table name and Datasource name).
      • kevintap
        kevintap
        746 Posts
        ACCEPTED ANSWER

        Re: HTML table filter

        ‏2012-11-16T15:39:04Z  in response to SystemAdmin
        a) Yes, the sort is handled on the server side, not the client side. In the particular sample that I provided, the sort would actually be passed all the way through and be handled by the database. The SQL Call/SQL Data Services builder provides this functionality automatically.

        b) When I started building this sample, I initially enabled the List operation in the SQL Data Services builder and had it configured to allow filtering on the FIRSTNME and LASTNAME fields. I then switched to using the Search operation. The configuration in the builder inputs for the List operation is just left over from my initial setup/testing. Since the List operation is disabled, the builder inputs in the List Options section are ignored.

        c) In the main Action List, I call getFirstnames and getDepts to load the data that is used for the dropdowns. If these operations were not called, the select dropdowns would be blank when you run the model. The Select builders reference the results from these service operations (${DataServices/Service/getFirstnames/results}), but don't explicitly invoke the service operations, so that must be done manually in order to fetch the data.

        d) In the main Action List, I make those assignments to ensure that the input structure passed to the SQL operation is properly initialized.

        e) I looked at your copy of the models and I don't see any major differences other than the datasource/table names. The filtering is working properly here with my copy of the models, so that makes it a bit difficult to debug. I might suggest opening the SQL Data Services builder and enabling the Log SQL Statements checkbox in the Debugging section. Then examine the SystemOut.log file as you run the application and check to make sure the proper input values are being passed into your SQL statements.
        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: HTML table filter

          ‏2012-11-16T16:05:24Z  in response to kevintap
          Thanks for the explanation Kevin. I will keep this thread open for some more time today while trying to debug and see why filtering is not working for me.
          • SystemAdmin
            SystemAdmin
            9029 Posts
            ACCEPTED ANSWER

            Re: HTML table filter

            ‏2012-11-30T00:12:59Z  in response to SystemAdmin
            I am closing this thread assuming that there is some issue in my environment for which sorting is not working. If even after a while I am unable to resolve it i might open a new thread.