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.  Async command button

    Posted Thu November 05, 2015 07:29 AM

    Hi,

    I’ve a async command button which is having some action defined. I’ve added some client side validation on this button in the click property. I want this button to invoke the action if client side validation is all good.

    In the click property I am traversing through the table and checking if there are same entries in a single column, If there is then I am throwing CAF warning and if there is no warning the action should be executed but button is not invoking the action, please help.


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


  • 2.  RE: Async command button

    Posted Sun November 08, 2015 07:54 AM

    Hi TeKnAs,

    Have you tried with returning value as true/false from script block to invoke command button action.

    If returning true/false from script block is not working,then you can add one hidden async command to call the action(that was being called from command button) and that hidden button can be invoked from script block.

    Sample code for calling hidden async command block can be

    
    var prevRowState=CAF.model('#{activePageBean.clientIds["htmlInputText"]}');
    if(prevRowState=='1')
    {
    var cmdModel = CAF.model('#{activePageBean.clientIds["hidden12"]}');
    cmdModel.raise();
    }
    else
    {
    alert("okk")
    //Do nothing
    }

    Please let us know if you are facing any problem in implementing the same.

    Thanks
    Baharul Islam


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


  • 3.  RE: Async command button

    Posted Tue November 10, 2015 07:26 AM

    Hi Baharul,

    Thanks for the reply. However, when I am adding a for loop on the table [on Click property of save button] by getting the table row count. the control is not getting out of the for loop in case if there is no validation error, I’ve added an alert after the for loop. that alert never comes up.

    Why is it so. any idea?

    Thanks.


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


  • 4.  RE: Async command button

    Posted Tue November 10, 2015 10:00 AM

    Hi TeKnAs,

    For on click validation to loop over the table data can you try with code like

    var tableModel=CAF.model('#{activePageBean.clientIds["asyncTable1"]}');
    
    var rowModelList=tableModel.list();
    //rowModelList will return table row IDS
    alert(rowModelList.length);
    for(var i=0;i<rowModelList.length;i++)
    {
    alert("row ID"+rowModelList[i])
    //Validation part
    }

    Please let us know if you are facing any problem in implementing this.

    Thanks
    Baharul Islam


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