Hi,
SmartClient Version: SC_SNAPSHOT-2011-01-25/EVAL Deployment
I have added a standalone testcase, the DataSourceField.setCanEdit(false) doesn't seem to work with custom types?
	
		
			
			
				
	
Regards,
Bart
	
		
							
						
					SmartClient Version: SC_SNAPSHOT-2011-01-25/EVAL Deployment
I have added a standalone testcase, the DataSourceField.setCanEdit(false) doesn't seem to work with custom types?
					Originally posted by documentation
					
				
				
			
		Bart
Code:
	
	public class Standalone implements EntryPoint {
	
	/**
	 * Container for either the login window or the workspace;
	 */
	private static Canvas masterPanel = null;	
	 public void onModuleLoad() {  
	 		
		masterPanel = new Canvas(); 
		masterPanel.setHeight100();
		masterPanel.setWidth100();
		masterPanel.setStyleName("pageBackground"); //background style from skin
			  
		    DataSource dataSource = new DataSource();   
		    
                     //Plain old TextItem
	        DataSourceField myTextField1 = new DataSourceField();   
	        myTextField1.setName("textField1");   
	        myTextField1.setTitle("textField1");   
	        myTextField1.setCanEdit(false);
		    
                     //Custom TextItem
	        DataSourceField myTextField2 = new DataSourceField();   
	        myTextField2.setName("textField2");   
	        myTextField2.setTitle("textField2");   
	        myTextField2.setType(new MyTextType());   
	        myTextField2.setEditorType(new MyTextEditor());
	        myTextField2.setCanEdit(false);
	  
	        dataSource.setFields(myTextField1, myTextField2);  
		    //the order list grid   
		    DynamicForm form = new DynamicForm();   
		    form.setHeight(170);   
		    form.setWidth(500);
		    form.setDataSource(dataSource);    
		
			masterPanel.addChild(form);
			masterPanel.draw();	
		}
	    
    public static class MyTextType extends SimpleType {   
        public MyTextType() {   
            super("myTextType", FieldType.ANY);   
 
        }   
    }  
    
    private class MyTextEditor extends TextItem {
    	private String text;
    	public MyTextEditor() {
    		super();
    		
    	}
    }
}

Comment