Accessing a child view
Draft comment:
This topic was viewed 32 times since its publication
The control ID is the unique ID of the control within the parent view. You can use the
control ID to access a subview instance at run time.
This topic was viewed 32 times since its publication
About this task
<div></div> tag, which contains a nested <div></div>
tag for each child view. You can use the control ID to access an instance of the child view at run
time by identifying the <div></div> that contains the instance. Important:
View-based coaches are reusable and you can have multiple views in a coach. In view-based coaches,
the control ID is the value for the data-viewid attribute of a
<div></<div> tag. By using the data-viewid attribute,
view developers can locate the nested view because data-viewid is unique within
its parent or enclosing view.Procedure
To use a control ID in your code:
Example
<div id="div_2_1" class="ContentBox" data-view-managed=false>
<div id="div_2_1_1" class="Checkbox CoachView" data-type="com.ibm.bpm.coach.Snapshot_fc633c7d_3b4f_44db_82c1_cfc7ac8b5647.Checkbox" data-binding="" data-config="config2" data-viewid="myCheckbox" data-eventId="" >The
following code checks to ensure that the check box is selected (set to true). If not, the user is
prompted to check the check box before
proceeding.if (this.context.getSubview("myCheckbox")[0].context.binding.get("value") == true) {
return true;
}else{
alert( "Check the checkbox");
return false;
}
This topic is shared by BAW, CP4BA, CP4BASaaS. Last updated on 2025-03-13 12:15