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
  • 1.  Retrieve data present in dynamic table using CAF javascript

    Posted Wed June 01, 2011 11:44 AM

    hi All,

    I am facing an issue in retrieving values from a dynamic table at client side using CAF javascript.

    Let me explain my problem with an example:

    1. In my portlet, I have a table which is binded to a SelectableListTableContentProvider.
    2. In the table, I have a button (which will be rendered per each row in the dynamic table at run time).
    3. wrote following code in the ‘on click’ event:
    var table = CAF.model("#{activePageBean.clientIds['myTableId']}");
    var row = table.get(0);
    var sampleTextId= row.getControlId("sampleText");
    var sampleTextObj = CAF.model(sampleTextId);
    alert(sampleTextObj.getValue());
    1. I am expecting it to give the ‘sampleText’ value present in the 0th row.

    But it is giving javascript error 'Object doesn’t support this property or method’ at line 2 in the above code.
    I am suspecting that it is not treating variable ‘table’ as a CAF.Table.Model object.

    If I put a button outside of this dynmaic table and put the same javascript in the ‘onclick’ event, then i am able to get the ‘sampleText’ value.

    But, as per my requirement, I have to execute this javascript onclick of the button which is rendered on each row present in the table.

    Could you please advise why the javascript for the button present inside table is not working?

    Please find the attached package which illustrates in detail.

    (we are using webMethods 7.1.2 product suite).

    Kind regards,
    Raja sekhar Kintali
    SAGUpload2.zip (16 KB)


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


  • 2.  RE: Retrieve data present in dynamic table using CAF javascript



  • 3.  RE: Retrieve data present in dynamic table using CAF javascript

    Posted Thu June 02, 2011 01:41 AM

    The problem there is that while the table control is being rendered, the “#{activePageBean.clientIds[‘myTableId’]}” expression resolves to clientId of the current row being rendered. It doesn’t resolve to the clientId of the table itself.

    That is expected.

    Since your snippet appears to be interested in getting the row model eventually anyway, you could probably just simplify your script like this:

       var row = CAF.model("#{activePageBean.clientIds['myTableId']}"); 
    var sampleTextId= row.getControlId("sampleText"); 
    var sampleTextObj = CAF.model(sampleTextId); 
    alert(sampleTextObj.getValue());

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


  • 4.  RE: Retrieve data present in dynamic table using CAF javascript

    Posted Thu June 02, 2011 01:59 AM

    hi Mark,

    Thanks for your reply.
    I will try adding the event listener and will let you know the outcome.

    Kind regards,
    Raja sekhar Kintali


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


  • 5.  RE: Retrieve data present in dynamic table using CAF javascript

    Posted Fri June 03, 2011 04:56 PM

    hi Eric and Mark,

    Thank you for your inputs and detailed explanation.

    binding a listener and getting the row model as mentioned above- both the ways are working in my case.

    Kind regards,
    Raja sekhar Kintali


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