webMethods

webMethods

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.  How to add a row to two tables using one add row button in CAF Webmethods

    Posted Mon February 15, 2016 03:46 AM

    function createRow()
    {
    var tableModel = CAF.model(“#{caf:cid(‘defaultForm:BenodigSomerTable’)}”);

    	var rowCount = tableModel.getRowCount();
    
    alert(rowCount + 1);
    row = tableModel.insertRow();
    alert(rowCount);
    

    }
    the above code is in the click event of my add row button for a table named SomerTable. My intention is to add a row on table SomerTable as well as BenodigSomerTable using just one add row button.my code wont execute the line between the two alerts.
    Anything I can do to achieve this.


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


  • 2.  RE: How to add a row to two tables using one add row button in CAF Webmethods

    Posted Tue February 16, 2016 05:41 PM

    There is no insertRow() method in the client-side Table Model.

    You would want to use the tableModel.add(…) method if you want to add a row on the client-side.

    For example, something like this:

    
    var tableModel = CAF.model("#{caf:cid('defaultForm:BenodigSomerTable')}"); 
    //add new row the as the first row of the table
    tableModel.add(0, {});

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


  • 3.  RE: How to add a row to two tables using one add row button in CAF Webmethods

    Posted Tue May 31, 2016 03:12 PM

    Hi Eric Norman, my problem its when add the json on the second parameter tableModel.add(0, {}); whats its the structure, my example its:
    var values={
    EMPLOYEE_ID: “1234”,//EMPLOYEE_ID
    FIRST_NAME: “My FName”,//FIRST_NAME
    DEPARTMENT_NAME: “Dep” //DEPARTMENT_NAME
    };
    But not working, any solution for this?

    Regarts.


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


  • 4.  RE: How to add a row to two tables using one add row button in CAF Webmethods

    Posted Tue May 31, 2016 03:29 PM

    The syntax should be something like this to populate the values of controls in the new row at the same time the row is added:

    
    var tableModel = CAF.model("#{caf:cid('defaultForm:BenodigSomerTable')}");   
    tableModel.add(0, 
    {
    //for the values field, the key is the controlId, and the value is the value
    values : {
    htmlInput1 : 'My new row',
    htmlInput2: 'value2'
    }
    });

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


  • 5.  RE: How to add a row to two tables using one add row button in CAF Webmethods

    Posted Tue May 31, 2016 03:51 PM

    Thanks a lot, but my code:

    var tableAsync13=CAF.model(‘jsfwmp8485:defaultForm:asyncTable’);
    tableAsync13.add(0, {
    values : {
    htmlOutputText2: ‘1234’,//EMPLOYEE_ID
    htmlOutputText4: ‘My Name’,//FIRST_NAME
    htmlOutputText6: ‘Dep’ //DEPARTMENT_NAME
    }
    });

    But still yet not working, there are something wrong?, my row it put to table but empty.


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


  • 6.  RE: How to add a row to two tables using one add row button in CAF Webmethods

    Posted Tue May 31, 2016 04:06 PM

    Double check if your Output Text controls are configured with the “Raw” property set to false. A raw output text control does not render the tag around the text so there isn’t a client-side id to match to the equivalent key in your JSON block.

    Alternatively, if you are just populating client-side labels in the columns and not binding it to any input controls, then you could instead just populate the labels of each table cell with this alternate syntax:

    
    var tableModel = CAF.model("#{caf:cid('defaultForm:BenodigSomerTable')}");     
    tableModel.add(0, {
    //the index of string in the array corresponds to the index of the cell in the new row
    label : [
    'My new row',
    'My new row2'
    ]
    });

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