Field button to access a BlackBerry 7 application dialog box

How to access button of the dialog (Ok, Cancel etc.) field if we create a dialog as follows:

public static void showDialog(String iMsg) {

        Dialog dialog = new Dialog(Dialog.D_OK_CANCEL, iMsg, Dialog.CANCEL,
                null, 0);
        dialog.setChangeListener(new FieldChangeListener() {

            public void fieldChanged(Field field, int context) {

                if (field.getState() == Dialog.OK) {
                    Status.show("Ok Clicked", 1000);
                } else if (field.getState() == Dialog.CANCEL) {
                    Status.show("Cancel Clicked", 1000);
                } else {
                    Status.show("None Clicked", 1000);
                }

            }
        });
        dialog.show();

    }

I am trying to access like that, but not yet managed.

I had another effective way to take action on the button of the dialog field actions is:

public static void showDialog(String iMsg) {

        int response = Dialog.ask(Dialog.D_OK_CANCEL, iMsg);
        if (response == Dialog.OK) {
            Status.show("Ok Clicked", 1000);
        } else if (response == Dialog.CANCEL) {
            Status.show("Cancel Clicked", 1000);
        } else {
            Status.show("None Clicked", 1000);
        }

    }

But I want to know if its possible to show set button of the dialog field action if we follow the first way to create the dialog box.

Problem solved:

OK to be registered listener DialogClosedListener and good code is

