Migrating from SmartGWT 4.1 to SmartGWT 6.0
GWT 2.8.0-beta1
I have some code that sets a value on a ValuesManager that is a JsArray.
I used to be able cast the Object returned from ValuesManager.getValue in the following way
However after migrating to SmartGWT 6.0 I get a ClassCastException and in order to avoid this exception I am required to use the following code
Is this change by design? It is rather painful to have to convert from Object[] to JsArray and will have a large impact on our code. If even it would allow being cast as JavaScriptObject[] it would be simpler to handle this issue, but attempting to do so also causes a ClassCastException.
GWT 2.8.0-beta1
I have some code that sets a value on a ValuesManager that is a JsArray.
I used to be able cast the Object returned from ValuesManager.getValue in the following way
Code:
Object o = valuesManager.getValue(arrayName); if(o != null) JsArray array = ((JavaScriptObject) o).cast();
Code:
Object[] objects = (Object[]) valuesManager.getValue(arrayName); if(objects != null) { JsArray array = JavaScriptObject.createArray().cast(); for(Object object : objects) array.push((JavaScriptObject) object); }
Comment