Is it possible to open a combobox at runtime?

Questions and answers for designing and implementing forms in Servoy

Is it possible to open a combobox at runtime?

Postby m.moest » Fri Feb 08, 2013 8:30 pm

Is it possible to open a combobox at runtime? so, without clicking on it yourself.
Something like:

elements.MyCombobox.open();


My goal is to open a combobox when a button is clicked.
m.moest
 
Posts: 5
Joined: Fri Feb 08, 2013 8:22 pm

Re: Is it possible to open a combobox at runtime?

Postby Hans Nieuwenhuis » Sat Feb 09, 2013 1:41 pm

You could try elements.MyCombobox.requestFocus([false/true)

Regards,
Hans Nieuwenhuis
Betagraphics
http://www.deltics.nl
http://www.betagraphics.nl

Servoy Version 7.3.1
Java version 1.7.0.x
Database Oracle 11g
User avatar
Hans Nieuwenhuis
 
Posts: 1026
Joined: Thu Apr 12, 2007 12:36 pm
Location: Hengelo, The Netherlands

Re: Is it possible to open a combobox at runtime?

Postby m.moest » Mon Feb 11, 2013 4:29 pm

Thanks for the reply!

Your solution works fine in the smartclient, but if i run it in the webclient it only selects the combobox and it doesn't open the combobox. So, is it not webclient compatible? And if it's not webclient compatible, is there another solution?
m.moest
 
Posts: 5
Joined: Fri Feb 08, 2013 8:22 pm

Re: Is it possible to open a combobox at runtime?

Postby maria.kyselova » Tue Feb 12, 2013 7:37 am

Hans Nieuwenhuis wrote:You could try elements.MyCombobox.requestFocus([false/true)

Regards,


That solution is actually annoying us :)
When I tab between my form elements I don't want my combos to open at all.
Will log an issue to fix it, so beware :wink:
Cheers,
Maria
maria.kyselova
 
Posts: 172
Joined: Thu Aug 09, 2012 12:56 am

Re: Is it possible to open a combobox at runtime?

Postby jdbruijn » Tue Feb 12, 2013 9:32 am

maria.kyselova wrote:When I tab between my form elements I don't want my combos to open at all.
Will log an issue to fix it, so beware :wink:

Try this:
Code: Select all
application.putClientProperty(APP_UI_PROPERTY.COMBOBOX_SHOW_POPUP_ON_FOCUS_GAIN, false);
Jos de Bruijn
Welcome CCS
Servoy Certified Developer
Image
jdbruijn
 
Posts: 466
Joined: Sun Apr 11, 2010 6:34 pm

Re: Is it possible to open a combobox at runtime?

Postby maria.kyselova » Mon Feb 18, 2013 3:42 am

jdbruijn wrote:
maria.kyselova wrote:When I tab between my form elements I don't want my combos to open at all.
Will log an issue to fix it, so beware :wink:

Try this:
Code: Select all
application.putClientProperty(APP_UI_PROPERTY.COMBOBOX_SHOW_POPUP_ON_FOCUS_GAIN, false);


Awesome!

Thanks, Jos.
Cheers,
Maria
maria.kyselova
 
Posts: 172
Joined: Thu Aug 09, 2012 12:56 am

Re: Is it possible to open a combobox at runtime?

Postby jasantana » Mon Feb 18, 2013 10:55 am

Just to add some more to Jos post.

You can set that property to certain elements:

Code: Select all
forms.someForm.elements.comboboxElement.putClientProperty(APP_UI_PROPERTY.COMBOBOX_SHOW_POPUP_ON_FOCUS_GAIN, true);
Best regards,
Juan Antonio Santana Medina
[email protected]
EAGER BEAVER 2011
EAGER BEAVER 2012
Servoy 6.x - Servoy 7.x - Servoy 8.x - MySQL - PostgreSQL - Visual Foxpro 9
User avatar
jasantana
 
Posts: 547
Joined: Tue Aug 10, 2010 11:40 am
Location: Leeds - West Yorkshire - United Kingdom


Return to Forms

Who is online

Users browsing this forum: No registered users and 4 guests

cron