Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Total number of radio buttons selected within instances

Avatar

Level 3

Hello,

I have a radio button group that lives within a repeatable subform.

I would like to loop thru and set some fields outside of the subform to keep totals of the items that are ticked within the radio button group.

I am using the following script (text field via calcuate) but it is not working.

Can anybody help?

var otherDetailLines = xfa.resolveNodes("BugGroup_f[*]");

for (i = 0; i < otherDetailLines.length; i++){
    if (otherDetailLines.item(i).resolveNode("BugGroup_f.detail3.bugInfo.BugItem.status.RadioButtonList").rawValue == "6")
    {

        this.rawValue = +1;

    }
    xfa.form.recalculate(1);
}

3 Replies

Avatar

Former Community Member

You are mixing scripting languages ....the subform instance with teh * only works in FormCalc but you are coding in Javascript

paul

Avatar

Level 3

Paul,

Can you help me reverse engineer it for FormCalc?

Or do you suggest keeping it java and coding it that way?

Thanks again!

Avatar

Former Community Member

I woudl suggest keeping it in Javascript. You will need to assign the variable that holds all of those subforms to its parent then do a length of that.

Paul