I. Overview
1.1 Problem
When a data entry report is displayed, the reporting widget is extended. As shown in the figure below, we can get all the extended values of the radio button group widget:
1.2 Solution
Add a click event to the button to traverse the widget, if there is only one, get its value; if there are multiple, traverse to get all the values.
II. Example
2.1 Add a extended widget
Create a new template, right-click cell C7 to add a radio button group widget, and set the widget name to p1:
Set the C7 cell to expand vertically:
Add a data dictionary to the radio button group:
Right-click the cell D7, add a button widget, set the button type to be insert row, and specify the cell as C7:
2.2 Get extended widget value
Add a button widget in cell C9, and add a click event:
JavaScript:
var temp="";
var arr=contentPane.getWidgetsByName("p1");
if(arr[0]!=undefined)
{
for(var i=0;i<arr.length;i++)
{temp = temp + arr[i].getValue() + ' ';}
}
else
{temp=arr.getValue()
}
alert(temp);
2.3 Preview effect
Save the template, click data entry preview , the effect is shown in the figure below: