1. #11
    Ext User
    Join Date
    Jun 2009
    Posts
    25
    Vote Rating
    0
    cbruno is on a distinguished road

      0  

    Default


    Hey, aclsoftware, can you send me the current svn build when you get it working? I paid for a commercial license, just not silver support.

  2. #12
    Ext GWT Premium Member
    Join Date
    Sep 2009
    Posts
    60
    Vote Rating
    1
    aclsoftware is on a distinguished road

      0  

    Default


    Here is my problem and code.

    I am trying to develop a log in form but i am having trouble catching the Submit event of FormPanel.

    I can handle the BeforeSubmit event but the Submit doesnt get caught.
    Also its seems to spawn a new browser window.
    This occurs for the hosted browser, Internet explorer 8,

    but works in Google Chrome 2.01, Mozilla Firefox 3.5.2, Opera 10, Safari 4.0.3

    My messages field displays ;BeforeSubmit;AfterSubmit in all the working browsers.

    I believe i am using ExtJs GXT 2.0.1.

    Here is my code:
    Code:
    public class ExtJsLoginForm extends LayoutContainer {
        private final TextField<String> usernameDisplay;
        private final TextField<String> passwordDisplay;
        private final FormPanel loginFormPanel;
        private final TextBox messages;
        
        public ExtJsLoginForm() {
            setLayout(new CenterLayout());
            
            //Create a form layout
            FormLayout layout = new FormLayout();  
            layout.setLabelWidth(75);
                    
            //create the form panel
            loginFormPanel = new FormPanel();
            loginFormPanel.setHeaderVisible(false);
            loginFormPanel.setBodyBorder(true);
            loginFormPanel.setWidth(334);
            loginFormPanel.setAction("compiled/secureservices/initLogon/j_security_check"); 
            loginFormPanel.setMethod(Method.POST);
            loginFormPanel.setEncoding(Encoding.URLENCODED);
                    
            //create the log on field set
            FieldSet logonFieldSet = new FieldSet();
            logonFieldSet.setCollapsible(false);
            logonFieldSet.setHeading("Sign in to your Application Form");
            logonFieldSet.setLayout(layout);
            logonFieldSet.setWidth(310);
            
            usernameDisplay = new TextField<String>();
            usernameDisplay.setAllowBlank(true);
            usernameDisplay.setEmptyText("Please enter your username");
            usernameDisplay.setName("j_username");
            usernameDisplay.setFieldLabel("Username");
                    
            passwordDisplay = new TextField<String>();
            passwordDisplay.setAllowBlank(true);
            passwordDisplay.setPassword(true);
            passwordDisplay.setEmptyText("Please enter your password");
            passwordDisplay.setName("j_password");
            passwordDisplay.setFieldLabel("Password");
            
            //Add sign in button
            Button doLoginButton = new Button("Sign in");
            doLoginButton.addSelectionListener(new SelectionListener<ButtonEvent>(){
                @Override
                public void componentSelected(ButtonEvent ce) {
                    boolean valid = true;
                    
                    if(usernameDisplay.getValue()==null || (usernameDisplay.getValue()!=null && usernameDisplay.getValue().equals(""))){                    
                        usernameDisplay.markInvalid("You must enter a username");
                        valid = false;
                    }
                    
                    if(passwordDisplay.getValue()==null || (passwordDisplay.getValue()!=null && passwordDisplay.getValue().equals(""))){                    
                        passwordDisplay.markInvalid("You must enter a password");
                        valid = false;
                    }
                    
                    if(valid){        
                        attemptSignIn();
                    }                
                }
            });
            logonFieldSet.add(usernameDisplay);
            logonFieldSet.add(passwordDisplay);
            
            logonFieldSet.add(doLoginButton);
            
            loginFormPanel.add(logonFieldSet);
            
            loginFormPanel.addListener(Events.BeforeSubmit, new Listener<FormEvent>(){
                @Override
                public void handleEvent(FormEvent be) {
                    //This gets fired
                    System.out.println("Handle Before Submit");    
                    messages.setText(messages.getText()+ ";BeforeSubmit");
                }            
            });
    
            loginFormPanel.addListener(Events.Submit, new Listener<FormEvent>(){
                @Override
                public void handleEvent(FormEvent be) {
                    //This NEVER gets fired
                    System.out.println("Handle after Submit");    
                    messages.setText(messages.getText()+ ";AfterSubmit");
                }            
            });
            messages = new TextBox();
            messages.setText("");
                    
            add(loginFormPanel);
            add(messages);
        }
        
        private void attemptSignIn() {
            String url = GWT.getHostPageBaseURL() + "compiled/secureservices/initLogon";
            RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, url); 
            
              rb.setCallback(new RequestCallback() {
                  public void onResponseReceived(Request request, Response response) {
                      if(response.getStatusCode() ==Response.SC_OK){
                          loginFormPanel.submit();  
                      } else {
                          //handle error with accessing the secure service
                      }
                  }
    
                  public void onError(Request request, Throwable caught) {
                    throw new UnsupportedOperationException("Not supported yet.");
                  }
            }); 
            
            //-------try the send---------
            try { 
              rb.send(); 
            } catch (RequestException ex) { 
                Info.display("Logging In", "Exception Caught");
                
            } 
            //-----end of try send-------
        }
        
        
    }

  3. #13
    Sencha User
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    This is a known issue and already fixedini SVN.

  4. #14
    Ext User
    Join Date
    Nov 2008
    Posts
    44
    Vote Rating
    0
    Feltros is on a distinguished road

      0  

    Default


    I assume by your code that the Remote Procedure Call ability of GWT couldn't do what you require then? Hope the SVN gets working and fixes this for you.

    cbruno - Are you really asking for him to circumvent the licensing system on the public forum? You could have sent him a private message if you wanted to pursue that and not potentially get both of you into trouble.
    The $300 you paid is for commercial rights, for SVN access its another $300 which if its 'that' urgent, you'll just have to pay/get your company to pay. If you don't want to pay/can do without it then simply wait. I know it sounds harsh, but presumably you read the terms and conditions and knew what you were signing up for.

    Sven - if you read previous comments you could have assisted by providing some help on how to build the SVN.

  5. #15
    Ext GWT Premium Member
    Join Date
    Sep 2009
    Posts
    60
    Vote Rating
    1
    aclsoftware is on a distinguished road

      0  

    Default


    Hi Sven..

    Its the getting it from the SVN i am struggling a bit with. My java -jar builder is failing on the trunk\com.extjs.gxt directory. the first message is
    java.io.FileNotFoundException:"<my root>trunk\com.extjs.gxt\src\ext.jsb (The system cannot find the path specified)"

    And i am tryin it the eclipse method but getting errors when i put a GXT SDK (1.7) on my the project build classpath.
    e.g. in HtmlEditor.java i get Formatter cannot be resolved to a type

    Does it specifically need to be GWT 1.5? or am i missing a trick.

    Thanks in advance.

  6. #16
    Sencha User
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    You are using the Ext JS Builder. For GXT you can simple use ant

  7. #17
    Ext GWT Premium Member
    Join Date
    Sep 2009
    Posts
    60
    Vote Rating
    1
    aclsoftware is on a distinguished road

      0  

    Default


    Feltros.. you are like my big brother sticking up for me.. lol.. Agreed, sorry cbruno.. i'm new to this stuff and dont wanna get kicked off already. Sorry.

    In terms of my issue. Yeah. i could probably get this working the "old fashioned" GWT way.. but i;d got it built and looking nice.. and it i read that there is a fix.. so i was soo close i could touch it... so therefore i got my company to stump up for support.

    Thanks again.

  8. #18
    Ext GWT Premium Member
    Join Date
    Sep 2009
    Posts
    60
    Vote Rating
    1
    aclsoftware is on a distinguished road

      0  

    Default


    Hi Sven

    I am going through this item here that feltros kindly found. As i say.... i am up to the point where the source in my eclipse enviroment. I have added GWT 1.7 to the build path but i am getting errors (in fact all of them are with the HTMLEditor.java file). Is GWT 1.7 SDK sufficient?

    I have never used ant (probably cause my version of eclipse (Rational) does most things for me) but will suss that out once there are no errors.

    Can you shed any light on them?

    Thanks again in advance.

  9. #19
    Sencha User
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    You are building from the trunk. This is based on GWT 2.

    You are looking for "releases/2.0"

  10. #20
    Ext GWT Premium Member
    Join Date
    Sep 2009
    Posts
    60
    Vote Rating
    1
    aclsoftware is on a distinguished road

      0  

    Default


    Ahhh.. thanks Sven,

    Is this the latest and greatest version then? I will bring this into my workspace and build this then?