BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 05-19-2009, 04:01 AM   #1
misty83
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 7100T
PIN: N/A
Carrier: -
Posts: 73
Default onClick method for a Dialog?

Please Login to Remove!

hi, i need to have such a thing - a dialog with added three editFields where i can put text and a 'ok' button. and after i click 'ok' my method will be called. Earlier i did it like this:
Code:
 BasicEditField _name = new BasicEditField("Name: ", "");
 BasidEditField _surname = new BasicEditField("Surname: ", "");
 BasicEditField _password = new PasswordEditField("Password: ", "");
	 
UiEngine _ui = Ui.getUiEngine();
Screen _screen = new Dialog(Dialog.D_OK, "Please enter:", Dialog.D_OK,
Bitmap.getPredefinedBitmap(Bitmap.TRUE_BLACK),
	Manager.VERTICAL_SCROLL);
	
//add editFields	
_screen.add(_name);
_screen.add(_surname);
_screen.add(_password);
but i do not know how to do, that after i click 'ok' my method will be called...
Offline  
Old 05-19-2009, 06:26 AM   #2
misty83
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 7100T
PIN: N/A
Carrier: -
Posts: 73
Default

ok, i've solved it. here is the code:
Code:
UiApplication.getUiApplication().invokeLater(new Runnable(){
			public void run(){

				
   final Dialog d = new Dialog("Enter:",
   new String [] {"Ok"},
   new int [] { Dialog.OK },
              Dialog.OK,
              Bitmap.getPredefinedBitmap(Bitmap.QUESTION));

  BasicEditField _user = new BasicEditField("User: ", "");
				   
   A _a = new A();
				   
   d.setDialogClosedListener(_a);
   d.add(_user);
   d.show();
				
					
	}});
where A is:
Code:
static final class A implements DialogClosedListener{
	
	private Klasy _klasy = new Klasy();
	
	public void dialogClosed(Dialog _dialog, int _choice){
                 myMethod();		
	}
}
kind regards
Offline  
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


INTEL XEON E5 2520V2 E5 2620V2 SR1AN 2.10 GHZ Core Processor 3401A832 picture

INTEL XEON E5 2520V2 E5 2620V2 SR1AN 2.10 GHZ Core Processor 3401A832

$12.00



INTEL C1P87A XEON PHI PROCESSOR 5110P picture

INTEL C1P87A XEON PHI PROCESSOR 5110P

$29.99



INTEL S5000PSL Multi-Core Xeon Motherboard / Server Board w/ 2X L5420 & 2X2G RAM picture

INTEL S5000PSL Multi-Core Xeon Motherboard / Server Board w/ 2X L5420 & 2X2G RAM

$61.62



HPE Intel Xeon E5-2630L v4 Docosa-core [22 Core] 2.20 GHz Processor Upgrade - picture

HPE Intel Xeon E5-2630L v4 Docosa-core [22 Core] 2.20 GHz Processor Upgrade -

$66.76



Kit xeon Maxgeek DSE6020 MKII Generator Controller Generator Set Control Panel picture

Kit xeon Maxgeek DSE6020 MKII Generator Controller Generator Set Control Panel

$132.00



1 Pc Home Intel Xeon Silver Sclip 4110 Linux   - NEW picture

1 Pc Home Intel Xeon Silver Sclip 4110 Linux - NEW

$245.00







Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.