Shikhar13 / codenameone

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

In first paint cursor in multiline editfield is at end of row 1 even if text value takes up 3 lines. #241

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
show form
run this code. You see cursor at end of first row. now edit the textfield. the 
cursor jumps to end.

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(" sf s dfs df sdf sdf sd f sdf sdf s df s fsdf s df sdf sdf sd f sdf  sdf s df s df sd f sd f sdf sdf  sdf  sdf sdfsdf");
        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:39

GoogleCodeExporter commented 9 years ago
Run in J2ME. 

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

GoogleCodeExporter commented 9 years ago
Assigning to Chen

Original comment by shai.almog on 4 Jul 2012 at 6:00