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.  disable radio button group option using CAF javascript API

    Posted Thu July 05, 2012 11:19 AM

    Hi,

    How can I access a radio button group option using CAF javascript API in order to disable it?
    In my use case I have a Radio Button Group named gdnRadio and an option with id selectItemNativo and I’m calling this javascript:

    CAF.model("#{caf:cid('selectItemNativo')}").setDisabled(true);

    On run-time this fails to execute because the CAF model returns null.

    I noticed that the caf:cid(…) resolves to an id, but it doesn’t seem to be the proper one:
    This is the value it resolves to: jsfwmp17615:importTemplate:importTemplateNumbering:numberingForm:selectItemNativo
    This is the option element id on the HTML: jsfwmp17615:importTemplate:importTemplateNumbering:numberingForm:gdnRadio:7397

    Thanks
    Bruno


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


  • 2.  RE: disable radio button group option using CAF javascript API

    Posted Thu July 05, 2012 02:09 PM

    Try something like this:

    var radioGroupModel = CAF.model("#{caf:cid('gdnRadio')}");
    var item = radioGroupModel.get('selectItemNativo');
    var itemModel = CAF.model(item);
    itemModel.setDisabled(true);

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


  • 3.  RE: disable radio button group option using CAF javascript API

    Posted Mon July 09, 2012 09:06 AM

    Hi,

    It is recommended that you use a “Disableable Panel” as a parent of the components you are trying to enable/disable, and use the javascript calls on this panel.

    br,
    Vlad


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


  • 4.  RE: disable radio button group option using CAF javascript API

    Posted Tue July 24, 2012 01:15 PM

    Hi,

    Eric, tried that but it didn’t work out…

    var item = radioGroupModel.get('selectItemNativo');  

    resolves to null.

    Vlad, how can I wrap one item with a disableable panel? Designer doesn’t let me do that.

    Thanks
    Bruno


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


  • 5.  RE: disable radio button group option using CAF javascript API

    Posted Tue July 24, 2012 07:32 PM

    Strange, I thought that worked when I tried it. Which version of MWS (and fix level) are you using?

    Another option would be to lookup the index of the item and then get it by index like this:

    
    var radioGroupModel = CAF.model("#{caf:cid('gdnRadio')}");  
    var itemIndex = radioGroupModel.indexOf('selectItemNativo');
    if (itemIndex == -1) {
    alert("item not found");
    } else {
    var item = radioGroupModel.get(itemIndex);  
    var itemModel = CAF.model(item);  
    itemModel.setDisabled(true);  
    }

    Or if you just want to list what the values of all the items in the radio group are you could do this:

    
    var radioGroupModel = CAF.model("#{caf:cid('gdnRadio')}");  
    var itemList = radioGroupModel.list();
    for (var i=0; i < itemList.length; i++) {
    var item = itemList[i];
    alert("item #" + i + " value is: " + item.getValue());
    }

    Also, see the jsdocs for the RadioGroup model @ [url]http://techcommunity.softwareag.com/ecosystem/documentation/webmethods/wmsuites/wmsuite8-2_sp2/My_webMethods/8-2-SP1_CAF_JavaScript_Reference/CAF.Select.Radio.Model.html[/url]


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


  • 6.  RE: disable radio button group option using CAF javascript API

    Posted Wed July 25, 2012 06:53 AM

    Hi,

    MWS_8.2_SP1_Fix8

    Done it by index.

    Thanks for your help.
    Bruno


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