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


Everbilt Soft Type L Coil Copper 5/8

Everbilt Soft Type L Coil Copper 5/8"OD x 1/2"ID 20Ft LSC4020PS

$38.61



Nu-Calgon 4171-75 Evap Foam No Rinse Coil Cleaner-18oz, 6 Pack picture

Nu-Calgon 4171-75 Evap Foam No Rinse Coil Cleaner-18oz, 6 Pack

$74.99



ASCO COIL 027473-002 picture

ASCO COIL 027473-002

$199.00



HAYS 2192-6021 COIL-NO BOX picture

HAYS 2192-6021 COIL-NO BOX

$150.23



ASCO Coil 110/120V 099257-005-D picture

ASCO Coil 110/120V 099257-005-D

$125.00



NAMCO COIL EB20173245 picture

NAMCO COIL EB20173245

$220.95







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