UI woes: multi-column listbox

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
berniebernie
Posts: 33
Joined: February 7th, 2005, 7:32 am
Contact:

Hello coders. I feel like I'm alone here.

I'm trying to use a listbox with column titles, as mentioned in the javascript tools guide. However I get a nasty (and seldom seen) error message upon executing the code:

Code: Select all

Server interface error ''
the code i'm using is

Code: Select all

var list = pal.add ("ListBox", [10, 50, 260,320], "desc",{numberOfColumns: 2,showHeaders: true,columnTitles: ['Shot', 'Status']});        
Boom boom boom.
User avatar
vfxman
Posts: 49
Joined: February 23rd, 2007, 7:00 pm
Location: California
Contact:

If I add a new window via this code, it shows up fine.

Code: Select all

//"undefined" would be the window size. undefined=auto size and [0,0,200,300] would be specific pixel size 200 width x 300 height;
var pal = new Window("palette", "LIST", undefined);
var list = pal.add ("ListBox", [10, 50, 260,320], "desc",{numberOfColumns: 2,showHeaders: true,columnTitles: ['Shot', 'Status']});
pal.center()
pal.show();
Image
philspitler
Posts: 39
Joined: November 2nd, 2005, 10:20 am
Contact:

Hi David,
Your code works in Extended Script but gives me and error when I try and run it in AE.

I just posted a question with some other ListBox issues too,

Phil
Phil Spitler
User avatar
vfxman
Posts: 49
Joined: February 23rd, 2007, 7:00 pm
Location: California
Contact:

philspitler wrote:Your code works in Extended Script but gives me and error when I try and run it in AE.
I ran into the same thing last weekend. I had forgotten about this post, thanks for the reminder. Here is what I found worked in AE for me.

Code: Select all

{
var res = "dialog\
myListbox: ListBox { alignment:['fill','fill'], properties:{\
	multiselect:true, \
	numberOfColumns:5, \
	showHeaders:true, \
	columnTitles: ['Header 1', 'Header 2', 'Header 3', 'Header 4', 'Header 5', ]}\
}";

var myPalette = new Window(res);	//Creates Window

///	Row 1 Contents
var myItem1 = myPalette.myListbox.add ('item', 'Cell 1-1');
	myItem1.subItems[0].text = 'Cell 1-2';
	myItem1.subItems[1].text = 'Cell 1-3';

///	Row 2 Contents
var myItem2 = myPalette.myListbox.add ('item', 'Cell 2-1');
	myItem2.subItems[0].text = 'Cell 2-2';
	myItem2.subItems[1].text = 'Cell 2-3';

///	Row 3 Contents
var myItem3 = myPalette.myListbox.add ('item', '');
	myItem3.subItems[0].text = '';
	myItem3.subItems[1].text = '';
	
myPalette.show();	//Shows final Window with contents
}
Post Reply