Announcement

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

    ListGridField with dot

    Hello there,
    I have problem with ListGrid and new SmartGWT 3.1p library (upgraded from 3.0). All DataSourceTextFields with dot in name (ie. "2012.12") are empty but with older version of smartGWT was everything fine.

    Do I have check'n'fix all fields with dot? Most of my fields are automatically generated and their names depends on used data (and this data are not static), so... :S

    Code:
    	public void onModuleLoad() {
    		ListGrid lg = new ListGrid();
    		ListGridRecord lr = new ListGridRecord();
    		lr.setAttribute("x.y", "vallll");
    		lr.setAttribute("ab", "bbbbb");
    		lr.setAttribute("pk", "key");
    		SimpleDS sd = new SimpleDS();
    		sd.addData(lr);
    		lg.setDataSource(sd);
    		lg.fetchData();
    		lg.show();
    	}
    
    	public class SimpleDS extends DataSource {
    		public SimpleDS(){
    			super();
    			setClientOnly(true);
    			DataSourceTextField pk = new DataSourceTextField("pk", "pk");
    			pk.setPrimaryKey(true);
    			addField(pk);
    			addField(new DataSourceTextField("x.y", "x.y"));
    			addField(new DataSourceTextField("ab", "ab"));
    			
    		}
    	}
    SmartGWT 3.1p, GWT 2.5, FireFox 16.0.2

    #2
    Field names must be valid identifiers, so a dot is not allowed.

    This has always been the case, and always broke functionality, it's just more obvious now.

    If you have dynamically generated field names, you just need to translate special characters such as dot to "_" or another valid identifier character.

    Comment


      #3
      I was expecting answer of this kind but was lazy to admit it :) Thanks for quick reply...

      Comment

      Working...
      X