Highlighted

RadioButtonList - Riddle - URGENT

Niederfuchs

02-09-2008

Dear Community,



I have a riddle I am unable to solve:

I have a RadiobuttonList with eight items the bindings tab has them connected to the rawValues 1-8. Also on my form there is a form connected to a checkbox with the rawValue 0 and 1



If the RadioButtonList has a rawValue == 8

3 other subforms have to dissapear no matter what the checkbox says.



If the RadioButtonList has a rawValue != 8 and the checkbox is checked

three subforms have to appear.



If the RadioButtonList has a rawValue != 8 and the checkbox isn't checked

two subforms have to appear and one subform has to dissapear:



The folowing script has first been placed in the "click" event of the "RadioButtonList" (not of each RadioButton) and afterwards in the "change" event of the RadioButtonList (not of each RadioButton):



if (this.rawValue != "8")&&(xfa.form.Formular1.superframe.administratormain.computerdistribution.multipleschoolforms == "1")

{

xfa.form.Formular1.superframe.administratormain.administrator3.presence = "visible"

xfa.form.Formular1.superframe.administratormain.administrator4.presence = "visible"

xfa.form.Formular1.superframe.administratormain.administrator5.presence = "visible"

}

else if (this.rawValue != "8")&&(xfa.form.Formular1.superframe.administratormain.computerdistribution.multipleschoolforms == "0")

{

xfa.form.Formular1.superframe.administratormain.administrator5.presence = "hidden"

xfa.form.Formular1.superframe.administratormain.administrator3.presence = "visible"

xfa.form.Formular1.superframe.administratormain.administrator4.presence = "visible"

}

else if (this.rawValue == "8")&&(xfa.form.Formular1.superframe.administratormain.computerdistribution.multipleschoolforms == "0")

{

xfa.form.Formular1.superframe.administratormain.administrator5.presence = "hidden"

xfa.form.Formular1.superframe.administratormain.administrator3.presence = "hidden"

xfa.form.Formular1.superframe.administratormain.administrator4.presence = "hidden"

}

else if (this.rawValue == "8")&&(xfa.form.Formular1.superframe.administratormain.computerdistribution.multipleschoolforms == "1")

{

xfa.form.Formular1.superframe.administratormain.administrator5.presence = "hidden"

xfa.form.Formular1.superframe.administratormain.administrator3.presence = "hidden"

xfa.form.Formular1.superframe.administratormain.administrator4.presence = "hidden"

}



However it does not work as the script has the subforms appear as I check the checkbox but doesn't have them dissappear again once I choose the "rawValue == 8"-option in the RadioButtonList.

Please tell me which event do I have to pick - and why does my script ignore the choices I make in the RadioButtonList ?!

Replies

Highlighted

pguerett

02-09-2008

You should only have the script running in one spot ...the change event of the RadioButtonList. As the list is changed the event will fire and your code will execute. Do not put the code on the click event of the RadioButtonList. You can use an app.alert(RadioButonList.rawValue) to show you what the value is directly before you do the compare.
Highlighted

Niederfuchs

02-09-2008

Dear Paul thanks for answering this quickly I put this code chunk in the change event of the "RadioButtonList" and cleared all the other events of code (they're blank now). However even the app.alert does not fire when I click on one of the options in my radioButtonList.. This is really frustrating...

Why doesn't the code fire?



Here is the code:



Formular1.superframe.administratormain.internetconnection.Optionsfeldliste::change - (JavaScript, client)

app.alert(this.rawValue)

if (this.rawValue != "8")&&(xfa.form.Formular1.superframe.administratormain.computerdistribution.multipleschoolforms == "1")

{

xfa.form.Formular1.superframe.administratormain.administrator3.presence = "visible"

xfa.form.Formular1.superframe.administratormain.administrator4.presence = "visible"

xfa.form.Formular1.superframe.administratormain.administrator5.presence = "visible"

}

else if (this.rawValue != "8")&&(xfa.form.Formular1.superframe.administratormain.computerdistribution.multipleschoolforms == "0")

{

xfa.form.Formular1.superframe.administratormain.administrator5.presence = "hidden"

xfa.form.Formular1.superframe.administratormain.administrator3.presence = "visible"

xfa.form.Formular1.superframe.administratormain.administrator4.presence = "visible"

}

else if (this.rawValue == "8")&&(xfa.form.Formular1.superframe.administratormain.computerdistribution.multipleschoolforms == "0")

{

xfa.form.Formular1.superframe.administratormain.administrator5.presence = "hidden"

xfa.form.Formular1.superframe.administratormain.administrator3.presence = "hidden"

xfa.form.Formular1.superframe.administratormain.administrator4.presence = "hidden"

}

else if (this.rawValue == "8")&&(xfa.form.Formular1.superframe.administratormain.computerdistribution.multipleschoolforms == "1")

{

xfa.form.Formular1.superframe.administratormain.administrator5.presence = "hidden"

xfa.form.Formular1.superframe.administratormain.administrator3.presence = "hidden"

xfa.form.Formular1.superframe.administratormain.administrator4.presence = "hidden"

}
Highlighted

Niederfuchs

02-09-2008

The app alert(this.rawValue) alone without any further code fires as expected - and gives exact the rawValues I am working with in the code...

I am completely puzzled....!
Highlighted

Niederfuchs

02-09-2008

Thanks to your

app.alert(this.rawValue)

I could narrow it down a little - the app.Alert stops firing as soon as I add the second condition - This works:



if(this.rawValue != 😎

{

app.alert(this.rawValue)

}



This doesn't:

if(this.rawValue != 8)&&(xfa.form.Formular1.superframe.administratormain.computerdistribution.multipleschoolforms == 1)

{

app.alert(this.rawValue)

}



although the data binding for the checkbox has been noted down correctly it is 0 and 1 - I don't know what to do about it...

Any suggestions?
Highlighted

Avatar

Guest

02-09-2008

Dear Soenke,

You have a syntax problem in if clause. The second contion must be as:



if(this.rawValue != "8" && xfa.form.Formular1.superframe.administratormain.computerdistribution.multipleschoolforms == 1)

{

app.alert(this.rawValue)

}



if(onecondition && secondcontion){

//do anything

}



Hope helps,



Asiye 🙂
Highlighted

Niederfuchs

09-09-2008

Unfortunately it still doesn't work...

A pity...

Even with no brackets and



else if(onecond && secondcond)

{

//do whatever

}

added...

It doesn't work...

I really need help here...
Highlighted

pguerett

09-09-2008

If you want to post your form to livecycle8@gmail.com I will have a look. Please include a description of the expected behaviour.
Highlighted

Avatar

Guest

10-09-2008

I have had a similar problem with the code not firing in a form with lots of other objects.



However when I copy the two objects interlinked (via an if statement) and paste into a blank form the code fires perfectly!



This behavior is driving me crazy also!



Here's the code - just in case:



if (Discharged_To.rawValue == "SNF" || "Custodial")

DischargedToForm.presence = "visible";

else

DischargedToForm.presence = "hidden";