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

how to save the selected values by using the "Select Row Checkbox"?

  • 1.  how to save the selected values by using the "Select Row Checkbox"?

    Posted Thu March 14, 2013 06:48 AM

    Hi All,

    I have a problem while using the “Select Row Check box”

    My scenario:

    I have a table with two columns.
    One column displays some list of item names and another column will displays a check box to select/unselect [Select Row Check box].

    When even i selects a check box i want to append the item name(s) to an string or array list.

    Can anyone help me on this.

    Thanks in advance,
    Guruprasd.B


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


  • 2.  RE: how to save the selected values by using the "Select Row Checkbox"?

    Posted Thu March 14, 2013 01:17 PM

    If you need to respond to the selection events on the client side without a round trip to the server, you can attach a row change listener to the table control with a custom function in a script block that gets called when a row select occurs.

    For example:

    
    CAF.model("#{caf:cid('yourTableIdHere')}".addRowChangeListener(function(tableId,rowId,eventType) {
    if (eventType == "select") {
    alert('Row Selection Changed for Row: ' + rowId);
    }
    });

    Or if you want to get the selected rows on the server side inside of an action handler method, you can use the methods on the selectable content provider object.

    See: http://techcommunity.softwareag.com/ecosystem/documentation/webmethods/wmsuites/wmsuite8-2_sp2/My_webMethods/8-2-SP1_CAF_and_MWS_Java_API_Reference/com/webmethods/caf/faces/data/ISelectableTableContentProvider.html#getRowSelectedIds()

    For example:

    
    ISelectableTableContentProvider tableContentProvider = [TODO_get_your_table_content_provider_here];
    Collection selectedRowIds = tableContentProvider.getRowSelectedIds();

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


  • 3.  RE: how to save the selected values by using the "Select Row Checkbox"?

    Posted Fri March 15, 2013 12:46 AM

    Hi Eric Norman,

    Thanks your help.

    I want the selected values on click of some button [Ex: Ok]. I have used the 2nd example and it is listing all the selected values.

    Once again thanks for your help.

    Regards,
    Guruprasad.B


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


  • 4.  RE: how to save the selected values by using the "Select Row Checkbox"?

    Posted Tue December 01, 2015 11:01 AM

    Hi Norman,

    I am currently using the 9.8 version and i am trying to clear the selected rows from the server side, but i could not succeeded.

    Below is the code i am using to push the selected rows to the another custom ArrayList.

    getPlacedOrderDetails().add((caf.war.SAGInternalSystems.wsclient.enquireecafelist.SAG_ECAFEWsEnquireECafeListStub.OrderDetails) getEnquireECafeTableProvider().getSelectedRows().

    later i have used the below code to clear the selected items.

    getEnquireECafeTableProvider().getSelectedRows().clear().

    Unfortunately , above code throws some error as below.

    UnsupportedOperationException.

    Please help me out from the above error, or do we have any other way to remove the values from the selected array bean from the server side.

    Thanks in advance.


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


  • 5.  RE: how to save the selected values by using the "Select Row Checkbox"?

    Posted Tue December 01, 2015 12:59 PM

    The selected rows list is immutable.

    If you want to clear the selected rows, you should call the setRowSelectedIds method and pass it an empty list.

    for example:

    getEnquireECafeTableProvider().setRowSelectedIds(Collections.emptyList());

    Reference:


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