Announcement

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

    Overriding Databound Component (NestedListGrid)

    Hi Guys,

    What is Already Working :
    ===================
    I have a Customer Datasource with some datasource fields and a DatasourceField "Addresses" of Type "DataSource" and Multiple =true. like:

    Code:
    	DataSourceField addresses = new DataSourceField("addresses");
        	addresses.setTypeAsDataSource(adressDS);
        	addresses.setMultiple(true);
    Customer can have many addresses and AdressDS has some fields as well :
    Code:
    public AdressDS(){
        		setID("addressds");
        		DataSourceField f=addDataSourceField("addressid", FieldType.INTEGER, "AdressID", true,false);
        		f.setHidden(true);
        		addDataSourceField("street", FieldType.TEXT, "Straße", false,true);
            	addDataSourceField("houseno", FieldType.TEXT, "Hausnr.", false,true);
            	addDataSourceField("zip", FieldType.TEXT, "Zip.", false,true);
            	addDataSourceField("city", FieldType.TEXT, "Stadt.", false,true);
           	
        	}
    
     protected DataSourceField addDataSourceField(String name, FieldType type,String title,boolean primaryKey,boolean required){
        	DataSourceField f = new DataSourceField(name,type,title);
        	f.setPrimaryKey(primaryKey);
        	f.setRequired(required);
        	addField(f);
        	return f;        	
        }

    I am using GWTRPC datasource and in my "excutefetch" operation of CustomerDS I load Customer data alongwith Addresses and set the attribute "addresses" with the converted Records[] of Adresses for my datasource field.
    (no fetch or update operation is used from addressDS)

    I have bound the CustomerDatasource with a Form. All fields of customerDS are shown with a nestedListGrid with option to add/remove/update the adresses. Please see the attached file

    I found it very pleasing and happy with it since its a very strong feature.


    P R O B L E M :
    ===========
    The only Problem is that i want to customize the layout of this NestedListGrid Component generated by SmartGWT. I though i could override the ListGrid in similar fashion as normal form Fields. but overriding doesn't work.

    Could someone specially Isomorphic can help me with this. I would really appreciate the help

    My implementation is based on the following thread :

    http://forums.smartclient.com/showpo...83&postcount=6
    Attached Files
    Last edited by aze_kool; 20 Mar 2012, 01:07.
Working...
X