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
Posts: 713
Registered: ‎05-31-2010
My Device: 8520
My Carrier: Movistar

Problem with PopupScreen on device

Hi

I have a dialog when the user can add some information and attach two butons to it, OK and cancel and implemente FieldChangeListener. When I created the button I did :

btnOK = new ButtonField("Aceptar", ButtonField.CONSUME_CLICK
	| ButtonField.HCENTER | Manager.USE_ALL_WIDTH);
btnOK.setChangeListener(this);

 And in my fieldChanged I have this :

 

MyLog.log("Entre a fieldChanged");

if (field.equals(btnOK)) {
	String numeroLicencia = efNumeroLicencia.getText().trim().toUpperCase();
	if (numeroLicencia.length() == 0) {
		BlackBerryUtils.showAlertDialog("Debe especificar el número de licencia.");
	    efNumeroLicencia.setFocus();
	     return;
    }

	String descLicencia = efDescripcion.getText().trim();
	if (descLicencia.length() == 0) {
	   BlackBerryUtils
			.showAlertDialog("Debe especificar la descripción de la Licencia.");
	   efDescripcion.setFocus();
	  return;
    }

    currentValue.setNumero(numeroLicencia);
    currentValue.setDescripcion(descLicencia);

    BlackBerryUtils.showAlertDialog(currentValue.getNumero() + "-" + currentValue.getDescripcion());
    this.close();
}

 Howeever it does not write in my log the message in this method, it looks like it does not execute this code.

But in the simulator works fine. The problem is on device and I can not able to figure out what's goin on...

 

Some hint, please

Developer
Posts: 246
Registered: ‎09-30-2010
My Device: Z10, Onyx2
My Carrier: IND XL

Re: Problem with PopupScreen on device

i dont think there is a problem with your code for

MyLog.log("Entre a fieldChanged");

Developer
Posts: 87
Registered: ‎02-20-2011
My Device: Not specified

Re: Problem with PopupScreen on device

[ Edited ]

ignore me. thanks simon.

------------------------------------------------------------------------------------------
1. Feel free to press the like button on the right side to thank the user that helped you.
2. Please mark posts as solved if you found a solution.
Highlighted
Developer
Posts: 16,987
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Problem with PopupScreen on device

please ignore lastone, equals is fine.

can you debug on the device? set a breakpoint and check what happens.
----------------------------------------------------------
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