Expand my Community achievements bar.

populating several textgroups based on two dropdown lists troubles

Avatar

Level 3
  1. Hi All,
I have a dropdown list (case1) which contents "engine1", "engine2" and "engine3" and a second dropdown list (Component).

If i select in "case1" = "engine1" then in "component" should be displayed "Motor" and "burner".
it works this way...that's everything fine.
----- form1.#subform[0].#subform[1].Case1::enter: - (JavaScript, client) -----------------------

var

arrayItems = eval(Case_1.value);

for

(var i=0; i < arrayItems.length; i++) {

this.addItem(arrayItems[i]);

}

----- form1.#subform[0].#subform[1].Case1::change: - (JavaScript, client) --------------------------

if

(xfa.event.newText=="Engine1" || "Engine2" || "Engine3" );

var

arrayItems = eval(Comp_0.value);

for

(var i=0; i<arrayItems.length; i++) {

Component.addItem(arrayItems[i]);

}

----- form1.#subform[0].#subform[1].Component::enter: - (JavaScript, client) -----------------------

if

(xfa.resolveNode("form1.#subform.Case1").rawValue == "Engine1")

{

xfa.resolveNode("form1.#subform.Component").clearItems();

var arrayItems = eval(Comp_0.value);

for (var i=0; i < arrayItems.length; i++)

{

this.addItem(arrayItems[i]);

}

}

if

(xfa.resolveNode("form1.#subform.Case1").rawValue == "Engine2")

{

xfa.resolveNode("form1.#subform.Component").clearItems();

var arrayItems = eval(Comp_0.value);

for (var i=0; i < arrayItems.length; i++)

{

this.addItem(arrayItems[i]);

}

}

if

(xfa.resolveNode("form1.#subform.Case1").rawValue == "Engine3")

{

xfa.resolveNode("form1.#subform.Component").clearItems();

var arrayItems = eval(Comp_0.value);

for (var i=0; i < arrayItems.length; i++)

{

this.addItem(arrayItems[i]);

}

}

then if i select "motor" then should be visible a group "engine1Motor", "engine2Motor", "engine3motor".

if i decide to select "burner" after "motor" the group which belongs to Motor should stay visible and a new group should which belongs to burner "engine1burner1", "engine1burner2", "engine1burner3" should be visible.
and if case2 is filled then a new goup "1.ifcase2", "2.ifcase2", "3.ifcase2" should be visible.

I tried it this way but it doesnt work :-(

----- form1.#subform[0].#subform[1].Component::change: - (JavaScript, client) ----------------------

if

(xfa.resolveNode("form1.#subform[0].Case1.rawValue") == "Engine1")

{

xfa.resolveNode("form1.#subform.Component.rawValue")

== "engine1Motor";

Motor.presence

= "visible";

}

else

{

Motor.presence

= "hidden"

}

who can help me to solve this problem??

Thank u!!

D.

0 Replies