Page 1 of 1

how to return and ID from a showSelectDialog

PostPosted: Thu Sep 09, 2004 12:28 pm
by elmono_acosta
Let say the list on the dialog is: (what the user sees)

company1
company2
company3

I want to recive as a parameter not the string companyX but the id for the companyX.

Is it possible ?

PostPosted: Thu Sep 09, 2004 2:59 pm
by automazione
Probably what you need is a valuelist like this one:

Company1|1
Company2|2
Company3|3

Then if you use a combobox with this valuelist... Company1/company2/company3 will be displayed and 1 / 2 / 3 will be stored in the field.

Remember to set the field as NOT editable.... if you leave it to editable the "companyX" or whatever you type in the field will be stored

hope this was what you were looking for

bye

PostPosted: Mon Jan 28, 2008 4:14 pm
by Harjo
I have the same issue here.

Enrico, I know how it works with a combobox on a form,

but with the plugins.showSelectDialog, I can't get it to work.

Is it even possible with the showSelectDialog to give an array, with displayvalues and returnvalues??

PostPosted: Mon Jan 28, 2008 4:26 pm
by patrick
As far as I know that is not possible. The dialog will return the String the user selected. You will then have to loop and find the ID yourself. Of course, you could consider using our DialogPro plugin which allows you to do that sort of thing.

PostPosted: Mon Jan 28, 2008 4:32 pm
by Harjo
oke, Patrick, thanks for the clarification.

I have to create my own dialog than....

same problem

PostPosted: Fri Mar 14, 2008 1:58 am
by lesouef
Just coming across the same pb...
To me this is a kind of bug as it displays values to be returned instead of values to be displayed.
The temp workaound I am using is to set both id and name to be returned in the list, with a separator character set, then strip the answer of the showSelectDialog to recuperate only the id.

PostPosted: Fri Apr 25, 2008 7:46 pm
by Providence1
I would love for this to be fixed too!

It says in the example:
Code: Select all
plugins.dialogs.showSelectDialog( dialog_title,  msg,  optionArray/option1,  [option2],  [optionN])



But when I treat it to some array values...
Code: Select all
ds.getColumnAsArray(1), ds.getColumnAsArray(3)

or
Code: Select all
aResult[0], aResult[2]


... I get java errors in return. However, one array value works.
Code: Select all
ds.getColumnAsArray(1)


or

Code: Select all
aResult[0]