Expand my Community achievements bar.

Generating a new table based on user choices - Code Problems

Avatar

Level 2

A while ago someone posted on one of the Adobe forums the following code (sorry I do not remember the name / link). This code is meant to generate a second table (an Object list in this case) according to the user’s choices at another table (in this case a dropdown list):

form1.TableA.TableTitles.Row1.DropDownList1::change - (JavaScript, client)

/////////////////////////////////////////////////////////////////////////////

var str_itemtext = xfa.event.newText;

var olist2 = xfa.resolveNode("form1.TableA.TableTitles.Row2.ListBox2");

var arrayADVS = new Array("Acad", "Disp", "Advs");

var arrayCD = new Array("Proj-", "HRS");

if (str_itemtext == "ADVS") {

makelist(olist2, arrayADVS);

olist2.presence = "visible";

}

else if (str_itemtext == "CD"){

makelist(olist2, arrayCD);

olist2.presence = "visible";

}

function makelist(olist, arrayitem) {

var i = 0;

olist.clearItems();

for (i = 0; i < arrayitem.length; i ++){

olist.addItem(arrayitem[i], arrayitem[i]);

}

I made a couple of minor changes but generally preserved the original code and it seemed to work fine. The problem arises after the completed form is saved:- the “object list” (second table) disappears even though I set it as visible. I tried changing the Type (from user entered required to read only) but to no avail.

Could someone please help me figure out what is wrong with this code? Why does this Object List object disappears after the form is saved?

Thanks.

1 Reply

Avatar

Former Community Member

If you could post the form or send a copy to stwalker.adobe@gmail.com I would be happy to take a look, otherwise, it is hard to diagnose.

Steve