hi,

i m working on an application, which has login page first, if user login
successfully, it redirect user to main page. currently i use formpanel to do
the login, if user login with wrong info, i can display error on the same
page, but if login successfully, i don' t know how to redirect them to the
main pages, is there any way to parse the response from
formPanel.getForm().submit() method??? thanks!

my code:(login page)

            panel = new Panel();
            panel.setBorder(false);
            panel.setPaddings(15);

            final FormPanel formPanel = new FormPanel();
            formPanel.setFrame(true);
            formPanel.setTitle("Login");

            formPanel.setWidth(350);
            formPanel.setLabelWidth(75);

            final TextField userName = new TextField("Username", "username",
230);
            userName.setAllowBlank(false);
            formPanel.add(userName);

            final TextField password = new TextField("Password", "password",
230);
            formPanel.add(password);

            Button submitBtn = new Button("Login", new
ButtonListenerAdapter() {
                public void onClick(Button button, EventObject e) {
                    String url = "data/login.php?uname=\"" +
userName.getText() + "\"&pwd=\"" + password.getText()+"\"";
                    formPanel.getForm().submit(url, null, Connection.GET,
"Login...", false);
                }
            });
            formPanel.addButton(submitBtn);

           panel.add(formPanel);

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"GWT-Ext Developer Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/gwt-ext?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to