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.

Problem with listbox

Avatar

Level 4

Good afternoon all,

I am having problem with the following code. I have 3 items in a listbox. This code should populate the drop down list depending on what is selected in the list box. It is however, not working. 

Please I need help with the code below,

On calculate event;

If(Listbox1.rawValue==1){

DropDownList1.rawValue="P";

}

else if (Listbox1.rawValue="2"){

    DropDownList1.rawValue="J" 

}

else if (Listbox1.rawValue="3"){

    DropDownList1.rawValue="H" 

}

else if (Listbox1.rawValue="4"){

   DropDownList1.rawValue=null;

  xfa.host.setFocus(DropDownList1);

}

Thanks

v/r

Tammy

3 Replies

Avatar

Level 7

try putting the code into the exit event of the listbox

Avatar

Level 3

I agree with whyisthisme. For some reason, putting code on the "change" event of a listbox doesn't seem to work. You have to put it under the exit event.

Avatar

Level 10

The reason it doesn't work is that the rawValue does not exist when the change event occurs.

The grab a value during the change event use "xfa.event.newText" instead.