Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Nadirfirfire
Posts: 192
Registered: ‎01-12-2010
My Device: Bold
My Carrier: ZAIN
Accepted Solution

PopupScreen

Dear Guys,

I wanted some assistence.

i have a scenario.

I want to display a popscreen where in i want to add ObjectChoice field and a button and then i want to add some events to the button.

 

I am developing using eclipse using 4.5.0 components

 

Can anyone point me right direction with some links or examples.

 

any help is higly appreciated

 

Many thanks

Nadir Firfire

 

Please use plain text.
Developer
simon_hain
Posts: 16,010
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: PopupScreen

well, sounds fairly straight forward. where exactly do you need assistance? post your code and mark your problems.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
Nadirfirfire
Posts: 192
Registered: ‎01-12-2010
My Device: Bold
My Carrier: ZAIN

Re: PopupScreen

This is the PopUp class
package zeo;

import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.component.Dialog;
import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.component.PasswordEditField;
import net.rim.device.api.ui.component.SeparatorField;
import net.rim.device.api.ui.container.PopupScreen;
import net.rim.device.api.ui.container.VerticalFieldManager;

public class PopUp extends PopupScreen {
	PasswordEditField answer;
	PopUp(){
		super(new VerticalFieldManager(),Field.FOCUSABLE);
		 LabelField question = new LabelField("Please enter password");
	       answer = new PasswordEditField(" ","");
	       add(question);
	       add(new SeparatorField());
	       add(answer);
	Dialog.alert("TEST");
	}


}

 

this is the code which is calling the popup class

but it seems its not calling since nothing is being displayed

FieldChangeListener listenerbtn = new FieldChangeListener()
	{

		public void fieldChanged(Field field, int context) {
			String fullText;
			if (field instanceof CustomButtonField) {
				fullText  = ((CustomButtonField)field).getText();
			Dialog.alert(fullText);
			//DialogFieldManager dfm = new DialogFieldManager();
			//dfm.add(Options);
			
			UiApplication.getUiApplication().popScreen(new PopUp());
			Dialog.alert("YA ALLAH SHOW ME THE WAY");
			//UiApplication.getUiApplication().
			}
			
		}
	};

 

Please use plain text.
Developer
simon_hain
Posts: 16,010
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: PopupScreen

well, you call super with a new vfm. there is nothing to display, then...

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
Nadirfirfire
Posts: 192
Registered: ‎01-12-2010
My Device: Bold
My Carrier: ZAIN

Re: PopupScreen

i got it

this is the code mistake

UiApplication.getUiApplication().pushScreen(new PasswordPopupScreen());//correct
instead of 
UiApplication.getUiApplication().popscreen(new PasswordPopupScreen());//wrong

 

thanks simon

 

Please use plain text.