Announcement

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

    Calendar - EventEditor - Chrome / FF error

    Hi everyone,
    1. the SmartGWT or SmartClient version and browser version(s) involved;
    I'm using Chomium 12.0.742.112 (90304) Ubuntu 11.04
    and FF 4
    Smartgwt 2.4

    I have a problem when trying to use calendar event editor fields. Here is my code

    Code:
    package com.bee.client.calendar;
    
    import com.bee.client.datasource.EventDS;
    import com.bee.client.fwk.application.ApplicationContext;
    import com.bee.client.view.resources.Resources;
    import com.smartgwt.client.data.Criteria;
    import com.smartgwt.client.widgets.calendar.Calendar;
    import com.smartgwt.client.widgets.form.fields.SelectItem;
    import com.smartgwt.client.widgets.form.fields.TextItem;
    
    public class BeeCalendar extends Calendar {
    
    	private EventDS eventDS = (EventDS) ApplicationContext.instance().getDSFactory().getEventDS();
    	private String projectId;
    
    	public BeeCalendar() {
    
    		this.setDataSource(eventDS);
    
    		this.initCalendar();
    
    		// RECORDATORIO
    		TextItem reminderValue = getReminderValue();
    		SelectItem reminderUnits = getReminderUnits();
    
    		// INVITADOS
    		SelectItem invitees = new InviteeList();
    		invitees.setAttribute("optionDataSource", "InviteeDS");
    
    		this.setEventEditorFields(reminderValue, reminderUnits, invitees);
    		
    	}
    
    	public void fetchData(Criteria criteria, String projectId) {
    		this.getEventDS().setProjectId(projectId);
    		super.fetchData(criteria);
    	}
    
    	private void initCalendar() {
    		this.setEventAutoArrange(true);
    		this.setEventOverlap(true);
    		this.setEventOverlapPercent(10);
    		this.setEventOverlapIdenticalStartTimes(false);
    		this.setShowWorkday(true);
    		this.setScrollToWorkday(true);
    		this.setWorkdayStart("8:30am");
    		this.setWorkdayEnd("7:30pm");
    	}
    
    
    	private TextItem getReminderValue() {
    		TextItem reminderValue = new TextItem();
    		reminderValue.setName("reminderValue");
    		reminderValue.setTitle(Resources.texts().reminder());
    		reminderValue.setDefaultValue(10);
    		reminderValue.setWidth(65);
    		reminderValue.setColSpan(1);
    		return reminderValue;
    	}
    
    	private SelectItem getReminderUnits() {
    		SelectItem reminderUnits = new SelectItem();
    		reminderUnits.setName("reminderUnit");
    		reminderUnits.setShowTitle(false);
    		reminderUnits.setWidth(65);
    		reminderUnits.setDefaultToFirstOption(true);
    		reminderUnits.setValueMap(Resources.texts().minutes(), Resources.texts().hours(), Resources.texts().days());
    		reminderUnits.setColSpan(1);
    
    		return reminderUnits;
    	}
    
    }

    EventDS
    Code:
     
    package com.bee.client.datasource;
    
    import java.util.HashMap;
    import java.util.Map;
    
    import com.bee.client.application.BeeSession;
    import com.bee.client.fwk.datasource.BaseRESTDataSource;
    import com.bee.client.view.resources.Resources;
    import com.smartgwt.client.data.DSRequest;
    import com.smartgwt.client.data.DataSourceField;
    import com.smartgwt.client.data.fields.DataSourceBooleanField;
    import com.smartgwt.client.data.fields.DataSourceDateTimeField;
    import com.smartgwt.client.data.fields.DataSourceSequenceField;
    import com.smartgwt.client.data.fields.DataSourceTextField;
    import com.smartgwt.client.types.FieldType;
    import com.smartgwt.client.widgets.form.fields.SelectItem;
    import com.smartgwt.client.widgets.form.fields.TextItem;
    
    public class EventDS extends BaseRESTDataSource {
    
    	protected EventDS(String id) {
    		super(id);
    	}
    
    	private static final String ID = "EventDS";
    
    	private static EventDS instance;
    
    	private String projectId;
    
    	public static EventDS getInstance() {
    		if (instance == null) {
    			instance = new EventDS(ID);
    		}
    		return instance;
    	}
    
    	@Override
    	protected String getResponseXPath() {
    		return "/response/data/event";
    	}
    
    	protected DataSourceField[] getDataSourceFields() {
    
    		DataSourceSequenceField eventIdField = new DataSourceSequenceField("id");
    		eventIdField.setPrimaryKey(true);
    		eventIdField.setHidden(true);
    
    		DataSourceTextField itemNameField = new DataSourceTextField("name");
    		itemNameField.setRequired(true);
    
    		DataSourceTextField itemDescriptionField = new DataSourceTextField("description");
    		itemDescriptionField.setRequired(false);
    
    		DataSourceDateTimeField itemStartDateField = new DataSourceDateTimeField("startDate");
    		itemStartDateField.setRequired(true);
    
    		DataSourceDateTimeField itemEndDateField = new DataSourceDateTimeField("endDate");
    		itemEndDateField.setRequired(false);
    
    		DataSourceTextField reminderValueField = new DataSourceTextField("reminderValue");
    		reminderValueField.setRequired(false);
    		
    		DataSourceField reminderUnitField = new DataSourceField("reminderUnit", FieldType.TEXT);
    		reminderUnitField.setRequired(false);
    		
    		DataSourceBooleanField canEdit = new DataSourceBooleanField("canEdit");
    
    		return new DataSourceField[] { eventIdField, itemNameField, itemDescriptionField, itemStartDateField, itemEndDateField, reminderValueField,
    				reminderUnitField, canEdit };
    	}
    
    	@Override
    	protected Object transformRequest(DSRequest dsRequest) {
    		Map<String, String> defaultParams = new HashMap<String, String>();
    		defaultParams.put(BaseRESTDataSource.ACCESS_TOKEN, BeeSession.getUserAccessToken());
    		defaultParams.put("projectId", getProjectId());
    		setDefaultParams(defaultParams);
    
    		return super.transformRequest(dsRequest);
    	}
    
    
    
    }
    When i run it in dev mode in chrome i get:

    Code:
     
    00:38:00.709 [ERROR] 16:01:56.471:XRP8:WARN:DynamicForm:isc_BeeCalendar_0_eventEditor:[Class TextItem] form item defined with no 'name' property - Value will not be saved. To explicitly exclude a form item from the set of values to be saved, set 'shouldSaveValue' to false for this item.
    com.smartgwt.client.core.JsObject$SGWT_WARN: 16:01:56.471:XRP8:WARN:DynamicForm:isc_BeeCalendar_0_eventEditor:[Class TextItem] form item defined with no 'name' property - Value will not be saved. To explicitly exclude a form item from the set of values to be saved, set 'shouldSaveValue' to false for this item. 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) 	at java.lang.reflect.Constructor.newInstance(Constructor.java:513) 	at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105) 	at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) 	at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157) 	at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326) 	at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207) 	at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:126) 	at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561) 	at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269) 	at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91) 	at com.smartgwt.client.widgets.calendar.Calendar.create(Calendar.java) 	at com.smartgwt.client.widgets.BaseWidget.getOrCreateJsObj(BaseWidget.java:356) 	at sun.reflect.GeneratedMethodAccessor140.invoke(Unknown Source) 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 	at java.lang.reflect.Method.invoke(Method.java:597) 	at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103) 	at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) 	at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157) 	at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326) 	at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207) 	at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:126) 	at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561) 	at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:289) 	at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107) 	at com.smartgwt.client.widgets.calendar.Calendar.fetchData(Calendar.java) 	at com.bee.client.calendar.CalendarPane.<init>(CalendarPane.java:33) 	at com.bee.client.view.home.MainPanel.<init>(MainPanel.java:18) 	at com.bee.client.view.home.HomePanel.createMainPanel(HomePanel.java:27) 	at com.bee.client.view.home.HomePanel.<init>(HomePanel.java:16) 	at com.bee.client.application.BeeApplication.createHome(BeeApplication.java:79) 	at com.bee.client.application.BeeApplication.access$1(BeeApplication.java:78) 	at com.bee.client.application.BeeApplication$1.onEvent(BeeApplication.java:37) 	at com.bee.client.eventbus.EventBus.publish(EventBus.java:41) 	at com.bee.client.application.BeeSession$1.onEvent(BeeSession.java:41) 	at com.bee.client.eventbus.EventBus.publish(EventBus.java:41) 	at com.bee.client.view.login.LoginForm$4.onSuccess(LoginForm.java:99) 	at com.bee.client.view.login.LoginForm$4.onSuccess(LoginForm.java:1) 	at com.bee.client.fwk.communication.SmartCallback.execute(SmartCallback.java:26) 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 	at java.lang.reflect.Method.invoke(Method.java:597) 	at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103) 	at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) 	at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157) 	at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326) 	at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207) 	at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:126) 	at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561) 	at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269) 	at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91) 	at com.google.gwt.core.client.impl.Impl.apply(Impl.java) 	at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:214) 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 	at java.lang.reflect.Method.invoke(Method.java:597) 	at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103) 	at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) 	at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157) 	at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281) 	at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531) 	at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352) 	at java.lang.Thread.run(Thread.java:662)
    and in FF

    Code:
    
    00:39:21.233 [ERROR] 16:03:16.996:MUP3:WARN:Log:TypeError: _37 is undefined unnamed(undef) Calendar._showEventEditor(null) unnamed({Obj}, {Obj}, {Obj}) FormItem._fireStandardHandler("click") FormItem.handleClick() Class.invokeSuper(_1=>null, _2=>"handleClick") Class.Super(_1=>"handleClick", _2=>[object Arguments]) ButtonItem.handleClick() unnamed({Obj}, undef) StatefulCanvas.handleActivate({Obj}, undef) StatefulCanvas.handleClick({Obj}, undef) [c]EventHandler.bubbleEvent(_1=>{Obj}, _2=>"click") [c]EventHandler.handleClick(_1=>{Obj}) EventHandler._handleMouseUp([object MouseEvent], undef) [c]EventHandler.handleMouseUp(_1=>[object MouseEvent]) [c]EventHandler.dispatch(_1=>isc_c_EventHandler_handleMouseUp, _2=>[object MouseEvent]) anonymous([object MouseEvent]) unnamed() 
    com.smartgwt.client.core.JsObject$SGWT_WARN: 16:03:16.996:MUP3:WARN:Log:TypeError: _37 is undefined     unnamed(undef)     Calendar._showEventEditor(null)     unnamed({Obj}, {Obj}, {Obj})     FormItem._fireStandardHandler("click")     FormItem.handleClick()     Class.invokeSuper(_1=>null,  _2=>"handleClick")     Class.Super(_1=>"handleClick",  _2=>[object Arguments])     ButtonItem.handleClick()     unnamed({Obj}, undef)     StatefulCanvas.handleActivate({Obj}, undef)     StatefulCanvas.handleClick({Obj}, undef)     [c]EventHandler.bubbleEvent(_1=>{Obj},  _2=>"click")     [c]EventHandler.handleClick(_1=>{Obj})     EventHandler._handleMouseUp([object MouseEvent], undef)     [c]EventHandler.handleMouseUp(_1=>[object MouseEvent])     [c]EventHandler.dispatch(_1=>isc_c_EventHandler_handleMouseUp,  _2=>[object MouseEvent])     anonymous([object MouseEvent])     unnamed()  	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) 	at java.lang.reflect.Constructor.newInstance(Constructor.java:513) 	at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105) 	at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) 	at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157) 	at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281) 	at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531) 	at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352) 	at java.lang.Thread.run(Thread.java:662)

    Any help?
    Thanks in advance

    Fede
Working...
X