plugins.dialogs.showSelectDialog & arrays

Discuss all problems you have with Servoy here. It might help to mention the Servoy version and Operating System version you are using

plugins.dialogs.showSelectDialog & arrays

Postby IT2Be » Sat Jan 03, 2004 9:38 pm

I have a line of code like:

var answer = plugins.dialogs.showSelectDialog('Attention...', 'Question?', myArray);

As you understand, myArray is an array and a correct one (I have checked that). But, when I use this the listbox is filled with java messages like:

org.mozilla.javascript.NativejavaObject@b9b26a etc.

Is this me doing something wrong or is this a bug?

I really need to fill it with an array since I don't know on forehand what to fill the combobox of this dialog with...
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Postby maarten » Sun Jan 04, 2004 10:14 am

Does this code work?

var myArray = new Array('one','two','three');
var answer = plugins.dialogs.showSelectDialog('Attention...', 'Question?', myArray);
Maarten Berkenbosch
User avatar
maarten
 
Posts: 797
Joined: Wed Apr 23, 2003 10:52 pm
Location: Amersfoort, Netherlands

Postby jcompagner » Sun Jan 04, 2004 4:14 pm

Can you post me an example how you make youre array?
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8872
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby IT2Be » Sun Jan 04, 2004 5:22 pm

Yes, maarten your code works.

Strange because I have checked the result of the below code and that is ok...

But ok here is the code:

var query = 'SELECT * FROM table WHERE field = 1 ORDER BY field1';
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 100);
var myArray = new Array(dataset.getMaxRowIndex());

for ( var i = 0 ; i < dataset.getMaxRowIndex() ; i++ )
{myArray[i] = dataset.getValue(i + 1, 1);}

var answer = plugins.dialogs.showSelectDialog('Attention', 'Question', myArray);
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Postby jcompagner » Sun Jan 04, 2004 5:27 pm

What type should dataset.getValue(i + 1, 1) return?
String? (then it will be fixed in the next beta (b6)
But i will look into it a bit further.. Because it seems that javascript array's are not always converted to java arrays .
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8872
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby jcompagner » Sun Jan 04, 2004 5:58 pm

fixed it. (next beta: b6)
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8872
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby IT2Be » Mon Jan 05, 2004 12:41 pm

Thanks Johan...
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany


Return to Discuss possible Issues and Bugs

Who is online

Users browsing this forum: Bing [Bot] and 6 guests