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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Highlighted
Developer
Posts: 490
Registered: ‎07-16-2008
My Device: Not Specified
Accepted Solution

Yes No Cancel => Button

Hello guys'

 

I need Yes/No/Cancel dialog windows for my application.

If you have simple code, plz help me guys'

 

Tnx'

Developer
Posts: 507
Registered: ‎07-15-2008
My Device: Not Specified

Re: Yes No Cancel => Button

[ Edited ]

I have no sample code for that screen.

 

But I can advise you steps to implement it.

 

Implement a class that extends net.rim.device.api.ui.container.PopupScreen class and implements FieldChangeListener

 

Add 3 buttons to the screen, and setup the screen as a listener to these  buttons (note that buttons are fields from its nature)

 

And check in 

 

public void fieldChanged(Field field,
int context)

 

 

method which button has been pressed. And act according to the situation.

 

Good luck.

Message Edited by rafo on 09-08-2008 09:56 AM
----------------
if your issue solved set "Solution" mark at the relevant post
Developer
Posts: 213
Registered: ‎07-18-2008
My Device: Not Specified

Re: Yes No Cancel => Button

Hi Raiden,

 

checkout this article. It shows simple way to create a YES_NO dialog.

 

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800429/How_To_...

 

regards,

 

yosoh.

 

 

--------------------------------------------------
problemSolved() ? kudosPlease():kudosPlease();
Developer
Posts: 507
Registered: ‎07-15-2008
My Device: Not Specified

Re: Yes No Cancel => Button

yosoh, link you posted is about another point.

 

Raiden asked to create Yes/No/Cancel dialog.

 

You provided a link to standard Yes/No dialog. But there is no standard Yes/No/Cancel dialog.

 

And it should be implemented manually.

----------------
if your issue solved set "Solution" mark at the relevant post
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Yes No Cancel => Button

I would use Dialog to do this.  Sorry don't have any sample code immediately to hand, but have knocked up the following, untested, un-compiled code to show you what I mean.  There are other ways of using the Dialog too, but I'll let you review the docs.  Also I quite like using the style Dualog.LIST - give it a try.

 

Dialog d = new Dialog("Message", new String[] {"Yes", "No", Cancel", new int[] {1, -1, 0}, 0, Bitmap.getPredefinedBitmap(Bitmap.QUESTION)); d.doModal(); int result = d.getSelectedValue(); if ( result == 0 ) { // Cancel } else if ( result == 1 ) { // Yes } else { // No }

 

 

 

Developer
Posts: 490
Registered: ‎07-16-2008
My Device: Not Specified

Re: Yes No Cancel => Button

Tnx all' I got ur ideas'

 

Tnx again'