Announcement

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

    Tab causes JS error in IE in case ID starts with digits

    Hi all,

    2.5.2011-06-21-PE, occurs only in IE.

    Code:
    package com.smartgwt.sample.client;
    
    import com.google.gwt.core.client.EntryPoint;
    import com.smartgwt.client.widgets.Canvas;
    import com.smartgwt.client.widgets.layout.VLayout;
    import com.smartgwt.client.widgets.tab.Tab;
    import com.smartgwt.client.widgets.tab.TabSet;
    
    public class TabEP implements EntryPoint {
        public Canvas getViewPanel() {
            Tab tab = new Tab();
            tab.setID("1abcdef");
            
            TabSet tabSet = new TabSet();
            tabSet.addTab(tab);
            
            VLayout layout = new VLayout();
            layout.addMember(tabSet);
    
            return layout;
        }
    
        @Override
        public void onModuleLoad() {
            getViewPanel().draw();
    
        }
    }
    causes following:
    Code:
    11:15:29.985:WARN:Log:Error:
    	'Expected ')''
    	in http://127.0.0.1:8888/BuiltInDS.html?gwt.codesvr=127.0.0.1:9997
    	at line 1
        [c]Element.insertAdjacentHTML(_1=>[DIVElement]{ID:isc_2}, _2=>"beforeEnd", _3=>"<div id=isc_3 eventProxy=1abcdef style='..."[542], _4=>true)
        Canvas.$q1(_1=>[DIVElement]{ID:isc_2}, _2=>"beforeEnd", _3=>"<div id=isc_3 eventProxy=1abcdef style='..."[542], _4=>true)
        Canvas.$p8(_1=>true)
        Canvas.draw(_1=>undef, undef, undef)
        StatefulCanvas.draw(_1=>undef, _2=>undef, _3=>undef)
        Canvas.predrawPeers()
        ** recursed on Canvas.draw
    removing "1" from tab's ID makes this example working.

    Please fix ASAP.

    Regards,
    Alexey

    #2
    An ID is an identifier and therefore must start with a letter or underscore. That it is working in other browsers is luck.

    Comment


      #3
      Hi David,
      thx for answer. But where this limitation is coming from?

      Comment


        #4
        Because this doesn't affect flexibility in any way, this is not considered a limitation (any more than the inability to use a "9foo" as an identifier in Java is considered a limitation).

        Comment


          #5
          ok, thx. I suppose this is also valid for another components, so I think this should be mentioned in javadoc to setID.

          Comment


            #6
            An assert check has been added to ensure that the ID value provided is legal.

            Sanjiv

            Comment


              #7
              Thx a lot for this change. I think this is a solution for us, because it's possible now to see the real reason of error.

              Cheers,
              Alexey

              Comment

              Working...
              X