rbf_setChecked() does not fire an onChange for checkbox fiel

Posted by IramK on 05-Apr-2016 06:51

Hello,

I am currently using the rbf_setChecked() client side function provided by Rollbase and I noticed that on programmatically setting a checkbox to its checked state, it doesn't fire the onchange event of the field. Is this how it is supposed to be work? Kindly let me know how I can trigger an onchange for that field programmatically.

Cheers.

Iram

Posted by Saraswathi Krishnan on 14-Dec-2016 07:40

This has been fixed in the 4.3 release, thus available in the latest release too

Regards,

Saras

All Replies

Posted by Shiva Duriseati on 05-Apr-2016 08:33

Hi Iram,

I am not able to reproduce this scenario. I have used the following code.

rbf_setChecked("CheckBox",true);

And I am able to trigger the function which is defined in onChange event of checkbox field . Please let me know which version of Rollbase you are using. I have tested in Rollbase 4.1 Private Cloud.

Regards,
Shiva

Posted by IramK on 05-Apr-2016 08:36

Hello Shiva,

This doesn't work properly on a set of checkboxes i.e. group of checkboxes. Please try the same on a group of checkboxes and let me know if you can't find the issue.

Version: 4.0.4.0

Cheers.

Iram

Posted by Shiva Duriseati on 05-Apr-2016 08:57

Hi Iram,

Thanks for clarification.

I just tried the same in Rollbase 4.0.4 but not able to reproduce.

Please find the attached screenshots.

Regards,

Shiva

Regards,

Shiva

Posted by IramK on 05-Apr-2016 09:03

Are you clicking on it manually or performing the click programmatically? Please refer to my question again: rbf_setChecked() and programmatically.

Cheers.

Iram

Posted by Shiva Duriseati on 06-Apr-2016 01:38

Hi Iram,

For my second comment I haven't used rbf_setChecked() API , since this API can be applied only for a checkbox field and not for group of checkboxes. Please let me know how you are applying rbf_setChecked method on group of checkboxes.

More details on rbf_setChecked() API

documentation.progress.com/.../index.html

Regards,

Shiva

Posted by IramK on 06-Apr-2016 03:11

Hello [mention:efd18cd3210243c3a2645cbe9409d974:e9ed411860ed4f2ba0265705b8793d05],

Thanks for your reply. It doesn't explicitly specify in the documentation that you cannot apply it on a group of checkboxes. I am getting all the corresponding checkbox ids from their respective codes using rbf_getIdByCode() function and the way I am trying to perform rbf_setChecked on a group of checkboxes is given below. Let me know if there are any questions.

Cheers.

Iram

// I would like to select all the checkboxes
var checkboxArray = [1,5,10,25,50]; // 1,5,10,25,50 are the checkbox codes for each checkbox item 
for(var y = 0; y < checkboxArray.length; y++)
{
// Getting all the ID's of the checkbox items from their codes
rbf_getIdByCode("checkBoxTestObject", "checkboxArr", checkboxArray[y], function task_IdCallback(returnedID){
rbf_setChecked("checkboxArr_" + returnedID, true);
});
}

Posted by Shiva Duriseati on 07-Apr-2016 04:14

Hi Iram,

Thanks for sharing the code. Yes "onClick" event is not firing when  group of checboxes field is used. I will raise a defect for this and let you know ETA very soon.

Note: If you are trying to check the single value in checkbox group its better to use rbf_setFieldValue(fieldname, value) API instead of rbf_setChecked().

Regards,

Shiva

Posted by IramK on 07-Apr-2016 04:19

Thanks Shiva for confirming this. Unfortunately I am selecting all the values in that checkbox field and would like to use rbf_setChecked() on all those fields in this case. Would this fix be made a part of V4.2 release? Kindly let me know.

Cheers.

Iram

Posted by Shiva Duriseati on 07-Apr-2016 10:30

Hi Iram,

The defect#38813 is expected to be fixed in Rollbase V4.3, which is scheduled on first week of July.

Regards,

Shiva

Posted by IramK on 12-Dec-2016 04:44

Hi [mention:efd18cd3210243c3a2645cbe9409d974:e9ed411860ed4f2ba0265705b8793d05] ,

Has this been fixed in the latest release?

Iram

Posted by Saraswathi Krishnan on 14-Dec-2016 07:40

This has been fixed in the 4.3 release, thus available in the latest release too

Regards,

Saras

This thread is closed