Shikhar13 / codenameone

Automatically exported from code.google.com/p/codenameone
0 stars 0 forks source link

Cant break out of multiline textField when textfield inside a popup #240

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Show a form.
Run the following code.
Enter some text.
Press down to navigate to one of the buttons. You cant.

public static void showEditPopup(final EditPopupEvent event) {
        final Dialog dialog = new Dialog();

        final TextField textarea = new TextField();
        textarea.setUIID("BozzaInputDialogMessage");
        textarea.setMaxSize(event.getMaxSize());
        textarea.setText(event.getDefaultValue());
        textarea.setRows(3);        
        textarea.setSingleLineTextArea(false);

        Button cancelbutton = new Button("Cancel");         
        cancelbutton.setUIID("PopupBozzaB");
        cancelbutton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                dialog.dispose();               
            }
        });

        Button submitbutton = new Button("Confirm");            
        submitbutton.setUIID("PopupBozzaB");
        submitbutton.addActionListener(new ActionListener() {           
            public void actionPerformed(ActionEvent evt) {
                event.getNamedCommand().submit(textarea.getText());
                dialog.dispose();               
            }
        });

        Container buttonContainer = new Container(new BorderLayout());      
        buttonContainer.addComponent(BorderLayout.WEST, cancelbutton);
        buttonContainer.addComponent(BorderLayout.EAST,  submitbutton);

        Container container = new Container();
        container.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
        container.addComponent(textarea);
        container.addComponent(new BozzaLine());
        container.addComponent(buttonContainer);
        container.setUIID("BozzaDialogContent");

        Container wrapcontainer = new Container(new BoxLayout(BoxLayout.Y_AXIS));
        wrapcontainer.setUIID("BozzaWrapContainer");
        wrapcontainer.addComponent(container);

        dialog.setTitle(event.getTitle());
        dialog.addComponent(wrapcontainer);
        dialog.setDisposeWhenPointerOutOfBounds(true);  
        dialog.showPacked(BorderLayout.CENTER, true);
    }

Original issue reported on code.google.com by jkoo...@gmail.com on 4 Jul 2012 at 3:29

GoogleCodeExporter commented 9 years ago
I figured it out. I have to press 'Enter' to break out of the editing cycle.

Original comment by jkoo...@gmail.com on 4 Jul 2012 at 3:31

GoogleCodeExporter commented 9 years ago

Original comment by shai.almog on 4 Jul 2012 at 3:32