IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

SelectableListTableContentProvider and index of sorted rows

  • 1.  SelectableListTableContentProvider and index of sorted rows

    Posted Thu September 29, 2011 05:11 AM

    Hi,

    I use a SelectableListTableContentProvider to display the values of an Array of self defined POJOs over an Async Table.
    The Sort property is set to 1 for the first column of the table => The order of the diplayed values is different of the order of the values in my Array.

    And now my Question: How can I get the value associated with the first row of the table? My goal is to select the first row of the table after initialization.

    For now I do the following:

    in the portlet initialize() method: Call a service to get the values for my POJO Array
    The output Array of the service is used as values array by the SelectableListTableContentProvider
    The value attribute of the Async Table is set to the SelectableListTableContentProvider
    The first column of my table is bound to the name attribute of my POJO (over the control scoped variables)
    The sort property of the first column of my table is set to 1

    Thanks for hints
    Frederic


    #webMethods
    #MWS-CAF-Task-Engine
    #webMethods-BPMS


  • 2.  RE: SelectableListTableContentProvider and index of sorted rows

    Posted Thu September 29, 2011 03:12 PM

    Just to be sure, are you asking for server side access to the first row After it has been sorted?


    #MWS-CAF-Task-Engine
    #webMethods
    #webMethods-BPMS


  • 3.  RE: SelectableListTableContentProvider and index of sorted rows

    Posted Fri September 30, 2011 04:11 AM

    Yes, exactly.

    I need the values of the first row of the sorted table in order to call another service that get details data for the selected row.
    When my portlet is first shown I use the initialize() method of my portlet to set up the data for the tableProvider and the bean containing detail-data over the selected row.
    Later the user will select a row of the table over a async-command-link, so that I can get the currentRow or selectedRow over the provider, but at the portlet initialization time, the user has not selected any row yet.


    #MWS-CAF-Task-Engine
    #webMethods
    #webMethods-BPMS


  • 4.  RE: SelectableListTableContentProvider and index of sorted rows

    Posted Thu October 06, 2011 08:04 PM

    Ok, it seems like you can just use the binding expression of the Content Provider (if it is used after the table control).

    In the sample app attached, i have a list of values in random order. The Table Control sorts the table, and then in a property group right afterwards the content provider’s current row is bound to some text boxes. In your example, it seems like you could bind the content provider’s first row data to your web service.

    Please have a look and see if it makes sense in your scenario.
    Regards,
    –mark
    SortApp.zip (12.5 KB)


    #webMethods
    #MWS-CAF-Task-Engine
    #webMethods-BPMS


  • 5.  RE: SelectableListTableContentProvider and index of sorted rows

    Posted Fri October 07, 2011 04:12 AM

    hi mark,
    In the above sample given , onclick of any “id’s” given by the selectlistTableContentProvider can i call the other service to fetch the details of it? how can i achieve that?


    #MWS-CAF-Task-Engine
    #webMethods-BPMS
    #webMethods


  • 6.  RE: SelectableListTableContentProvider and index of sorted rows

    Posted Mon October 10, 2011 11:05 AM

    Hi Mark,

    thanks for the hint.
    I was not able to run your sample, probably because I’m using MWS 7.1.3.
    But I was able to reproduce the sample on my environment using your sample’s code content.

    So, I’m yet able to get the value of the first row of my sorted table through this code snipet:

    @Override
    protected void afterRenderResponse() {
    String boundValue = (String) resolveExpression("#{SortPortletDefaultviewView.sampleItemsProvider.id}");
    // I Call my service here using the retrieved ID
    super.afterRenderResponse();
    }
    

    The only problem remaining is that my portlet has already been displayed at this phase, and I don’t get the results of the service displayed before I refresh the portlet page.
    Do you know any way to force an automatic refresh of the page after the service call? Maybe over java-script?

    By the way: I’ve checked the value returned by the EL-expression of the code snippet above for other phases. The value returned during before-render-response was the first value of the provider list. Only after the rendering of the table, the value was changed to the first row of the table.

    Regards,
    Frederic


    #MWS-CAF-Task-Engine
    #webMethods
    #webMethods-BPMS


  • 7.  RE: SelectableListTableContentProvider and index of sorted rows

    Posted Mon October 10, 2011 07:17 PM

    Have a look at this javascript here: Slow page - webMethods - Software AG Tech Community & Forums

    It shows how to raise a command after the Dom is loaded.
    Regards,
    –mark


    #MWS-CAF-Task-Engine
    #webMethods-BPMS
    #webMethods


  • 8.  RE: SelectableListTableContentProvider and index of sorted rows

    Posted Tue October 11, 2011 08:30 AM

    Hi Mark,

    do you maybe have a sample portlet with this script working. I don’t manage to get the custom script control trigered after my portlet page is loaded.

    Thanks
    Frederic


    #webMethods
    #webMethods-BPMS
    #MWS-CAF-Task-Engine


  • 9.  RE: SelectableListTableContentProvider and index of sorted rows

    Posted Tue October 11, 2011 07:11 PM