These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Force collapsed tree view in function (dialog) - javascript

Phlox
Registered: May 6 2010
Posts: 6

Greetings,

I am using LiveCycle Designer 8.2.1.

I created a JavaScript event, when I klick on a field, a dialog (file tree) containing diffent branches opens, each branch including several cost centers to choose from. The whole tree is expanded by default, I do not want this. How do I force the items to be collapsed?

Phlox
Registered: May 6 2010
Posts: 6
This is the code. I hope this helps to solve the issue:


Formular1.Formular.Seite1.deutsch.#area[0].abteilung::mouseUp - (JavaScript, client)


var kst = {
"Standort1":{
"1111111111 Vorstand":1,
"1111111112 Personalmanagement":2,},
"Standort2":{
"2222222222 Personalmanagement":902,
"2222222223 Instandhaltung":903,
},};
var dialog3 = {
initialize: function(dialog){
var dlgInit =
{
subl:kst,
};
dialog.load(dlgInit);
},
commit: function(dialog){
var oRslt = dialog.store();
abteilung.rawValue = oRslt["stat"];
},
"subl": function(dialog){
var nReturn;
var Elements = dialog.store()["subl"];
nSuche(Elements);
newStatus(dialog, nReturn);

function nSuche(nVariable){
for (var i in nVariable){
if(nVariable > 0){
nReturn = nVariable;
break;
}
else{
nSuche(nVariable);
}
}
}
},
loadDefaults: function (dialog){},
description:{
name: "Abteilungsauswahl",
elements:
[
{
type: "view",
align_children: "align_left",
elements:
[
{
type: "cluster",
name: "Auswahl",
elements:
[
{
type: "hier_list_box",
item_id: "subl",
width: 600,
height: 400
},
{
type: "static_text",
name: "Vorschau",
width: 200,
},
{
type: "edit_text",
item_id: "stat",
multiline: true,
readonly: true,
width: 200,
height: 60
},
{
type: "static_text",
name: "Bitte Abteilung auswählen!",
width: 200,
},
]
},
{
type: "ok_cancel"
}
]
}
]
}
}
app.execDialog(dialog3);

function newStatus(dialog, nValue){
var nWerte = new Array();
nWerte[1] = "Vorstand";
nWerte[2] = "Personal";
nWerte[902] = "Personalmanagement";
nWerte[903] = "Instandhaltung";

for (var i in nWerte){
if(i == nValue){
dialog.load({"stat":nWerte});
}
}
}
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
The "hier_list_box" seems to have property that can be manipulated to collapse the view when opening the dialog.

Check out this thead for a similar solution:
[url]http://www.acrobatusers.com/forums/aucbb/viewtopic.php?id=19940[/url]

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs