how to return and ID from a showSelectDialog

Find out how to get things done with Servoy. Post how YOU get things done with Servoy

how to return and ID from a showSelectDialog

Postby elmono_acosta » Thu Sep 09, 2004 12:28 pm

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 ?
elmono_acosta
 
Posts: 41
Joined: Thu Jun 17, 2004 11:52 am

Postby automazione » Thu Sep 09, 2004 2:59 pm

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
Enrico Arata
Servoy Italia
automazione
 
Posts: 366
Joined: Thu Apr 24, 2003 11:37 am
Location: Torino, Italy

Postby Harjo » Mon Jan 28, 2008 4:14 pm

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??
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Postby patrick » Mon Jan 28, 2008 4:26 pm

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.
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Postby Harjo » Mon Jan 28, 2008 4:32 pm

oke, Patrick, thanks for the clarification.

I have to create my own dialog than....
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

same problem

Postby lesouef » Fri Mar 14, 2008 1:58 am

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.
lesouef
 
Posts: 420
Joined: Thu Oct 20, 2005 8:13 pm
Location: Strasbourg & Paris - France

Postby Providence1 » Fri Apr 25, 2008 7:46 pm

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]
Providence
Providence1
 
Posts: 456
Joined: Tue Aug 17, 2004 2:36 am
Location: New York, NY


Return to How To

Who is online

Users browsing this forum: No registered users and 6 guests

cron