Announcement

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

    Bug in Calendar.addEvent (2.0)

    Code:
        public native void addEvent(Date startDate, Date endDate, String name, String description, Map otherFields) /*-{
            var self = this.@com.smartgwt.client.widgets.BaseWidget::getOrCreateJsObj()();
            var otherFieldsJS = @com.smartgwt.client.util.JSOHelper::convertMapToJavascriptObject(Ljava/util/Map;)(otherFields);
            self.addEvent(@com.smartgwt.client.util.JSOHelper::convertToJavaScriptDate(Ljava/util/Date;)(startDate),
                          @com.smartgwt.client.util.JSOHelper::convertToJavaScriptDate(Ljava/util/Date;)(endDate),
                          name, description,
                          @com.smartgwt.client.util.JSOHelper::convertMapToJavascriptObject(Ljava/util/Map;)(otherFieldsJS));
        }-*/;
    This method from Calendar.java calls convertMapToJavascriptObject twice, obviously causing an exception on the second call, because a JS object is passed in place of a java.util.Map.

    It's nice to see that the date manipulation was fixed - before the calendar creashed because the GWT Date was passed instead of JS date from app iframe.

    #2
    Fixed in SVN, thanks.

    Comment


      #3
      A ClassCastException still occurs when using addEvent(Date startDate, Date endDate, String name, String description, Map otherFields) with SmartGWT-2.2. Javascript code is the same as posted by jakub.bochenski. Was it really updated in SVN ?

      Comment


        #4
        You're right, the fix did not make SVN previously. I've checked in the fix.

        Thanks,
        Sanjiv

        Comment


          #5
          I am using smartgwt calendar and i simply dont get how to construct my otherfields map. Can you show me map that for example is used to add value: "Asen" to TextItem with name: "author".

          Thanks :)

          Comment

          Working...
          X