Input dialog help...

I cannot seem to find if there is a way to create an input dialog box that accepts a String as input but only has an 'OK' button and no 'Cancel' button.
It seems that the 'Cancel' button is put in by default. Is there any way to eliminate it or do I have to write my own class?
Edited by: gabel3469 on May 16, 2008 5:07 AM

the best is to impose the user to input with something like:
do
   // prompt the dialog
while (userInput.equals("") || optionChosen = CLOSED_OPTION || optionChosen == CANCEL_OPTION);

Similar Messages

  • Text Input Dialog

    Hello experts,
    How to configure the Web Item: "Text Input Dialog" to show label in different languages (Language-Dependent Text) according to languages configured in user web browser?
    Thanks and Regards,
    Pablo Moraes

    Heads up..
    <b>Use</b>
    The text input dialog is used to create text for certain parameters in Web items. You can enter the following text types using the dialog:
    1)Language-Independent Text
    2)Language-Dependent Text Stored in Object (Web Template or Reusable Web Item)
    3)Language-Dependent Text Stored in Table
    4)Language-Dependent Report Text (Obsolete)
    <b>Integration -</b>
    The text input dialog is part of the Web Application Designer and is called when you set certain Web item parameters, such as in the parameter tray, using which you can label the tray for the Web item. Using the text input dialog, you can enter the hyperlink text (parameter TEXT_CONTENT) and the quick info text (parameter TOOLTIP) for the Link Web item, for example.
    <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/42/dbca81689a6ffce10000000a1553f6/content.htm">http://help.sap.com/saphelp_nw2004s/helpdata/en/42/dbca81689a6ffce10000000a1553f6/content.htm</a>
    <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/d7/c4673cffbb4c34e10000000a11402f/content.htm">http://help.sap.com/saphelp_nw2004s/helpdata/en/d7/c4673cffbb4c34e10000000a11402f/content.htm</a>
    Hope it Helps
    Chetan
    @CP..

  • Input dialog question OK/Cancel Button

    Hi there,
    I�m busy with an application that displays an input dialog box on start up. It prompts the user for their name. This imput will then be used for a JLabel welcoming the user with their name. If no name is entered. The Jlabel will display �Welcone User�. Everythng works fine but when I press cancel on the input dialog box I get an error. Below is some code of what I�ve done so far.
    Thanks,
    Patrick.
    String name = JOptionPane.showInputDialog(null,
              "Please enter your name",
              "Name input",
              JOptionPane.PLAIN_MESSAGE);
              welcome = new JLabel(name);
              if (name.length() == 0) {
                   welcome = new JLabel("Welcome User");
              else if (name.length() > 0) {
                   welcome = new JLabel("Welcome " + name);

    The error is NullPointerException.
    If the cancel button is pushed a null is returned.
    Try this test instead
    if ((name == null) || (name.length() == 0))
       welcome = new JLabel("Welcome User");
    }

  • Possible alternative to input dialog box

    The program I'm creating would like to utilize the functionality of an input dialog box, however, I would like for the input dialog box to return a group of values instead of just one. As far as I can tell, the input dialog box can return a single String based an a group of values that I supply. However, the program I use would want the user to be able to select several of those values. Is there a way to have the input dialog box return a String[]? Perhaps there is another option that I'm not really aware of that can mimic the input dialog box functionality?

    Hi,
    You might create some complex JComponent (a JPanel containing lots of check boxes and text fields etc). Use that component as a message. Then, when the user clicks the OK button, investigate your complex component for all its values.
    Piet

  • Input Dialog box

    how to get value from Input dialog box?

    --String input=JOptionPane.showInputDialog(null, "Enter a String: ", "Input Dialog", 1);
              System.out.println ("You inputted: "+input);

  • Function to create Input Dialog for Search Help

    Hi Folks,
    Is there any function to create the dialog to limit the search help result as the one that appears when you create the Search Help through the SE11.
    This is because when I use F4IF_FIELD_VALUE_REQUEST I'm just being able to set one value to restrict and hopefully the functionality of intervales, exclusions, etc that the search help dialog when created through the se11 does have and haven't found it on F4IF_INT_TABLE_VALUE_REQUEST.
    If you can share a little example I really appreciate it.
    Thanks in advance.
    Regards,
    Gilberto Li

    Hi
    You can accomplish by using search help exits..... search the forum by "Search help exit" and check my wiki on search help exit code.

  • Dialog help please

    When i press the calculate button it will calculate a price depending on the options chosen and show the results in an OptionDialog.
    I need help with the two buttons (New Quote and Close), I want it so that if i press New Quote it will return to the dialog box where i input values, and if i press Close it will exit the entire application. Is this possible? And if so how?
    Thanks
    package task2;
    import java.awt.Dimension;
    import java.awt.Font;
    import java.awt.Frame;
    import java.awt.Rectangle;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JComboBox;
    import javax.swing.JDialog;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JOptionPane;
    import javax.swing.JTextField;
    public class task2Swing extends JDialog {
    private JLabel jLabel1 = new JLabel();
    private JTextField noDays = new JTextField();
    private JLabel jLabel2 = new JLabel();
    private JComboBox carType = new JComboBox();
    private JButton calcButton = new JButton();
    private JButton jButton2 = new JButton();
    public task2Swing() {
    this(null, "", false);
    public task2Swing(Frame parent, String title, boolean modal) {
    super(parent, title, modal);
    try {
    jbInit();
    } catch (Exception e) {
    e.printStackTrace();
    private void jbInit() throws Exception {
    this.setSize(new Dimension(309, 176));
    this.getContentPane().setLayout( null );
    jLabel1.setText("Input number of days to rent car:");
    jLabel1.setBounds(new Rectangle(15, 5, 230, 30));
    jLabel1.setFont(new Font("Verdana", 0, 13));
    noDays.setBounds(new Rectangle(250, 5, 40, 35));
    jLabel2.setText("Select type car to rent:");
    jLabel2.setBounds(new Rectangle(15, 55, 165, 25));
    jLabel2.setFont(new Font("Verdana", 0, 13));
    carType.setBounds(new Rectangle(195, 55, 95, 30));
    carType.insertItemAt("Economy", 0);
    carType.insertItemAt("Intermediate", 1);
    carType.insertItemAt("Full_Size", 2);
    carType.insertItemAt("Luxury", 3);
    calcButton.setText("Quote");
    calcButton.setBounds(new Rectangle(45, 100, 80, 35));
    calcButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    calcButton_actionPerformed(e);
    jButton2.setText("Close");
    jButton2.setBounds(new Rectangle(170, 100, 80, 35));
    jButton2.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    jButton2_actionPerformed(e);
    this.getContentPane().add(jButton2, null);
    this.getContentPane().add(calcButton, null);
    this.getContentPane().add(carType, null);
    this.getContentPane().add(jLabel2, null);
    this.getContentPane().add(noDays, null);
    this.getContentPane().add(jLabel1, null);
    public static void main(String[] args){
    JFrame vJFrame = new JFrame("frame");
    vJFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    vJFrame.setSize(300, 100);
    vJFrame.setVisible(false);
    task2Swing vAddOneDialog = new task2Swing(vJFrame, "Task 2", false);
    vAddOneDialog.setVisible(true);
    private void jButton2_actionPerformed(ActionEvent e) {
    System.exit(0);
    private void calcButton_actionPerformed(ActionEvent e) {
    int quote = 0, economy = 50, intermediate = 60, fullsize = 75, luxury = 100;
    String vMyNumberText = noDays.getText();
    String val = carType.getSelectedItem().toString();
    int vMyNumber = Integer.parseInt(vMyNumberText);
    if(val.equals("Economy")){quote = vMyNumber * economy;}
    if(val.equals("Intermediate")){quote = vMyNumber * intermediate;}
    if(val.equals("Full_Size")){quote = vMyNumber * fullsize;}
    if(val.equals("Luxury")){quote = vMyNumber * luxury;}
    Object[] options = {"New Quote", "Close"};
    JOptionPane.showOptionDialog (
    null, "Your quote comes to $" + quote, "Quote for car rental",
    JOptionPane.YES_NO_OPTION,
    JOptionPane.QUESTION_MESSAGE,
    null, //do not use a custom Icon
    options, //the titles of buttons
    options[0]); //default button title
    //System.exit (0); //ends the program
    }

    anyone?

  • Dialog help

    When i press the calculate button it will calculate a price depending on the options chosen and show the results in an OptionDialog.
    I need help with the two buttons (New Quote and Close), I want it so that if i press New Quote it will return to the dialog box where i input values, and if i press Close it will exit the entire application. Is this possible? And if so how?
    Thanks
    Code for the calculate button:
        private void calcButton_actionPerformed(ActionEvent e) {
            int quote = 0, economy = 50, intermediate = 60, fullsize = 75, luxury = 100;
            String vMyNumberText = noDays.getText();
            String val = carType.getSelectedItem().toString();
            int vMyNumber = Integer.parseInt(vMyNumberText);
            if(val.equals("Economy")){quote = vMyNumber * economy;}
            if(val.equals("Intermediate")){quote = vMyNumber * intermediate;}
            if(val.equals("Full_Size")){quote = vMyNumber * fullsize;}
            if(val.equals("Luxury")){quote = vMyNumber * luxury;}
            Object[] options = {"New Quote", "Close"};
            JOptionPane.showOptionDialog (
            null, "Your quote comes to $" + quote, "Quote for car rental",
            JOptionPane.YES_NO_OPTION,
            JOptionPane.QUESTION_MESSAGE,
            null,     //do not use a custom Icon
            options,  //the titles of buttons
            options[0]); //default button title
            System.exit (0); //ends the program
        }Code for entire application:
    package task2;
    import java.awt.Dimension;
    import java.awt.Font;
    import java.awt.Frame;
    import java.awt.Rectangle;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JComboBox;
    import javax.swing.JDialog;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JOptionPane;
    import javax.swing.JTextField;
    public class task2Swing extends JDialog {
        private JLabel jLabel1 = new JLabel();
        private JTextField noDays = new JTextField();
        private JLabel jLabel2 = new JLabel();
        private JComboBox carType = new JComboBox();
        private JButton calcButton = new JButton();
        private JButton jButton2 = new JButton();
        public task2Swing() {
            this(null, "", false);
        public task2Swing(Frame parent, String title, boolean modal) {
            super(parent, title, modal);
            try {
                jbInit();
            } catch (Exception e) {
                e.printStackTrace();
        private void jbInit() throws Exception {
            this.setSize(new Dimension(309, 176));
            this.getContentPane().setLayout( null );
            jLabel1.setText("Input number of days to rent car:");
            jLabel1.setBounds(new Rectangle(15, 5, 230, 30));
            jLabel1.setFont(new Font("Verdana", 0, 13));
            noDays.setBounds(new Rectangle(250, 5, 40, 35));
            jLabel2.setText("Select type car to rent:");
            jLabel2.setBounds(new Rectangle(15, 55, 165, 25));
            jLabel2.setFont(new Font("Verdana", 0, 13));
            carType.setBounds(new Rectangle(195, 55, 95, 30));
                carType.insertItemAt("Economy", 0);
                carType.insertItemAt("Intermediate", 1);
                carType.insertItemAt("Full_Size", 2);
                carType.insertItemAt("Luxury", 3);
            calcButton.setText("Quote");
            calcButton.setBounds(new Rectangle(45, 100, 80, 35));
            calcButton.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent e) {
                            calcButton_actionPerformed(e);
            jButton2.setText("Close");
            jButton2.setBounds(new Rectangle(170, 100, 80, 35));
            jButton2.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent e) {
                            jButton2_actionPerformed(e);
            this.getContentPane().add(jButton2, null);
            this.getContentPane().add(calcButton, null);
            this.getContentPane().add(carType, null);
            this.getContentPane().add(jLabel2, null);
            this.getContentPane().add(noDays, null);
            this.getContentPane().add(jLabel1, null);
        public static void main(String[] args){
            JFrame vJFrame = new JFrame("frame");
            vJFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            vJFrame.setSize(300, 100);
            vJFrame.setVisible(false);
            task2Swing vAddOneDialog = new task2Swing(vJFrame, "Task 2", false);
            vAddOneDialog.setVisible(true);
        private void jButton2_actionPerformed(ActionEvent e) {
            System.exit(0);
        private void calcButton_actionPerformed(ActionEvent e) {
            int quote = 0, economy = 50, intermediate = 60, fullsize = 75, luxury = 100;
            String vMyNumberText = noDays.getText();
            String val = carType.getSelectedItem().toString();
            int vMyNumber = Integer.parseInt(vMyNumberText);
            if(val.equals("Economy")){quote = vMyNumber * economy;}
            if(val.equals("Intermediate")){quote = vMyNumber * intermediate;}
            if(val.equals("Full_Size")){quote = vMyNumber * fullsize;}
            if(val.equals("Luxury")){quote = vMyNumber * luxury;}
            Object[] options = {"New Quote", "Close"};
            JOptionPane.showOptionDialog (
            null, "Your quote comes to $" + quote, "Quote for car rental",
            JOptionPane.YES_NO_OPTION,
            JOptionPane.QUESTION_MESSAGE,
            null,     //do not use a custom Icon
            options,  //the titles of buttons
            options[0]); //default button title
            //System.exit (0); //ends the program
    }

    You need this.

  • Trying to create an input dialog box, that will halt execution

    I am trying to get a pop up dialog box to appear where the user will enter their name, after clicking OK or Cancel, i would like the code to continue executing.  For example when i use the Alert.show("1");Alert.show("2");Alert.show("3");  it appears as 3,2,1. Is it possible to fire one alter at a time AFTER the user has clicked Ok.
    Back to the originial question.
    I am setting up a Pop up menu
    var ret:String;
    var Dialog:SimpleTitleWindowExample =SimpleTitleWindowExample(PopUpManager.createPopUp( this, SimpleTitleWindowExample , true));
    ret = Dialog.Input      //where input is just a public text for example
    return ret;
    ^returns null.
    I was hoping it would wait until  it was closed to continue. I thought it would by setting the modal = true
    Essentially I'm asking is there a way to halt execution until the user inputs some text? Doesn't have to utilize the PopUpManager.
    Please help. I've spent 4 hours trying to tackle this.  I even tried to do a DoEvent (Visual Studio) type loop until the button was clicked or variable was no longer blank.

    I think you may alternately be able to listen for the removedFromStage event and react to that. In any case, you need some way of reacting to SampleTitleWindow closing (via an event listener), and only then trigger the next pop-up.

  • Some input dialogs are blank - no cursor, but chrome ok - why?

    I am trying to set dialogs in a JomSocial profile edit page. Some dialogs are editable, and others are blank and apparently don't accept input. When this is done using Chrome, there is no problem.

    Can you try in safe mode?
    * On Linux you can open Firefox 4.0+ in Safe Mode by quitting Firefox and then going to your Terminal and running: firefox -safe-mode (you may need to specify the Firefox installation path e.g. /usr/lib/firefox)
    * Or open the Help menu and click on the '''Restart with Add-ons Disabled...''' menu item while Firefox is running.
    [[Image:FirefoxSafeMode|width=520]]
    ''Once you get the pop-up, just select "'Start in Safe Mode"''
    [[Image:Safe Mode Fx 15 - Win]]
    '''''If the issue is not present in Firefox Safe Mode''''', your problem is probably caused by an extension, and you need to figure out which one. Please follow the [[Troubleshooting extensions and themes]] article for that.
    ''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before opening Firefox for normal use again.''
    ''When you figure out what's causing your issues, please let us know. It might help other users who have the same problem.''
    Thank you.

  • To display non US-ASCII filename in file download dialog - Help Needed

    Hi,
    Our application supports to upload a file with name in chinese/japanese language. When user tries to download filedownload dialog box is appearing with the filename as junk characters.
    How to solve this issue to display the filename as uploaded.
    Thanks in advance
    ~kans

    bsampieri, issue is in display of the file name in
    file download dialog.
    ~kansI understood that, but my thought was that the HTTP headers content type containing a charset of UTF-8 might help. I don't know for sure, but otherwise, I don't know how to get the browser to otherwise not assume ASCII.

  • Input search help not working in portal correctly, works in R/3 fine?

    Hi All,
    We have created a custom iview which is based on a BSP.  One of the input fields has search help provided, which is simply a list of all employees.  When we execute the BSP from r/3 it works perfectly fine but when we execute if from portal, the search help behaves strangely.  Not all images are found and it's lost the look and feel that it had in r/3. 
    If anyone can shed any light, i'd be most grateful.
    Kind regards,
    Liz.

    Is it because of the size of the bsp page? Sometimes when a bs displays in the content area the window is smaller than expected and the bsp optimizes things like dropdows etc. Can you try launching the iView in a new window and see if that helps?

  • BADI Error: Field GOITEM-ACCT is not ready for input ? HELP!

    I get this error message when testing my BADI in the MIGO Transaction.  The BADI is the MB_MIGO_BADI.  It is from the Line_modify method.  Here is the entrie message:
    BAdI: Field GOITEM-ZZREG_ACCT is not ready for input. (Change is not copied over)
    Message no. MIGO050
    Diagnosis
    The contents of field GOITEM-ZZREG_ACCT have been changed in BAdI MB_MIGO_BADI (method LINE_MODIFY). The field, however, is not ready for input, so the change cannot be copied.
    In method LINE_MODIFY, only the contents of fields that are ready for input can be changed.
    The field is defined correctly in the screen as an input/output field - so it does not relate to that.
    HELP!!!!!

    Yes - I have reviewed all of the code and I never do any modify to the screen attributes of a field - although it sure acts like it.  The screen lets me put in data and it stays there up until it finishes the method line_modify.  The error is when i press return after i enter the field- it completes the BADI method and then goes to the main program and does field validation and always comes back with some internal table field called "work" with a value of 0 and it should be a value of 6.
    Thanks! 
    Scott

  • How to set a default value for a input dialog

    I use JOptionPane.ShowInputDialog("Input Please");

    JOptionPane.showInputDialog("hello", "default");Also, this would be helpful:
    http://java.sun.com/j2se/1.4/docs/api/javax/swing/JOptionPane.html

  • Re: Embedding Applet in JSP which gets dynamic input| Pls help

    Hi All,
    We are into a project in Oracle Portal Server where in we want to embed a result of a standalone application(Which is applet) in JSP.
    This standalone application generates applet based on the input it gets from the current application's database.
    If it was static we could have used jsp:plugin but, it fails in our case!
    We are clueless as to how to embed an applet which will pick up the data dynamically.
    Can anyone of you help me in this regard?
    Thanks & Regards
    Arthi

    Well instead of generating entire applet ,you can have a generic applet which takes parameters as ( <PARAM name="name" value="value"> ) inputs and process those inputs to generate output.
    In this case the output of the stand alone program would be a object. And in JSP page you need to access this object, then you can get the values which need to be passed to Applet.
    Else
    1.Identify the real path of the applet class file
    ServletContext context = session.getServletContext();
    String realContextPath = context.getRealPath(request.getContextPath());2.Copy the file to a standard location in your web application
    Regards,
    -John-

Maybe you are looking for

  • Wireless network only visible on Mac but not PC

    Hi all, I replaced my Linksys router with an Airport Extreme. I configured a wireless network and I can see the wireless network on my MacBook Pro. However, while my PC's can still see the old Linksys wireless network, they don't pick up the wireless

  • How do I make interactive DVD/Blu-Ray menus with motion?

    So, adobe doesn't support Encore anymore which means I can't use dynamic link to AE to create interactive DVD/Blu-Ray menus with motion.... or can I? Is there something I'm doing wrong? While in Encore, I go to dynamic link and boom, dynamic link to

  • How to locate the caller's location in iPhone.?

    I heard that iPhone will display the caller's location after finishing a call. How to turn it on?

  • Appointments Deleted During Hotsynch

    I hope someone here can help me.  I just did a hotsynch and all my appointments were deleted.  For some reason, the hotsynch was set to have the handheld overwrite the desktop -- but all my new appointments were on the desktop. I checked my calendar

  • How do I return the displaysleep value from the console?

    I know that I can do pmset -g to list all the settings, including displaysleep, but I  was hoping there was a command similar to that for the screensaver which only returns the numerical value: defaults -currentHost read com.apple.screensaver idleTim