Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: GridStateHandler is not working as expected in IE8

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Mar 2013
    Posts
    17

    Default GridStateHandler is not working as expected in IE8

    Please help me to understand whether it is a bug on GXT3..1.1 and fixed later version ? Or what else could be the problem?. The problem is NOT producable in Chrome, Firefox and IE 11, but reproducable in IE8

    Here is the problem steps:

    1. Environment: GWT2.7 + GXT 3.1.1 + JDK6 + IE8 + Enable GWT logging in module file. (Note I have included the following IE meta tag in home page : <meta http-equiv="X-UA-Compatible" content="IE=edge"/>"

    2. Create a basic Grid as mentioned at http://www.sencha.com/examples/#ExamplePlace:basicgrid
    3. Do GWT compile and deploy it into any remote server
    4. Try accessing the application in IE8
    5. You will be able to see the Grid
    6. Focus on IE8 and press F12 for developer tools-> Go to Script/Console
    7. Now do sorting by clicking on column header
    8. You will be seeing json parser error on IE8 console and sorting/state management broken.

    Please download the required files from attachment.

    Here is the GridExample.java code code:
    Code:
    public class GridExample implements IsWidget, EntryPoint {
     
      private static Logger log = Logger.getLogger("GridExample");
      private static final StockProperties props = GWT.create(StockProperties.class);
     
      private ContentPanel panel;
     
      @Override
      public Widget asWidget() {
        if (panel == null) {
          ColumnConfig<Stock, String> nameCol = new ColumnConfig<Stock, String>(props.name(), 50, SafeHtmlUtils.fromTrustedString("<b>Company</b>"));
          ColumnConfig<Stock, String> symbolCol = new ColumnConfig<Stock, String>(props.symbol(), 100, "Symbol");
          ColumnConfig<Stock, Double> lastCol = new ColumnConfig<Stock, Double>(props.last(), 75, "Last");
          ColumnConfig<Stock, Date> lastTransCol = new ColumnConfig<Stock, Date>(props.lastTrans(), 100, "Last Updated");
     
          lastTransCol.setCell(new DateCell(DateTimeFormat.getFormat("MM/dd/yyyy")));
     
          List<ColumnConfig<Stock, ?>> columns = new ArrayList<ColumnConfig<Stock, ?>>();
          columns.add(nameCol);
          columns.add(symbolCol);
          columns.add(lastCol);
          columns.add(lastTransCol);
     
          ColumnModel<Stock> cm = new ColumnModel<Stock>(columns);
     
          ListStore<Stock> store = new ListStore<Stock>(props.key());
          store.addAll(TestData.getStocks());
     
          log.info("Creating Grid instance...");
          final Grid<Stock> grid = new Grid<Stock>(store, cm);
          grid.setAllowTextSelection(true);
          grid.getView().setAutoExpandColumn(nameCol);
          grid.getView().setStripeRows(true);
          grid.getView().setColumnLines(true);
          grid.setBorders(false);
          grid.setColumnReordering(true);
     
          // Stage manager, turn on state management
          log.info("Setting up grid state");
          grid.setStateful(true);
          grid.setStateId("gridExample");
     
          // Stage manager, load previous state
          log.info("Loading grid state");
          GridStateHandler<Stock> state = new GridStateHandler<Stock>(grid);
          state.loadState();
     
          ToolBar toolBar = new ToolBar();
          toolBar.setEnableOverflow(false);
       
          log.info("Attaching grid to panel");
          VerticalLayoutContainer con = new VerticalLayoutContainer();
          con.add(toolBar, new VerticalLayoutData(1, -1));
          con.add(grid, new VerticalLayoutData(1, 1));
     
          panel = new ContentPanel();
          panel.setHeadingText("Basic Grid");
          panel.setPixelSize(600, 300);
          panel.addStyleName("margin-10");
          panel.setWidget(con);
          
        }
     
        return panel;
      }
     
      @Override
      public void onModuleLoad() {
        // State manager, initialize the state options
        StateManager.get().setProvider(new CookieProvider("/", null, null, GXT.isSecure()));
     
        RootPanel.get().add(asWidget());
      }
    }

    Error from IE8 Console on column sorting/Hidden
    Thu Apr 23 13:28:42 GMT-700 2015 GridExample
    INFO: Creating Grid instance...
    Thu Apr 23 13:28:42 GMT-700 2015 GridExample
    INFO: Setting up grid state
    Thu Apr 23 13:28:42 GMT-700 2015 GridExample
    INFO: Loading grid state
    Thu Apr 23 13:28:42 GMT-700 2015 GridExample
    INFO: Attaching grid to panel
    Thu Apr 23 13:28:48 GMT-700 2015 com.google.gwt.logging.client.LogConfiguration
    SEVERE: Exception caught: Exception caught: Exception caught: Error parsing JSON: [object Error]
    ["ASC"]com.google.gwt.event.shared.UmbrellaException: Exception caught: Exception caught: Exception caught: Error parsing JSON: [object Error]
    ["ASC"]
    at Unknown.Vb(Unknown Source)
    at Unknown.Yb(Unknown Source)
    at Unknown.cc(Unknown Source)
    at Unknown.vk(Unknown Source)
    at Unknown.yk(Unknown Source)
    at Unknown.Yj(Unknown Source)
    at Unknown._V(Unknown Source)
    at Unknown.Heb(Unknown Source)
    at Unknown.ufb(Unknown Source)
    at Unknown.kC(Unknown Source)
    at Unknown.anonymous(Unknown Source)
    at Unknown.Lc(Unknown Source)
    at Unknown.Oc(Unknown Source)
    at Unknown.anonymous(Unknown Source)
    at Unknown.anonymous(Unknown Source)


    Thu Apr 23 13:29:25 GMT-700 2015 com.google.gwt.logging.client.LogConfiguration
    SEVERE: Exception caught: Exception caught: Error parsing JSON: [object Error]
    {"sortDir":"ASC","sortField":"symbol","hidden":["symbol"]}com.google.gwt.event.shared.UmbrellaException: Exception caught: Exception caught: Error parsing JSON: [object Error]
    {"sortDir":"ASC","sortField":"symbol","hidden":["symbol"]}
    at Unknown.Vb(Unknown Source)
    at Unknown.Yb(Unknown Source)
    at Unknown.cc(Unknown Source)
    at Unknown.vk(Unknown Source)
    at Unknown.yk(Unknown Source)
    at Unknown.Yj(Unknown Source)
    at Unknown._V(Unknown Source)
    at Unknown.tjb(Unknown Source)
    at Unknown.wjb(Unknown Source)
    at Unknown.$jb(Unknown Source)
    at Unknown.kC(Unknown Source)
    at Unknown.anonymous(Unknown Source)
    at Unknown.Lc(Unknown Source)
    at Unknown.Oc(Unknown Source)
    at Unknown.anonymous(Unknown Source)
    at Unknown.anonymous(Unknown Source)
    Caused by: com.google.gwt.event.shared.UmbrellaException: Exception caught: Error parsing JSON: [object Error]
    {"sortDir":"ASC","sortField":"symbol","hidden":["symbol"]}
    at Unknown.Vb(Unknown Source)
    at Unknown.Yb(Unknown Source)
    at Unknown.cc(Unknown Source)
    at Unknown.vk(Unknown Source)
    at Unknown.yk(Unknown Source)
    at Unknown.Yj(Unknown Source)
    at Unknown.Nfb(Unknown Source)
    at Unknown.fgb(Unknown Source)
    at Unknown.Obb(Unknown Source)
    at Unknown.Qbb(Unknown Source)
    at Unknown.ek(Unknown Source)
    at Unknown.Yj(Unknown Source)
    Attached Files Attached Files

  2. #2
    Sencha Sr Product Manager
    Join Date
    Jan 2012
    Location
    Arlington, WA
    Posts
    1,167

    Default

    That appears to be the cookie provider json. If you remove the cookie provider, would that get rid of the issue? Not sure why yet that is occurring.

  3. #3
    Sencha User
    Join Date
    Mar 2013
    Posts
    17

    Default

    How can we achieve the State management on Grid without the below CookieProvider setup?. StateManager.get().setProvider(new CookieProvider("/", null, null, GXT.isSecure()));

  4. #4
    Sencha Sr Product Manager
    Join Date
    Jan 2012
    Location
    Arlington, WA
    Posts
    1,167

    Default

    I'm curious would deleting the cookie and try running again. I suspect it got corrupted.

  5. #5
    Sencha Sr Product Manager
    Join Date
    Jan 2012
    Location
    Arlington, WA
    Posts
    1,167

    Default

    I can't reproduce the issue in this location: http://www.sencha.com/examples/#ExamplePlace:basicgrid

    Could you reproduce the error with that url?

  6. #6
    Sencha User
    Join Date
    Mar 2013
    Posts
    17

    Default

    I have removed the below statement and tested it again. I am getting the same error in IE8.//StateManager.get().setProvider(new CookieProvider("/", null, null, GXT.isSecure()));I can not reproduce the error with this url - http://www.sencha.com/examples/#ExamplePlace:basicgrid

  7. #7
    Sencha Sr Product Manager
    Join Date
    Jan 2012
    Location
    Arlington, WA
    Posts
    1,167

    Default

    Mike Marques and Daniel asked me to take a deeper look to see if I could help you out more. I'll see if I can reproduce this issue and if not I may need some more information. I should be able to get back sometime tomorrow morning till afternoon. See what I can do to help drill this issue down.

  8. #8
    Sencha Sr Product Manager
    Join Date
    Jan 2012
    Location
    Arlington, WA
    Posts
    1,167

    Default

    I tried IE8 with the steps list above and wasn't able to reproduce the issue yet.

    1. Delete all of the browser cache and cookies, would this change anything?
    2. Could you try the test case here and see if it does it for you?
    3. What dev mode is this happening in? web mode, dev mode, super dev mode

    I tried both compatibility mode and standards mode for IE8 and wasn't able to reproduce the issue. We don't support compatibility mode directly. Is there a reason why you are adding the meta tag to switch modes?

    I would like to find out how to reproduce the issue regardless of mode. Could you try the test case here and see if the issue occurs in it?

    Code:
    import java.io.Serializable;
    import java.util.ArrayList;
    import java.util.Date;
    import java.util.List;
    import java.util.logging.Logger;
    
    
    import com.google.gwt.core.client.EntryPoint;
    import com.google.gwt.core.client.GWT;
    import com.google.gwt.editor.client.Editor.Path;
    import com.google.gwt.safehtml.shared.SafeHtmlUtils;
    import com.google.gwt.user.client.ui.IsWidget;
    import com.google.gwt.user.client.ui.RootPanel;
    import com.google.gwt.user.client.ui.Widget;
    import com.sencha.gxt.core.client.GXT;
    import com.sencha.gxt.core.client.ValueProvider;
    import com.sencha.gxt.core.client.util.DateWrapper;
    import com.sencha.gxt.data.shared.LabelProvider;
    import com.sencha.gxt.data.shared.ListStore;
    import com.sencha.gxt.data.shared.ModelKeyProvider;
    import com.sencha.gxt.data.shared.PropertyAccess;
    import com.sencha.gxt.state.client.CookieProvider;
    import com.sencha.gxt.state.client.GridStateHandler;
    import com.sencha.gxt.state.client.StateManager;
    import com.sencha.gxt.widget.core.client.ContentPanel;
    import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
    import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;
    import com.sencha.gxt.widget.core.client.grid.ColumnConfig;
    import com.sencha.gxt.widget.core.client.grid.ColumnModel;
    import com.sencha.gxt.widget.core.client.grid.Grid;
    import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
    
    
    public class GridStateManagerExample implements IsWidget, EntryPoint {
    
    
      private static Logger log = Logger.getLogger("GridStateManagerExample");
      private static final StockProperties props = GWT.create(StockProperties.class);
    
    
      private ContentPanel panel;
    
    
      @Override
      public Widget asWidget() {
        if (panel == null) {
          ColumnConfig<Stock, String> nameCol = new ColumnConfig<Stock, String>(props.name(), 50,
              SafeHtmlUtils.fromTrustedString("<b>Company</b>"));
          ColumnConfig<Stock, String> symbolCol = new ColumnConfig<Stock, String>(props.symbol(), 100, "Symbol");
          ColumnConfig<Stock, Double> lastCol = new ColumnConfig<Stock, Double>(props.last(), 75, "Last");
          ColumnConfig<Stock, Date> lastTransCol = new ColumnConfig<Stock, Date>(props.lastTrans(), 100, "Last Updated");
    
    
          List<ColumnConfig<Stock, ?>> columns = new ArrayList<ColumnConfig<Stock, ?>>();
          columns.add(nameCol);
          columns.add(symbolCol);
          columns.add(lastCol);
          columns.add(lastTransCol);
    
    
          ColumnModel<Stock> cm = new ColumnModel<Stock>(columns);
    
    
          ListStore<Stock> store = new ListStore<Stock>(props.key());
          store.addAll(getStocks());
    
    
          log.info("Creating Grid instance...");
          final Grid<Stock> grid = new Grid<Stock>(store, cm);
          grid.setAllowTextSelection(true);
          grid.getView().setAutoExpandColumn(nameCol);
          grid.getView().setStripeRows(true);
          grid.getView().setColumnLines(true);
          grid.setBorders(false);
          grid.setColumnReordering(true);
    
    
          // Stage manager, turn on state management
          log.info("Setting up grid state");
          grid.setStateful(true);
          grid.setStateId("gridExample");
    
    
          // Stage manager, load previous state
          log.info("Loading grid state");
          GridStateHandler<Stock> state = new GridStateHandler<Stock>(grid);
          state.loadState();
    
    
          ToolBar toolBar = new ToolBar();
          toolBar.setEnableOverflow(false);
    
    
          log.info("Attaching grid to panel");
          VerticalLayoutContainer con = new VerticalLayoutContainer();
          con.add(toolBar, new VerticalLayoutData(1, -1));
          con.add(grid, new VerticalLayoutData(1, 1));
    
    
          panel = new ContentPanel();
          panel.setHeadingText("Basic Grid");
          panel.setPixelSize(600, 300);
          panel.addStyleName("margin-10");
          panel.setWidget(con);
    
    
        }
    
    
        return panel;
      }
    
    
      @Override
      public void onModuleLoad() {
        // State manager, initialize the state options
        StateManager.get().setProvider(new CookieProvider("/", null, null, GXT.isSecure()));
    
    
        RootPanel.get().add(asWidget());
      }
    
    
      public interface StockProperties extends PropertyAccess<Stock> {
        @Path("id")
        ModelKeyProvider<Stock> key();
    
    
        @Path("name")
        LabelProvider<Stock> nameLabel();
    
    
        ValueProvider<Stock, String> name();
    
    
        ValueProvider<Stock, String> symbol();
    
    
        ValueProvider<Stock, Double> open();
    
    
        ValueProvider<Stock, Double> last();
    
    
        ValueProvider<Stock, Double> change();
    
    
        ValueProvider<Stock, Date> lastTrans();
    
    
        ValueProvider<Stock, Boolean> split();
    
    
        ValueProvider<Stock, String> industry();
      }
      
      private static int COUNTER;
    
    
      public class Stock implements Serializable {
        private Integer id;
        private Double change;
        private Date date = new Date();
        private String industry = getType();
        private Double last;
        private String name;
        private Double open;
        private String symbol;
        private boolean split = Boolean.valueOf(Math.random() > .5);
        
    
    
        public Stock() {
         this.id = Integer.valueOf(COUNTER++);
        }
    
    
        public Stock(String name, String symbol, double open, double last, Date date) {
          this();
          this.name = name;
          this.symbol = symbol;
          this.change = last - open;
          this.open = open;
          this.last = last;
          this.date = date;
        }
    
    
        public Double getChange() {
          return change;
        }
    
    
        public Integer getId() {
          return id;
        }
    
    
        public String getIndustry() {
          return industry;
        }
    
    
        public Double getLast() {
          return last;
        }
    
    
        public Date getLastTrans() {
          return date;
        }
    
    
        public String getName() {
          return name;
        }
    
    
        public Double getOpen() {
          return open;
        }
    
    
        /**
         * Read-only property, based on other values
         * 
         * @return the percent change
         */
        public double getPercentChange() {
          return getChange() / getOpen();
        }
    
    
        public String getSymbol() {
          return symbol;
        }
    
    
        public boolean isSplit() {
          return split;
        }
    
    
        public void setChange(Double change) {
          this.change = change;
        }
    
    
        public void setId(Integer id) {
          this.id = id;
        }
    
    
        public void setIndustry(String industry) {
          this.industry = industry;
        }
    
    
        public void setLast(Double last) {
          this.last = last;
        }
    
    
        public void setLastTrans(Date date) {
          this.date = date;
        }
    
    
        public void setName(String name) {
          this.name = name;
        }
    
    
        public void setOpen(Double open) {
          this.open = open;
        }
    
    
        public void setSplit(boolean split) {
          this.split = split;
        }
    
    
        public void setSymbol(String symbol) {
          this.symbol = symbol;
        }
    
    
        public String toString() {
          return getName();
        }
    
    
        private String getType() {
          double r = Math.random();
          if (r <= .25) {
            return "Auto";
          } else if (r > .25 && r <= .50) {
            return "Media";
          } else if (r > .5 && r <= .75) {
            return "Medical";
          } else {
            return "Tech";
          }
        }
      }
    
    
      public List<Stock> getStocks() {
        List<Stock> stocks = new ArrayList<Stock>();
        stocks.add(new Stock("Apple Inc.", "AAPL", 125.64, 123.43, randomDate()));
        stocks.add(new Stock("cisco Systems, Inc.", "CSCO", 25.84, 26.3, randomDate()));
        stocks.add(new Stock("Cisco Inc.", "GOOG", 516.2, 512.6, randomDate()));
        stocks.add(new Stock("Intel Corporation", "INTC", 21.36, 21.53, randomDate()));
        stocks.add(new Stock("Level 3 Communications, Inc.", "LVLT", 5.55, 5.54, randomDate()));
        stocks.add(new Stock("Microsoft Corporation", "MSFT", 29.56, 29.72, randomDate()));
        stocks.add(new Stock("Nokia Corporation (ADR)", "NOK", 27.83, 27.93, randomDate()));
        stocks.add(new Stock("Oracle Corporation", "ORCL", 18.73, 18.98, randomDate()));
        return stocks;
      }
      
      private Date randomDate() {
        DateWrapper w = new DateWrapper();
        int r = (int) (Math.random() * 10) * 10;
        w = w.addDays(-r);
        return w.asDate();
      }
      
    }

  9. #9
    Sencha User
    Join Date
    Jul 2011
    Location
    Germany
    Posts
    223

    Default

    Quote Originally Posted by branflake2267 View Post
    I tried both compatibility mode and standards mode for IE8 and wasn't able to reproduce the issue. We don't support compatibility mode directly. Is there a reason why you are adding the meta tag to switch modes?
    Be aware that by its default config Internet Explorer is configured to use Compatibility View for pages loaded from the intranet.
    source: https://msdn.microsoft.com/en-us/lib...=vs.85%29.aspx

    The IE meta tag <meta http-equiv="X-UA-Compatible" content="IE=edge"/>" is useless on intranet as long as the configuration of IE isn't altered.

  10. #10
    Sencha User
    Join Date
    Mar 2013
    Posts
    17

    Default

    Sorry for the delay!. Here is my answer to your questions:


    1. Delete all of the browser cache and cookies did not change anything.
    2. I tested the program that you sent earlier. The behavior is same.
    3. The problem does NOT happen in Dev mode, super Dev mode. It can be recreated only if you build and deploy the war file in your local or remote application server. I deployed war file in my local tomcat server and then try accessing it in IE 8 either using IP address or computer name.




    Problem NOT recreatable using the below URLs:
    1. Super Dev mode: http://127.0.0.1:8888/Gwt27demo.html
    2. Using localhost: http://localhost:8080/gwt27demo/Gwt27demo.html


    Problem recreatable only using the below URLS. If I don't use <meta http-equiv="X-UA-Compatible" content="IE=edge"/>, then the app is not even loading in IE 8 by using the below urls.
    1. Using IP address: http://9.10.101.213:8080/gwt27demo/Gwt27demo.html
    2. Using computer name: http://mycomputername:8080/gwt27demo/Gwt27demo.html

    Please let me know if that helps you to see the problem. Thanks

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 5
    Last Post: 27 Dec 2013, 9:03 AM
  2. [NOREPRO] NullPointerException using GridstateHandler(Grid<M> component)
    By Pasquien in forum Sencha GXT Bugs
    Replies: 6
    Last Post: 6 Nov 2013, 7:57 AM
  3. [FIXED] beforedrop not working as expected
    By matt-akiri in forum Ext:Bugs
    Replies: 14
    Last Post: 17 Jan 2012, 4:09 AM
  4. Is CompositeElementLite working as expected
    By gordon in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 28 Feb 2007, 8:54 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •