Copy link to clipboard
Copied
Hello everyone and greetings
I have a question about List Box
I made a dialog using a text box and a list box
And I added text with lines inside the edit box
But when you add it inside the list box, the texts appear next to each other
I want to make the list box display the texts, but each separate line the same inside the edit box
Note that I will be fetching the data from a text file
I attached an explanatory text file with examples of data.. I also just wrote the code to be modified
This is the attached file to show the data type
https://drive.google.com/file/d/1ayJisFqELn5TKJfoQzihzBjE7Xz4Qhku/view?usp=sharing
var window = new Window('dialog', "قاعدة بيانات العملاء - ابن ØÙ…يدو");
var Example= window.add ('edittext {preferredSize: [650, 150] ,justify: "right", active: true,properties:{ multiline: true}}'); Example.graphics.font = "Tahoma-Bold:14";Example.enabled = true
var array = "E.Hamedoooo@gmail.com _ 01033032007 _ Hameed" + "\n" +
"E.Hamedoooo@gmail.com _ 010050 _ Khalid Hameed" + "\n" +
"E.Hamedoooo@gmail.com _ 0120115020 _ Waled Hameed" + "\n"+
"E.Hamedoooo@gmail.com _ 01033032007 _ Hameed"+"\n"+
"E.Hamedoooo@gmail.com _ 0120115020 _ Waled Hameed"+"\n"
// or I get this items from txt file on my pc
Example.text= array
var listBox = window.add("listbox", undefined, "" ,
{
numberOfColumns: 1,
showHeaders: true,
//multiselect:true,
columnTitles: ['Name'] ,
columnWidths: [150],
columnheights:[50,50],
});
listBox.graphics.font = "Tahoma-Bold:14";
listBox.itemSize= [50,100];
listBox.size = [650, 200];
listBox.add("item", array );
window.center();
window.show();
array=array.split('\n'); while(array.length-1) listBox.add('item',array.shift())
Copy link to clipboard
Copied
That's not how you specify an array.
Copy link to clipboard
Copied
array=array.split('\n'); while(array.length-1) listBox.add('item',array.shift())
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more