stay on the current page. When the user presses ESCAP.

int

if (type1 is Dialog.OK)

{

intask (Dialog.D_YES_NO, "Please confirm");

    if (type is Dialog.YES)

{

perform your task if yes

ClearAll();

Login_Screen.disconnect ();

UiApplication.getUiApplication () .pushScreen (new L_Screen());

}

}

if (type1 is Dialog.CANCEL)

{

What should the code because I want to stay on the page current user //press whe cancel but

}

Type1 = Dialog.ask (Dialog.D_OK_CANCEL, "Do you want to disconnect now?");

Hello friends,

I do the page to disconnect. I want to give confurmation beform logout. Everthing is working. but

Aler dialogue ask first you want to disconnect or not?

If he says cancle I want to stay on the current page. but still he go on the back. When your press esce I check everything.

Please tell me what is the code to stay on the current page when the user press cancle alser dialogue?

That's what I understood.

I don't think you understood what I was saying. so here's an example of code:

    protected boolean keyChar(char character, int status, int time) {
        switch (character) {
            case Characters.ESCAPE:
                confirmClose();
                return true;
            default:
                return super.keyChar(character, status, time);
        }

    }

    private void confirmClose() {
        int resp = Dialog.ask(Dialog.D_YES_NO,"Do you really want to Quit",Dialog.NO);
        if ( resp == Dialog.YES ) {
            resp = Dialog.ask(Dialog.D_YES_NO,"Do you really, really want to Quit",Dialog.YES);
            if ( resp == Dialog.YES ) {
                // Close the screen as you currently do it
            }
        }
    }

If you don't mind asking me, please use English. for example, the letter "y" is, is not the question why.  I recommend this spell check you your messages also, don't forget that a lot of people who use these forums are not native English speakers, so we use English must be as clear as possible.

Tags: BlackBerry Developers

