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("answerId", "answerId");  
        flagIdField.setRequired(true);  

        DataSourceTextField valueField = new DataSourceTextField("value", "value");  
        valueField.setRequired(true);  
  
        DataSourceTextField displayTextField = new DataSourceTextField("displayText", "displayText");  
        displayTextField.setRequired(true); 
  
        setFields(idField, flagIdField, valueField, displayTextField);  
  
        setDataURL("ds/branch.data.xml");  
          
        setClientOnly(true);  
  
    }  
}
