Announcement

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

    How to trigger change event for a DateItem

    Hi all,

    I've found out that the "change" event is triggered for a DateItem when it loses focus.

    Can you please tell if there is some other mechanismto trigger the "change" event?
    I'm personally looking for the way to trigger the "change" event when user presses "Enter" and the DateItem is focused.

    Thanks in advance

    Regards,
    Iurii

    #2
    I was able to find the solution. If you need to "manually" trigger the "change" event (and update of the DateItem "value") you'll have to call the "updateValue()" method of the underlying DateItem SmartClient object.

    You can use the following method to perform this call:
    Code:
        private native void updateDateItemValue(DateItem dateItem) /*-{
            var item = dateItem.@com.smartgwt.client.core.DataClass::getJsObj()();
            if (item.updateValue) {
                item.updateValue();
            }
        }-*/;
    Regards,
    Iurii

    Comment

    Working...
    X