Similar Questions

  • Open a new window when the user presses the button

    Hello

    I have a button (BUTTON HTML) that opens a URL... but it opens URL in the same window...

    is there a way to open a new window (popup) when the user presses the button...

    Thanks in advance

    Hello

    Just change the button to the target URL.

    Specify the URL like: javascript:popupURL('__');

    popupURL is a function of popup. You can use the pop-up popUp2 (these are functions in the library of the apex with slightly different implementations), window.open, etc.

    popupURL
    function popupURL(a){html_PopUp(a,"winLov",800,600)}
    
    popUp
    function popUp(URL) {
     day = new Date();
     id = day.getTime();
     eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=600');");
     }
    
    popUp2
    function popUp2(b,a,c){day=new Date();pName=day.getTime();html_PopUp(b,pName,a,c)}
    
  • How can I set up a structure of the event that sends text when the user presses the button "Return"?

    I'm new to programming of the Structure of the event.  I am trying a program which causes the content of a control to the string to be processed when the user presses the button back in after typing in the control of the chain.  I think (I hope!) that it is simple, I just can't understand how do.

    Basically, I would take the attached VI and change so that the user can send the value of control 'String In' to the indicator "String Out" either by pressing the 'Return' key or press the button 'send string. '

    Any help would be greatly appreciated.

    This example has nothing to do with the RETURN key specifically.  It fires all simply whenever the value of the control is changed.  If you click outside the text box or on another still controls the value changes and still the event is raised.  This is often the desired so if it works in your application, you good to go.

    You CAN ONLY answer a particular key if you wish.  Set your event to meet 'This VI' > key down.  Then, read the proposal Vcle on the left side of the structure of the event and compare it to the RETURN (for example).  The Boolean result of the comparison gets connected to a structure to deal with your code to run inside.  You can also wire Vcle directly to a case structure and execute different code based on which key was pressed last.

  • How can I force a send this page if the user presses a tab?

    This may be obvious buy I start everything just with the APEX then maybe someone can tell me...
    How can I force a send this page if the user presses a tab and they go to another page before I run the backup of page variables?
    Thank you!!!
    C

    Hello

    If you use version 4.x Apex while you can create a dynamic action for this.

    * If this answer is useful or appropriate then please mark and award points.

  • How can I get my card of waveform to reset whenever the user presses a button?

    My program takes in an acquisition of input data and displays this signal in a continuous waveform chart. I wish that the previous values to remove the graphical display each time that the user presses a button (a Boolean toggle). Any ideas on how I can do this? I'm relatively new to Labview and don't know where to start to fix this problem.

    There is a property for this node.  Put something like this in your user interface loop, if you have a.

  • Autofocus TextField when the user presses the keys (and possible race condition)

    Someone tried to implement a device by which a TextField (or text box, I guess) automatically gets the focus when a user starts to type anything? It is very convenient to have something, at least with a phone model Qwerty, in certain situations. (A use case is where a list that is too long for the useful shortcuts, but the TextField object is used to implement a filtering mechanism that can reduce the data set to a reasonable size, and the user can then scroll just to find a target element).

    I've set up something using a KeyListener (calling requestFocus() for the TextField object) attached to the container Page, but there are problems with it.

    It's a question that the first keystroke does not render in the TextField object, since it has not a focus when the key was first struck.

    To solve that you can enter the key (event.unicode) and that insert into the TextField object, and then the following keys go on the field you want... but there is also a problem with that.

    If you type two or three buttons in quick succession, probably less than 50ms between them, you can see that even if the KeyListener gets each of them, the TextField object receives the second or, sometimes, the third, even if you can check that by the time second keyPressed/output signal arrives in your earpiece the TextField claims to have developed (TextField.focused is true).

    This seems like a bug, but maybe it's just a case of corner cascading who is inevitable, given its design... I'm not sure.

    If anyone can reproduce it, thanks for posting here. I'll do a test case to prove and will report it as a bug if you do.

    If anyone has a reliable and quality approach, please post here too! :-)

    P.S. for a good laugh, a code here that I did for my particular case, which seeks to avoid the race condition. As you can see, this is a great hack, but it works 100% reliable for me so far with a fairly comprehensive test (including the tests with the movement of the cursor, copy/paste, etc.). It's too complicated to analyze and ensure that it is really robust, however, but feel free to use... If you care enough. ;-)  http://pastebin.com/r2VUtPJC

    Have you tried setting the primaryKeyTarget it's inputRoute?

    https://developer.BlackBerry.com/native/reference/Cascades/bb__cascades__inputrouteproperties.html

    Has been added to the 10.1, which should do what you want.

    You can also achieve the same messing around with pre FocusPolicy 10.1, but it is much simpler.

  • run when the user presses ENTER

    Hello

    I have a program that scans a serial number and gives power.

    RightNow, I scan the serial number and the hit on the laview toolbar.

    But, I would like to program it so that when the user scans a number it would automatically generate results, without me hitting run or an OK button at all times.

    I enclose my vi below.

    So, anyone has any tip for me on how I could go about this?

    Thank you very much in advance,

    Yeshani

    Hello

    Here is a version that uses polling.  The entrance was there properties so that it is not until that you press ENTER.

    The reference is in fact a local variable.

    Local variables and the voting clerk aren't often mouse, but for "just a text entry" app, it should work well.

  • Full screen when the user presses tab pane

    Hello

    I have a tab pane in my application. When the user tab special tab I want to hide the tab pane and demand should be the mode display full screen. Is it possible to achieve with default tab pane?

    I solve this problem using the custom button instead of the default tab pane.

    Thank you

    Megha.

  • How prevention JButton to actions generated when the user press down

    How prevention JButton to actions generated when the user hold down the key or the short cut
    The code below to show the question when the user keep pressing Alt O
    We want to stop the JButton to generate multi shares just a share only
    A code example shows the behavior that needs to be prevented. Keep pressing "Alt + O" and you will see that the standard ouptput will print the timestamp
    Note Please, I'm NOT interested in the mouse press which is a solution by adding a threshold (setMultiClickThreshhold (long line) on the JButton as an attribute.

     
    public class TestPanel extends JPanel
    {
    
       private JButton btn;
    
       public TestPanel()
       {
          btn = new JButton("Open");
          this.add(btn);
          registerCommand(new MyAction(), InputEvent.ALT_MASK,
                KeyEvent.VK_O, btn, btn.getText(), 0);
       }
    
       public static void registerCommand(AbstractAction action,
             int mask,
             int shortCommand,
             JComponent component,
             String actionName,
             int mnemonicIndex)
       {
          InputMap inputMap = component.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
          KeyStroke knappKombination = KeyStroke.getKeyStroke(shortCommand, mask);
    
          if ((component instanceof AbstractButton)
                && mnemonicIndex >= 0
                && mnemonicIndex < actionName.length()
                && (shortCommand >= KeyEvent.VK_A && shortCommand <= KeyEvent.VK_Z))
          {
             ((AbstractButton) component).setDisplayedMnemonicIndex(mnemonicIndex);
          }
    
          if (inputMap != null)
          {
             ActionMap actionMap = component.getActionMap();
             inputMap.put(knappKombination, actionName);
             if (actionMap != null)
             {
                actionMap.put(actionName, action);
             }
          }
       }
    
       public static class MyAction extends AbstractAction
       {
    
          /**
           * 
           */
          private static final long serialVersionUID = 1L;
    
          @Override
          public void actionPerformed(ActionEvent e)
          {
             System.out.println(System.currentTimeMillis());
    
          }
    
       }
    
       public static void main(String... args)
       {
          SwingUtilities.invokeLater(new Runnable()
          {
             public void run()
             {
                JFrame frame = new JFrame("Testing");
                JPanel panel = new TestPanel();
                frame.getContentPane().add(panel);
                frame.setPreferredSize(new Dimension(500, 500));
                frame.setMinimumSize(new Dimension(500, 500));
                frame.pack();
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                frame.setVisible(true);
             }
          });
       }
    
    }
    Published by: user12130673 on 13-feb-2013 03:01

    Use getKeyStroke (int keyCode, int modifiers, boolean onKeyRelease) hit with onKeyRelease = true instead?

  • Flatten or lock a pdf form to be completed when the user presses the button "submit"

    Hello.  I have searched all over the net trying to figure this out.  I have a form that I created in LiveCycle and as I inserted a "REGULAR" button, with the following script:

    Create a variable to hold the document object

    var

    oDoc = event.target;

    oDoc.mailDoc({)

    bUI

    : true,

    cTo

    : "[email protected] " ",

    bassujetti

    : "New procedure - operator ' + TextField1.rawValue + "-ID" + TextField2.rawValue

    CSMG

    : "Attached is the form of the new procedure for the operator" + TextField1.rawValue + "-ID" + TextField2.rawValue + "." ,

    });

    This script is sending an e-mail to "[email protected]" and fill in the subject line and the body of the message with text and some elements of the fields in the PDF file.

    I want to have the locked PDF or flattened when the user clicks on the button submit, to ensure that the information in the PDF file is not modified once they submit.  I can't find any way to do this easily.  I found a script that will flatten the message (below), but I don't know how to add it to the email script that I pointed out above.  I don't want to add a second button to the form that I want to keep it as simple as possible for the user.

    Any suggestions that anyone might have would be greatly appreciated.  Thank you.

    Ryan

    Hello

    Check out this example:

    http://thelivecycle.blogspot.com/2010/02/mail-XFA-forms-as-protected-UnEditable.html

  • Definition of what happens if the user presses stop...

    I have a simple dvd set in place. Menu callback actions... 3 video clips... 3 buttons. If the user is in the middle of watching a video and press "stop" on the remote control, I want it back to the main menu.

    How can I do this?

    TIA

    Dean

    The menu button on the remote control

  • How do to navigate to another page when press the 'OK' button to confirm the dialogue?

    Hello
    In a detail of the page, I have a "Delete" button, and when you press this button, it will appear a confirmation dialog box, if the user click on 'Cancel', the dialog box is missing stay and still on the current page, if the user presses the "OK" button, it calls a method in the class ViewImple (do remove and other business process logic) and show a different page. The extract of the JSF page as follows:

    < text af:commandButton = 'Delete' action = 'delete' id = "cb3" >
    < af:showPopupBehavior popupId = "p1" triggerType = 'action' / >
    < / af:commandButton >
    < af:popup childCreation = autoCancel "delayed" = "disabled" id = "p1" contentDelivery = "immediate" >
    < af:dialog id = "d2" type = "okCancel" title = "Confirm deletion?" resize = 'off '.
    dialogListener = "#{scheduleBean.deleteScheduleDialog} ' contentWidth ="200""
    contentHeight = "50" >
    < af:outputText value = "Are you sure you want to delete this report?" id = "ot1" / >
    < af:clientListener type = "dialogue" method = "dialogAction" / >
    < / af:dialog >
    < / af:popup >
    < af:resource type = "javascript" >
    function dialogAction (evt) {}
    result of the var = evt.getOutcome ();
    if(Outcome == AdfDialogEvent.Outcome.Cancel) {}
    evt. Cancel();
    }
    }
    < / af:resource >

    Now the question is when I click on "OK" button confirm dialogue, dialogue is missing, but he can't get into the business logic in ViewImpl class method (the "delete" action value you access method adfc-config.xml file, and then navigate to another page), also click on the button 'Cancel' to stay on the current page.

    All tips will be of great help!

    You can use it as

    Navigate ("deletePage"); the adfc-config. XML

    public static navigate (String taskFlowName) Sub {}

    > FaceContext.getCurrentInstance () .getApplication () .getNavigationHandler () .handleNavigation (FaceContext.getCurrentInstance (), null, taskFlowName);

    }

    or for isnde action to propagate a method you have to use
    > MethodExpression exp =
    > (MethodExpression) ADFUtils.getMethodExpression ("deletePage");
    > getRegAgentNextBtn () .setActionExpression (exp);
    I hope that you ADFUtils with you

  • Detect changes in the user interface of the page

    I have a sheet with several fields on this subject.

    When the user presses the button close to the sheet, I want to check if the user has made changes in this case I will display a confirmation dialog box before you close the sheet and ignoring the changes.

    Is there a way to detect changes on the sheet or page of the world?

    On the old BBOS based on Java, there was a Screen.isDirty () method that could be used for this purpose:

    http://www.BlackBerry.com/developers/docs/7.1.0api/NET/rim/device/API/UI/screen.html#IsDirty%28%29

    No, it isn't.

    What you can do is hang the onTextChanging of each signal and update a global variable to indicate that there has probably been a change.

    The way I did however was subclass controls and make control by slot of this signal if the text had in fact changed then my own signal indicating that there was a specific change.

  • With the help of A6, must create menu screen which allows the user to click a button creates a branch to other screens and return to the main menu. When returning to the main screen on which button will be gray or inactive.  How can I do this?  I created

    I am trying to imitate a piece of equipment.  I need the user to be able to click on the specific buttons that have the user to another or screens.  After viewing these screens that will be the user to the main screen where the user which buttons were pressed and which still needed to be pressed.  I create buttons image with the 3 States - who has worked except when the user returns to that slide is reset to zero, and if the user does not see the 3rd State of the button.  How can I get this 3rd State of stay after the user returns to the main screen?

    You can not 'keep' a State, that's what I said in my first answer: "you can create an image with that look of '3' State, make it invisible and show it with the same action when a button is triggered. You will need to insert extra that third picture, first hide it out and make it visible to the advanced action, which I explained. I called this additional 'Done_one' image in the example. The three States you're talking about are in a totally different way to Captivate: for down, more and up-state. You can just tell Captivate to keep a low State, it will be down when the button is pressed. Where my explanation of an additional image.

    No need for all the variables. Looks like you have a lot to learn about variables and advanced actions. I don't see another easy way to achieve what you want. It is not so difficult, tons of examples on my blog.

  • How to hide images that appears only when the user clicks a button?

    Hi, I am doing an application which includes maps, and I want the cards to be hidden until the user presses the map icon. How could I get there. I created buttons when pressing on the icon directs the user to a different page, but they can also simply scroll down to see the map. I would rather just the card face down until the button is pressed.

    Oh and if I can do it with an image can I do with a separate show? I'm including maps and routes photo step by step. for example, a button to make the pop up card and another button to bring up the slideshow.

    Any suggestions? Thank you!

    It is best done with a multi state object.

    One is the map icon and the rest of the States put in place according to the needs. Use the buttons in the various States by using the go to the action of the State.

Maybe you are looking for

  • Apple TV by himself the value of Korean as a language and I can't find a way

    When I turned on my new Apple TV 4 for the first time he spontaneously scrolls at lightning speed through the entire Setup menu, each visible page for about a tenth of a second, while I watched with amazement. When he stopped the language is Korean.

  • How can I search within a cluster table?

    I have a cluster that contains a control channel and a DBL control. A table consists of the latter. The table looks like the lines below. 'min' 3.55 10.33 "max". 7.33 "average." How can I retrieve the value of 'min' without having to inspect all the

  • In Window Movie Maker million minutes to complete

    Window Movie Maker when I go to save the movie, IE 0% complete and the minutes of the end simply continues to increase.  He is currently in 11123689 and increments of their.  What I'm doing wrong the entire video should be about 20 minutes.

  • How to remove the google account in lenovo 7000

    How to remove google account in lenovo 7000, I don't have possibility of deleted account.pls someone help me.

  • Where to find the Starfield Screensaver

    original title; Starfield screensaver I am disappointed that Vista does not include the old Starfield screensaver.  Y at - it somewhere that I can get an original version of this screensaver, prefferably directly from Microsoft?