BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 05-19-2009, 04:01 AM   #1 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 7100T
PIN: N/A
Carrier: -
Posts: 73
Post Thanks: 0
Thanked 0 Times in 0 Posts
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 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 7100T
PIN: N/A
Carrier: -
Posts: 73
Post Thanks: 0
Thanked 0 Times in 0 Posts
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


Thread Tools

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Msa Altair 5 Battery
$75.0
Msa Altair 5 Battery pictureMsa Altair 4x Wall Charger With Multiple Outlet Attachments
$18.0
Msa Altair 4x Wall Charger With Multiple Outlet Attachments pictureAltair Lighting 3" Recessed Light Kit with Swivel Trim And 50 Watt Bulbs,
$16.22
Altair Lighting 3MSA Altair Pro Single-Gas Detector - Hydrogen Sulfide (H2S) - 10074136
$420.0
MSA Altair Pro Single-Gas Detector - Hydrogen Sulfide (H2S) - 10074136 pictureMsa Altair 5 And 5x Car Charger
$25.0
Msa Altair 5 And 5x Car Charger picture






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