public static void showDialog(String iMsg) {

        Dialog dialog = new Dialog(Dialog.D_OK_CANCEL, iMsg, Dialog.CANCEL,
                null, 0);

        dialog.setDialogClosedListener(new DialogClosedListener() {

            public void dialogClosed(Dialog dialog, int choice) {

                if (choice == Dialog.OK) {
                    System.out
                            .println("********************************************   OK");
                    Status.show("Ok Clicked", 1000);
                } else if (choice == Dialog.CANCEL) {
                    System.out
                            .println("********************************************   Cancel");
                    Status.show("Cancel Clicked", 1000);
                } else {
                    System.out
                            .println("********************************************   None");
                    Status.show("None Clicked", 1000);
                }

            }
        });

        dialog.show();

Tags: BlackBerry Developers

Similar Questions

  • JNLP: I always get a security for a signed application dialog box

    Hello

    because of the more recent java-version wa had to sign our application.

    It also works with a jnlp model in our main pot, but according to this site: what should I do when I see a security invites since Java?

    We should have an option to set 'do not show this again once for Editor applications and location above '.

    Whenever I start the jnlp (1.7u67) I get the dialog box of security with a properly verified application (information Blue Shield) but cannot remove the dialog box for the next time. :-(

    Because the application requires access to local resources the jnlp contains

    < security >

    < all-permissions / >

    < / security >

    and the manifest signed jars

    Only trusted: true

    Trust-library: true

    Permissions: permissions everything

    CodeBase: *.

    What can I do to avoid the security warning?

    If this was not clear (sorry!), I was suggesting that you add the Application Library eligible Codebase attribute for your manifest.

  • Detect which button was selected from a message popup dialog box

    I'm sure I've done this before and don't remember how I did it.

    I even searched the forum for messages but did not find any.

    I have a popup message asking if a number was on.

    It has two buttons "YES" & "

    I want to know which button has been selected in order to assign a pass/fail for the LED Test result.

    How to achieve this?

    R

    Step.Result.ButtonHit

    There will be 1 or 2 or more if you have more than 2 buttons

    Omar

  • How can I stop the 'Photos' Apple application dialog box to appear each time I insert a SD card into my iMac for import into Lightroom?

    Whenever I insert a SD card into my iMac in order to import images, the Apple "Photos" application import dialog - as the default value. How can I stop this from happening?

    Thank you

    Brian

    Hi Brian,.

    You can consult this article to stop the Photos App to launch itself:

    http://osxdaily.com/2015/05/31/stop-photos-opening-automatically-Mac-OS-x/

  • Values in a dialog box application answering the multi-line text box field

    Hello

    When the user clicks on a radio button in my form a response request dialog box is displayed for the user to enter data.

    The value of the response dialog box is then added to a multiline text box.

    The script is on the mouse to the top of the radio button action and works fine the first time you click on the radio button.

    If the radio button is checked once again, the value of the response dialog box replaces the existing value in the multiline text box.

    What I need to do, is to have the response values show on a new line in the text box whenever you click on the option button.

    Can any advise please how to revise my script to work?

    Target for the field multiline text box

    var t = this.getField ("ActionAgenda");

    Response from dialog when the user clicks on the radio button

    var cResponse = app.response({)

    cQuestion: "enter your Action Agenda Item."

    ({CTitre: 'Action program'});

    Alert if you cancel

    If (cResponse == null) {}

    App.Alert ("Action point not will be not entered");

    Place the data in the dialog box in the target domain

    } else {}

    t.Valeur = cResponse;

    }

    Any help will be greatly appreciated.

    Thank you

    Change this line:
    t.Valeur = cResponse;

    To do this:
    t.Valeur += "\n" + cResponse;

  • CS6: Accessibility attributes dialog box tags entry for forms

    is the tag input of the accessibility attributes exist in the dialog box for forms? It does not appear when I click on the text field button.

    THX...

    Hi theshortstraw,

    This feature has been deprecated in 12.2. What version do you have?

    Also see this video http://tv.adobe.com/watch/learn-dreamweaver-cc/html5-forms-workflow/

    Thank you

    Preran

  • A button dialog box appears intermittently

    Has anyone encountered any instance where they ran of code that contains a call to a Dialog.vi button and didn't do not display dialog box?

    I write the code at present which is to launch a "Sample Communication Controller.lvclass" player. I tried to make calls for dialogue in instances overridden "Pre launch Init.vi" and "Core.vi actor". In both cases, whenever I run the actor often the dialog box does not appear. The code below illustrates my second attempt, when I tried to put the call on "Example of Communication Controller.lvclass:Actor Core.vi" (not done as an extract VI because the extract VI feature is buggy).

    I rolled my own logging system and use I think 'Example Communication controller begins!' is recorded systematically whenever the player is launched, if yes or no dialog box appears.

    Flat sequence structure is temporary and just an attempt to see if the data dependencies change has an effect.

    Just a long shot, but the dialog box button requires root loop. If something else is hogging the loop of the root, I could see what is happening, although I expect the code to hang.

    A simple test would be to replace the dialog box a button with a dialog of three buttons (see link for details).

  • FF8 + dialog box popup "application/vnd.wap.xhtml+xml" when you access a Web site.

    FF8 cannot use the www.translink.com.au trip planner.

    When I fill in the fields and click on 'Find journey' - a dialog box appears

    "You have chosen to open the trip planner.
    which comes from application/vnd.wap.xhtml+xml a: (27.6 KB): http://jp.translink.com.au
    What should Firefox do with this file?
    Opened with Browse...
    Save the file.

    Also a few other buttons on this site do the same thing, for example. On this page and train travel planner:
    http://TransLink.com.au/travel-information/services-and-timetables/buses/Route-204
    -If you click on the button 'Show time' - it does the same thing.

    This site worked before ok with FF7 and IE8.
    A release with the troubleshooter from the site Web - no response.
    Now it is unusable and don't know what to do.

    Other than this problem only seem to work ok - FF8 so this Web site is to blame?

    Googled the problems forums and looked for a solution - it's a problem similar to mine:
    http://support.Mozilla.com/en-us/questions/796303?s=application%2Fvnd.WAP.XHTML%2Bxml & r = 1 & s = ACE

    PS - to confirm - I use a desktop pc with a mobile broadband usb dongle.

    I hope someone can help.
    Thanks in advance.

    "FF8 + dialog box popup"application/vnd.wap.xhtml+xml"when you access a Web site."

    THE PROBLEM ABOVE IS NOW COMPLETELY RESOLVED.

    The site in question was the problem - NOT 8 Firefox or Linux Mint.

    The site has been fixed and now works as it should.

    If someone else gets a dialog box pop-up similar box to the above - suggest that they contact the administrator of the website the problem and inform them that their site user agent detection Web is not correctly identify your version of Firefox mobile browser and so redirecting to a mobile version, return of mobile specific markup (Content-Type).

    Check the Whirlpool forum: http://forums.whirlpool.net.au/forum-replies.cfm?t=1821427

    and here for a similar problem: http://support.mozilla.com/en-US/questions/796303#answer-158925

    As mentioned above, for the temporary site issue features while it is currently set, install the extension switch from User agent.

    https://addons.mozilla.org/en-US/firefox/addon/user-agent-switcher/
    
  • Remove the edge of the field button (JDK 4.5)

    Hello

    It is possible to remove the border around the bitmap button class slot? So everything that appears when the image is just the image without borders.

    Thank you.

    This is my class-

    Import net.rim.device.api.system.Bitmap;
    Import net.rim.device.api.ui.Font;
    Import net.rim.device.api.ui.Graphics;
    Import net.rim.device.api.ui.Ui;
    Import net.rim.device.api.ui.component.ButtonField;

    /**
    * Field button with a bitmap as its label.
    */
    SerializableAttribute public class BitmapButtonNoClickField extends ButtonField {}
    private bitmap Bitmap;
    bitmapHighlight private bitmap;
    Private boolean stressed = false;
    private fonts fonts;
            
    /**
    * Instantiates a new button bitmap field.
    *
    @param bitmap bitmap to use as a label
    */
    public BitmapButtonNoClickField (bitmap image Bitmap image, image Bitmap bitmapHighlight, label As String, int width, make police) {}

    This (bitmap, bitmapHighlight, ButtonField.CONSUME_CLICK |) ButtonField.FIELD_HCENTER | ButtonField.NON_FOCUSABLE | ButtonField.FIELD_VCENTER
    the label, width, police);
              
    }

    public BitmapButtonNoClickField (bitmap image Bitmap image, image Bitmap bitmapHighlight, long style,
    String label, int width, make police) {}
    Super (style);
    This.Bitmap = bitmap;
    this.bitmapHighlight = bitmapHighlight;
    This.font = fonts;
    }

    / * (non-Javadoc)
    * @see net.rim.device.api.ui.component.ButtonField #layout (int, int)
    */
    Protected Sub layout (int width, int height) {}
    setExtent (getPreferredWidth (), getPreferredHeight());
    }

    / * (non-Javadoc)
    * @see net.rim.device.api.ui.component.ButtonField #getPreferredWidth)
    */
    public int getPreferredWidth() {}
    Return bitmap.getWidth ();
    }

    / * (non-Javadoc)
    * @see net.rim.device.api.ui.component.ButtonField #getPreferredHeight)
    */
    public int getPreferredHeight() {}
    Return bitmap.getHeight ();
    }

    / * (non-Javadoc)
    * @see net.rim.device.api.ui.component.ButtonField #paint (net.rim.device.api.ui.Graphics)
    */
    protected void paint (Graphics graphics) {}
    width int = bitmap.getWidth ();
    int size = bitmap.getHeight ();
    Image bitmap b = bitmap;
    If (highlighted)
    b = bitmapHighlight;
    graphics.fillRoundRect (0, 0, getWidth(), getHeight(), 10, 10);
    graphics.drawBitmap (0, 0, width, height, b, 0, 0);
    graphics.setFont (do);
    Super.Paint (Graphics);
    graphics.drawText (label, 0, bitmap.getHeight ());
    }

    }

    If by "the code you posted" you mean advanced buttons, fields and managers, then no, it is not part of any levy JDE.  This has been created separately for reading more advanced developers. You must change the package names here as com.rim... do not work on any real device (works fine in the Simulator, however).

    There was a thread here in this forum about the legality of using the code in this article from book of knowledge - you can read it yourself:

    Legal issues Using - advanced tool buttons, fields and managers

    It wasn't for that resolution, but claim that it was already used in some applications. Personally, I am looking at the source code it orientation rather than a simple copy and paste. New - people claim she has some problems and I've seen questionable code in there in some places, but overall, it's extremely useful.

  • Email for blackBerry Smartphones application is greyed out on BlackBerry desktop software.

    I have the Blackberry desktop software version 4.5 installed on my computer. I can't access the E-mail application because it is grayed out. When I try to access it I get an error message "this computer does not have his account address message. The messaging system is not configured properly or this e-mail system is not supported. "I use outlook for my email. I have a BlackBerry Curve 8330. It is updated with version 4.5. The software recognizes the phone. All other programs are available.

    It's on a computer at home?  It seems that you have installed the desktop using the BES software / redirector option.  Redirector is designed to work with a server exchange; If you are using your home PC with a POP/IMAP e-mail address, the best solution would be to reinstall the Desktop Manager using BIS (located in the Setup Wizard), and then use the Blackberry Internet Service to configure your POP/IMAP e-mail.  With this configuration, you will over see the e-mail settings icon because it will no longer apply.  When you use the redirector on a computer that is not on an exchange server, you can receive messages on your device that say "this message is used to carry data between the blackberry and the server... ", which can be quite annoying.

  • Sort to view the status of i/o access by running the application?

    With ethernet base IO FieldPoint that we used previously, you can run MAX to examine the State of all e/s while it was accessed by a running application.  This has been very useful for troubleshooting.

    With the CompactDAQ system, it seems that you are prevented from doing.  Or at least the method is not as obvious and easy to find as it is with the FieldPoint.

    Am I missing something or is this just a limitation of the USB platform?

    If you use the e/s DAQmx Server to perform i/o FieldPoint-style with your modules cDAQ and variable network-released LabVIEW, you can monitor your variables by using the Distributed System Manager OR. However, note that the IO Server DAQmx does not work with the modules that do not sync on demand (single-point) support.

    Otherwise, there is no direct equivalent, but NEITHER IO Trace is useful to monitor functions DAQmx API are called.

    Brad

  • How to install the BlackBerry Java application in BlackBerry 10 Dev alpha

    Hello

    Does anyone know how to install the BlackBerry Java application in BlackBerry 10 Dev Alpha. I am able to wear an Android app in worms BlackBerry Dev Alpha 10. But there is no idea to install application developed with BlackBerry Java SDK 7.1 in verse 10 BlackBerry Dev alpha.

    Thanks in advance.

    I guess what pradeep_ch is correct,

    FYI,.

    http://supportforums.BlackBerry.com/T5/Java-development/DevCon-update-BB-Java-is-dead-no-Java-suppor...

    Thank you

  • Date time format BlackBerry java application

    Hi all

    I'll have a Date format time as ' 2013-10 - 09T 12: 45:00 + 05:30 '. How can I convert in ' hh: mm a "or" hh: mm a "in my Blackberry Java Application.

    Thank you and best regards.

    I will not be able to solve this problem using techniques integrated... In any case I analyzed it manually...

    Thankng you all for you answer!

  • access the blackberry calendar

    Hi friends,

    How can I access blackberry calendar?

    I access to blackberry Messages throgh

    net.rim.blackberry.api.mail.Message
    

    How can I access blackberry calendar?

    Thanks in advance

    public parseCalendarEvent (pimEvent event) survey IncompleteEventException, {PIMException}
    Super();
     
    PIMList pimList = PIM.getInstance () .openPIMList (PIM. EVENT_LIST, PIM. READ_ONLY);
     
    try {}
    try {}
    m_uid = pimEvent.getString (Event.UID, 0);
    }
    catch (Exception e) {}
    throw new IncompleteEventException();
    }
     
    try {}
    If (pimList.isSupportedField (Event.SUMMARY) & (pimEvent.countValues (Event.SUMMARY) > 0)) {}
    m_summary = pimEvent.getString (Event.SUMMARY, 0);
    }
    }
    catch (Exception e) {}
    }
     
    try {}
    If (pimList.isSupportedField (Event.NOTE) & (pimEvent.countValues (Event.NOTE) > 0)) {}
    m_description = pimEvent.getString (Event.NOTE, 0);
    }
    }
    catch (Exception e) {}
    }
       
    BlackBerryEvent film - all-day event
    Boolean allDayEvent = false;
    If (pimEvent instanceof BlackBerryEvent) {}
    If (pimList.isSupportedField (BlackBerryEvent.ALLDAY) & (pimEvent.countValues (BlackBerryEvent.ALLDAY) > 0)) {}
    allDayEvent = pimEvent.getBoolean (BlackBerryEvent.ALLDAY, 0);
    }
    }
       
    If (allDayEvent) {}
    try {}
    long startDate = pimEvent.getDate (Event.START, 0);
    m_startDate is startDate - TimeZone.getDefault () .getRawOffset ();.
    m_endDate = m_startDate + 86400000;
    }
    catch (Exception e) {}
    throw new IncompleteEventException();
    }
    }
    else {}
    try {}
    m_startDate = pimEvent.getDate (Event.START, 0);
    }
    catch (Exception e) {}
    throw new IncompleteEventException();
    }
     
    try {}
    m_endDate = pimEvent.getDate (Event.END, 0);
    }
    catch (Exception e) {}
    throw new IncompleteEventException();
    }
    }
       
    try {}
    If (pimList.isSupportedField (Event.LOCATION) & (pimEvent.countValues (Event.LOCATION) > 0)) {}
    m_Location = pimEvent.getString (Event.LOCATION, 0);
    }
    }
    catch (Exception e) {}
    }
     
    try {}
    If (pimEvent instanceof BlackBerryEvent) {}
    If (pimList.isSupportedField (BlackBerryEvent.ATTENDEES)) {}
    for (int i = 0; i)< pimevent.countvalues(="" blackberryevent.attendees="" );="" i++="" )="">
    m_attendees. AddElement (pimEvent.getString (BlackBerryEvent.ATTENDEES, i));
    }
    }
    }
    }
    catch (Exception e) {}
    }
    }
    {Finally
    try {}
    pimList.close ();
    }
    catch (Exception e) {}
    }
    }

  • Open source software of own construction Blackberry messaging application via BlueTooth

    I am new to the Blackberry development.

    I want to know any software open source for the creation of blackberry messaging application which can work via Bluetooth and data packets...

    If anyone knows any software opensource for messages of black berries, please tell me.

    Thank you...

    I found it.

    I use BTalk...

Maybe you are looking for