Announcement

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

    casting Issue in smartGWT 6.1

    Hi Team,
    We have updated smartGWT 6.1 from 4.1 and we are getting following exception when we are casting (using the com.google.gwt.core.client.JsArrayString) the object values by using the below code. The same code was working fine in 4.1.

    Object newValues = event.getValue();
    JsArrayString newValuesList = (JsArrayString) newValues;

    please help us to provide an solution for this.

    Exception :-
    -----------------


    Exception occured in browser :
    undefined
    Stacktrace :
    Unknown.java_lang_Throwable_fillInStackTrace__Ljava_lang_Throwable_2(heliosweb-0.js)
    Unknown.java_lang_Throwable_Throwable__V(heliosweb-0.js)
    Unknown.java_lang_Exception_Exception__V(heliosweb-0.js)
    Unknown.java_lang_RuntimeException_RuntimeException__V(heliosweb-0.js)
    Unknown.java_lang_ClassCastException_ClassCastException__V(heliosweb-0.js)
    Unknown.com_google_gwt_lang_Cast_dynamicCastJso__Ljava_lang_Object_2Ljava_lang_Object_2(heliosweb-0.js)
    Unknown.com_mars_helios_heliosweb_client_screen_SimpleValueSelectItemChangeHandler_onChange__Lcom_smartgwt_client_widgets_form_fields_events_ChangeEvent_2V(heliosweb-0.js)
    Unknown.com_smartgwt_client_widgets_form_fields_events_ChangeEvent_dispatch__Lcom_smartgwt_client_widgets_form_fields_events_ChangeHandler_2V(heliosweb-0.js)
    Unknown.com_smartgwt_client_widgets_form_fields_events_ChangeEvent_dispatch__Lcom_google_gwt_event_shared_EventHandler_2V(heliosweb-0.js)
    Unknown.com_google_gwt_event_shared_GwtEvent_dispatch__Ljava_lang_Object_2V(heliosweb-0.js)
    Unknown.com_google_web_bindery_event_shared_EventBus_dispatchEvent__Lcom_google_web_bindery_event_shared_Event_2Ljava_lang_Object_2V(heliosweb-0.js)
    Unknown.com_google_web_bindery_event_shared_SimpleEventBus_doFire__Lcom_google_web_bindery_event_shared_Event_2Ljava_lang_Object_2V(heliosweb-0.js)
    Unknown.com_google_web_bindery_event_shared_SimpleEventBus_fireEvent__Lcom_google_web_bindery_event_shared_Event_2V(heliosweb-0.js)
    Unknown.com_google_gwt_event_shared_HandlerManager_fireEvent__Lcom_google_gwt_event_shared_GwtEvent_2V(heliosweb-0.js)
    Unknown.com_smartgwt_client_core_DataClass_fireEvent__Lcom_google_gwt_event_shared_GwtEvent_2V(heliosweb-0.js)
    Unknown.anonymous(heliosweb-0.js)
    Unknown.com_google_gwt_core_client_impl_Impl_apply__Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2(heliosweb-0.js)
    Unknown.com_google_gwt_core_client_impl_Impl_entry0__Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2(heliosweb-0.js)
    Unknown.anonymous(heliosweb-0.js)
    Unknown.obj.change(heliosweb-0.js)
    Unknown.isc_FormItem_handleChange(http://localhost:8080/HeliosWeb/heli...s/ISC_Forms.js)
    Unknown.isc_FormItem_storeValue(http://localhost:8080/HeliosWeb/heli...s/ISC_Forms.js)
    Unknown.isc_FormItem__updateValue(http://localhost:8080/HeliosWeb/heli...s/ISC_Forms.js)
    Unknown.isc_FormItem_updateValue(http://localhost:8080/HeliosWeb/heli...s/ISC_Forms.js)
    Unknown.isc_c_Class_invokeSuper(http://localhost:8080/HeliosWeb/heli...es/ISC_Core.js)
    Unknown.isc_c_Class_Super(http://localhost:8080/HeliosWeb/heli...es/ISC_Core.js)
    Unknown.isc_NativeSelectItem_updateValue(http://localhost:8080/HeliosWeb/heli...s/ISC_Forms.js)
    Unknown.isc_FormItem_elementChanged(http://localhost:8080/HeliosWeb/heli...s/ISC_Forms.js)
    Unknown.isc_DynamicForm_bubbleItemHandler(http://localhost:8080/HeliosWeb/heli...s/ISC_Forms.js)
    Unknown.isc_DynamicForm_elementChanged(http://localhost:8080/HeliosWeb/heli...s/ISC_Forms.js)
    Unknown.isc_NativeSelectItem__handleElementChanged(http://localhost:8080/HeliosWeb/heli...s/ISC_Forms.js)
    Unknown.isc_c_FormItem__nativeChangeHandler(http://localhost:8080/HeliosWeb/heli...s/ISC_Forms.js)

    let me know in case of any questions.

    Thanks
    giri
    M:+91-9710407058.

    #2
    Sorry, but this information is nearly useless. It just shows a crash in your code sometime after your ChangeHandler is called, and we have none of your code. There's nothing here suggesting that a SmartGWT component has misbehaved.

    Please see the FAQ and the Debugging topic to better understand how to report issues.

    Comment


      #3
      Hi Here is the code. And getting an exception on highlighted line (Bold)

      @Override
      public void onChange(ChangeEvent event) {
      String val = null;

      //we retrieve the old and new values:
      Object newValues = event.getValue();
      Object oldValue = event.getOldValue();
      //if there is no new value
      //we select the previous(old) value by default :
      if (newValues == null || "null".equals(toStr(newValues))) {
      val = toStr(oldValue);
      } else {
      //if the new value is a simple string :
      if (newValues instanceof String) {
      val = (String) newValues;
      } else {
      //if here, there are multiple new values
      if (cancelUserActionIfCombo) {
      //if we don't allow multiple values, we rollback to the previous(old value):
      val = toStr(oldValue);
      } else {
      //otherwise we will browse all the new values :
      JsArrayString newValuesList = (JsArrayString) newValues;
      //the boolean topToBottom indicates if the user clicks on an item at
      //the top of the current item
      //or clicks on an item under the current item:
      boolean topToBottom;
      if (newValuesList.length() != 0 && newValuesList.get(0).equals(toStr(oldValue))) {
      topToBottom = true;
      } else {
      topToBottom = false;
      }

      //we can now browse all new values :
      for (int i = 0; i < newValuesList.length(); i++) {
      String newVal = newValuesList.get(i);
      if ("null".equals(toStr(oldValue)) || !newVal.equals(toStr(oldValue))) {
      val = newVal;
      if (!topToBottom) {
      break;
      }
      }
      }
      }
      }
      }
      ((SelectItem) event.getItem()).setValue(val);
      //we force redrawing:
      ((SelectItem) event.getItem()).redraw();
      onChange(event, toStr(oldValue), val);
      }

      public abstract void onChange(ChangeEvent event, String oldValue, String val);

      private String toStr(Object o) {
      System.out.println("toStrt value"+"" + o);
      return "" + o;
      }

      Comment


        #4
        This small snippet of code is useless as a bug report, for the same reasons as before.

        Please see the FAQ and the Debugging topic in order to understand how to submit issues that can actually be acted upon.

        Comment

        Working...
        X