package com.smartgwt.sample.client;
import com.smartgwt.client.data.DataSource;
import com.smartgwt.client.data.fields.DataSourceTextField;
public class ClientOnlyDS extends DataSource {
	private static ClientOnlyDS instance = null;  
	  
    public static ClientOnlyDS getInstance() {  
        if (instance == null) {  
            instance = new ClientOnlyDS("ClientOnlyDS");  
        }  
        return instance;  
    }  
  
    public ClientOnlyDS(String id) {  
  
        setID(id);  
        setRecordXPath("/List/branch");  
  
  
        DataSourceTextField idField = new DataSourceTextField("id", "ID");  
        idField.setPrimaryKey(true);  
        idField.setHidden(true); 
        idField.setRequired(true);  
        
        DataSourceTextField flagIdField = new DataSourceTextField("flagId", "Name");  
        flagIdField.setRequired(true);  

        DataSourceTextField nameField = new DataSourceTextField("name", "Name");  
        nameField.setRequired(true);  
  
  
        setFields(idField, flagIdField, nameField);  
  
        setDataURL("ds/test_data/branch.data.xml");  
          
        setClientOnly(true);  
  
    }  
}
