Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Uncaught JavaScript exception [Script error.] in , line 0

    Hello,

    I am using SmartGWT 3.0, Firefox 10.0.2, Firefox Developer Plugin 1.0.10862. The very simple entrypoint class below causes a "Uncaught JavaScript exception [Script error.] in , line 0" warning when I run on development mode in Firefox. With Google Chrome or IE9 developer plugin, I do not get the warning.

    I have no idea about how to trace the cause of the problem as the warning message is quite cryptic.

    Code:
    public class LoginTrial implements EntryPoint {
    
    	  final LoginServiceAsync serviceProxy = (LoginServiceAsync) GWT.create(LoginService.class);
    	  final ServiceDefTarget target = (ServiceDefTarget) serviceProxy;	
    	  private VLayout mainLayout;	
    
    	public void onModuleLoad() {
    
    	Window.enableScrolling(false);
    	Window.setMargin("100px");
    	 
    	// initialise the main layout container
    	mainLayout = new VLayout();
    	mainLayout.setWidth100();  
            mainLayout.setHeight100(); 
    	   
    	// Log in form
    	final DynamicForm loginform = new DynamicForm();  
            loginform.setWidth(250); 
            loginform.setID("loginform");
    
            TextItem usernameItem = new TextItem();  
            usernameItem.setTitle("User Name");  
            usernameItem.setRequired(true);  
            usernameItem.setName("username");	
            
            PasswordItem passwordItem = new PasswordItem();  
            passwordItem.setTitle("Password");  
            passwordItem.setRequired(true);  
            passwordItem.setName("password");	
            
            loginform.setFields(new FormItem[] {usernameItem, passwordItem});  
            loginform.setPadding(10);
            loginform.setBorder("1px solid gray");
            
            // Log in Button
            IButton loginbutton = new IButton("Log in");  
            mainLayout.addMember(loginform);    
            mainLayout.addMember(loginbutton);
    
    	// add the main layout container to GWT's root panel 
    	RootLayoutPanel.get().add(mainLayout);  
    	}
    }

    #2
    Do not use RootLayoutPanel.get().add(mainLayout); with SmartGWT. Use mainLayout.draw() instead. Let us know if that helps.

    Comment


      #3
      I have changed it as you have suggested, unfortunately the warning persists.

      Comment


        #4
        Just letting you know that your code does not reproduce a problem. Something is wrong with your project, not the code.

        Comment

        Working...
        X