[CLOSED] Javascript error when showing window (bug?)

  1. #1

    [CLOSED] Javascript error when showing window (bug?)

    I have a window created programatically with a grid within it, that is shown when user clicks a button. If i click the button, then close the window a few times i start getting this javascript error (it works correctly a few times, but then suddenly i start to get the error and the window is shown, but the grid inside it is not):
    "Invalid procedure call or argument" in "h.cssText=i"

    Here is how i make the window:
      protected void ShowError()
            {
                Window WinError = Page.X().Window()
                                    .ID("WinShowErro")
                                    .Title("Mensagem de Erro")
                                    .Height(185)
                                    .Width(500)
                                    .Layout("Fit")
                                    .Modal(true);
                WinError.Render(Page.Form);
    
                GridPanel GRPError = Page.X().GridPanel().ID("GRPErro")
                                    .Height(125)
                                    .Width(330)
                                    .AutoExpandColumn("message");
    
                GRPError.SelectionModel.Add(new RowSelectionModel() { SingleSelect = true });
    
                Store storeErro = Page.X().Store().ID("storeErro");
    
                JsonReader drErro = new JsonReader();
    
                drErro.Fields.Add("Tipo", RecordFieldType.String);           
                drErro.Fields.Add("Codigo", RecordFieldType.String);
                drErro.Fields.Add("Message", RecordFieldType.String);
    
                storeErro.Reader.Add(drErro);
                GRPError.Store.Add(storeErro);
    
                RM.RegisterIcon(Icon.Decline);
                RM.RegisterIcon(Icon.Error);
                RM.RegisterIcon(Icon.Information);            
           
                
                Column col;
                
                col = new Column();
    
                col.Header = "Tipo";
                col.DataIndex = "Tipo";
                col.MenuDisabled = true;
                col.RightCommandAlign = false;
    
                ImageCommand ICErro = new ImageCommand();
                ICErro.Hidden = true;
                ICErro.CommandName = "Erro";
                ICErro.Icon = Icon.Decline;
                col.Commands.Add(ICErro);
    
                ImageCommand ICWarning = new ImageCommand();
                ICWarning.Hidden = true;
                ICWarning.CommandName = "Warning";
                ICWarning.Icon = Icon.Error;
                col.Commands.Add(ICWarning);
    
                ImageCommand ICMessage = new ImageCommand();
                ICMessage.Hidden = true;
                ICMessage.CommandName = "Message";
                ICMessage.Icon = Icon.Information;
                col.Commands.Add(ICMessage);
    
                col.PrepareCommand.Fn = "SetIcon";
    
                GRPError.ColumnModel.Columns.Add(col);
    
                col = new Column();
                
                col.Header = "Código";
                col.DataIndex = "Codigo";
                col.MenuDisabled=true;
    
                GRPError.ColumnModel.Columns.Add(col);
    
                col = new Column();
    
                col.Header = "Descrição";
                col.DataIndex = "Message";
                col.ColumnID = "message";
                col.MenuDisabled=true;
    
                GRPError.ColumnModel.Columns.Add(col);
         
                storeErro.DataSource = ErrorList;
                storeErro.DataBind();
    
                GRPError.Render("WinShowErro", RenderMode.AddTo);
            }
    Last edited by geoffrey.mcgill; Aug 25, 2010 at 6:42 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Please move RegisterIcon callings to the Page_Load
    protected void Page_Load(object sender, EventArgs e)
    {
           if(!X.IsAjaxRequest)
           {
                 RM.RegisterIcon(Icon.Decline);
                 RM.RegisterIcon(Icon.Error);
                 RM.RegisterIcon(Icon.Information);        
           }
    }
    We are working on fix for that problem (at this moment, please use above workaround)
  3. #3
    Thanks, the workaround seems to have solved the problem.

Similar Threads

  1. Replies: 11
    Last Post: Mar 30, 2011, 2:21 PM
  2. Replies: 0
    Last Post: Mar 29, 2011, 5:32 PM
  3. Always showing javascript error
    By vs.mukesh in forum 1.x Help
    Replies: 18
    Last Post: Mar 25, 2011, 5:34 AM
  4. Replies: 3
    Last Post: Jun 28, 2010, 5:14 PM
  5. Replies: 3
    Last Post: Jul 11, 2008, 10:41 AM

Posting Permissions