Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Sub radio buttons

Avatar

Level 4

I have an interactive form where the user applies for a leave of absence and selects one of 6 reasons.

Maternity

Medical

Worker's Comp

Family

Military

Personal

If the user selects Family, there are two sub-reasons:

Serious Illness

Child-related

I've made these two a radio button group and the top-level reasons a separate radio button group. Is there any way to nest one group inside another? I found this .xdp code at http://eslifeline.wordpress.com/2008/05/24/creating-nested-radio-buttons/

form1.#subform[0].Continents.Africa::change - (JavaScript, client)
var asia = xfa.resolveNode("form1.#subform[0].Continents.Asia");
var africa = xfa.resolveNode("form1.#subform[0].Continents.Africa");
var europe = xfa.resolveNode("form1.#subform[0].Continents.Europe");
var kenya = xfa.resolveNode("form1.#subform[0].Continents.Kenya");
var egypt = xfa.resolveNode("form1.#subform[0].Continents.Egypt");
var india = xfa.resolveNode("form1.#subform[0].Continents.India");
var china = xfa.resolveNode("form1.#subform[0].Continents.China");
var other = xfa.resolveNode("form1.#subform[0].Continents.Other");
var explain = xfa.resolveNode("form1.#subform[0].Explain");
asia.y = 89+"points";
europe.y = 119+"points";
other.y = 149+"points";
//asia.x = "1.25in";
//africa.x = "1.25in";
//europe.x = xPosition.value;
kenya.x = childXPosition.value;
egypt.x = childXPosition.value;
kenya.presence = "visible";
egypt.presence = "visible";
kenya.y = 45+"points"
egypt.y = 60+"points";
india.presence = "hidden";
china.presence = "hidden";
explain.presence = "hidden";

I modifed it for my form, like this

**************************hide Child and Illness until Family is clicked
**********doesn't work

var Family= xfa.resolveNode("LOA.Form1.Reason.Family");
var Child = xfa.resolveNode("LOA.Form1.Reason.Child");
var Illness = xfa.resolveNode("LOA.Form1.Reason.Illness");

Child.presence = "hidden";
Illness.presence = "hidden";

Family.y = 0.25+"inches";
Child.y = 0.625+"inches";
Illness.y = 0.625+"inches";
Child.x = childXPosition.value;
Illness.x = childXPosition.value;

Child.y = 5.25+"inches"
Illness.y = 5.0+"inches";


LOA.Form1.Reason.Family::ready:form - (JavaScript, client)

Utilities.resetPositions();

I would greatly appreciate any help or suggestions in making this code function.

1 Accepted Solution

Avatar

Correct answer by
Former Community Member
18 Replies

Avatar

Former Community Member

I don't think that nesting them is the answer. If they are all under the same RadioButton group then you can only have one selection. How about if we create two groups and the second group contains the Serioous Illness and Chilr Related selctions. Then we could hide this group and only make it visible if the Family selection is made. Here is an example to show what I mean.

Paul

Avatar

Level 4

What a great idea! That's really cool! I like the dropdown list instead of all the radio buttons. And the script is very concise.Thank you, Paul. I appreciate your help very much! Do you use Livecycle ES2? I'm interested in Action Builder.

Avatar

Former Community Member

Yes I use LCES2 and I am familiar with Action Builder.

Paul

Avatar

Level 4

Looking at your file, I can't see the subform or the text. Why? How does your file work?

Avatar

Former Community Member

In the hierarchy view if you click on the FamilySubform object (this is the subform that holds the radiobutton group and the text) then click on the Object palette. Near the bottom of that palette is the presence property......I have it set fro hidden exclude from layout. If you change it to visible you will see it in the Design. I put it that way beacuse that is what I want for the default.

Paul

Avatar

Level 4

Right. I see how that works. OK. Thank you again. I'm emailing with Adobe right now to see if I can get an upgrade to Livecycle ES2. I want to try out Action Builder.

Avatar

Level 4

I see that you have the radio buttons in FamilySubform. I've been using Radio Button Groups. How does a SubForm work?

Avatar

Former Community Member

You can also download a trial version from the web site if you wish.

Paul

Avatar

Level 4

Right. I did that last night at home. Huge download. 3GB! Here at work, we have Adobe Volume Licensing, and I'm wondering if I could just download an upgrade to ES2. Maybe I have to get a new PO and purchase it. That's what I'm trying to find out.

Avatar

Former Community Member

Subforms are basically containers that help group objects together. The advantage is that I can change properties on the container and everything inside it gets that attribute. So in your case if I change the presence of the container then the text, the radiobutton group and the individual radiobuttons all get their presence changed as well. I do it with one statement instaed of 2 or more.

Paul

Avatar

Level 4

OK. I'm following your idea. I'm experimenting with the dropdown list, using these list items:

Maternity (attach doctor's certification*)  - complete sections #3 and #4

Medical/Disability (attach doctor's certification*)

Worker's Compensation Disability (attach doctor's certification*)

Family Leave: (complete section #4)

Military Leave (attach copy of orders)

Personal Leave (duration of leave may not exceed 8 weeks)

Under the Binding tab, these have the values 1-6. So I edited your script to this.

if (xfa.event.rawData == 4){
    FamilySubform.presence = "visible"
} else {
    FamilySubform.presence = "hidden"
}

But it doesn't work. The problem must be (xfa.event.rawData == 4). There's probably another term for rawData when you use a number. What would that look like?

Avatar

Level 4

Sorr, I guessed wrong. The line should be (xfa.event.rawValue == 4), but that doesn't work, either.


Avatar

Former Community Member

Where did you get xfa.event.rawdata from ......the command xfa.event.newText is used to give you the last the the user selected from the object. The value of the DDList is not committed to the rawValue property until you leave the field so if it was any other event we would use this.rawValue to get what the use selected.

Make sense?

Paul

Avatar

Level 4

That helps. I changed the Values on the Binding tab to words, instead of numbers, and used your script like this:

LOA.Form1.ReasonDropDownList::change - (JavaScript, client)
if (xfa.event.newText == "Family"){
    FamilySubform.presence = "visible"
} else {
    FamilySubform.presence = "hidden"
}

Your script is this:

form1.#subform[0].DropDownList1::change - (JavaScript, client)
if (xfa.event.newText == "Family"){
     FamilySubform.presence = "visible"
} else {
     FamilySubform.presence = "hidden"
}

The only difference I can see is the first line.

Is there a way in this line if (xfa.event.newText == "Family"){

to say "LIKE" or "CONTAINS"? So that if the Text is actually longer, like "Family Leave: (complete section #4)," the script will work?

Avatar

Level 4

Not really. the rawValue was from a script I found on another Adobe forum discussion yesterday. I'm going to try to get your script to work for me.

LOA.Form1.ReasonDropDownList::change - (JavaScript, client)
if (xfa.event.newText == "Family"){
    FamilySubform.presence = "visible"
} else {
    FamilySubform.presence = "hidden"
}

Avatar

Former Community Member

Its not SQL its a comparison in Java script ....you are controlling what is in the dropdown and what is being set in teh DDList so why not simply compare to the real value that you set (even if it  is multiple words).

Paul

Avatar

Level 4

OK. Just to keep things simple until I get this working, I'm using "Family." How can I attach my PDF so that you can see what's wrong?

Avatar

Correct answer by
Former Community Member

Email it  to LiveCycle8@gmail.com

Paul

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----