Hello,
I am using Isomorphic SmartClient/SmartGWT Framework (SNAPSHOT_v9.1d_2014-01-14/Pro Deployment 2014-01-14).
I want to find a record in an array of ListGrids.
I prepared an AdvancedCriterion:
While the method findIndex is executed, the execution of find throws a class cast exception:
Where's my mistake?
Andreas
I am using Isomorphic SmartClient/SmartGWT Framework (SNAPSHOT_v9.1d_2014-01-14/Pro Deployment 2014-01-14).
I want to find a record in an array of ListGrids.
I prepared an AdvancedCriterion:
Code:
final PickerIcon searchPicker = new PickerIcon (PickerIcon.SEARCH, new FormItemClickHandler () {
public void onFormItemClick (final FormItemIconClickEvent event) {
final String s = event.getItem ().getValue ().toString ();
final Criterion searchExaminer = new Criterion ("prueferNamen", OperatorId.STARTS_WITH, s);
final Criterion searchExam = new Criterion ("titel", OperatorId.CONTAINS, s);
final AdvancedCriteria examSearchCrit = new AdvancedCriteria (OperatorId.OR, new Criterion[] { searchExaminer, searchExam });
for (final ListGrid l : examLists) {
int idx = l.findIndex (examSearchCrit);
Record r = l.find (examSearchCrit);
...Code:
Caused by: java.lang.ClassCastException: Cannot cast com.smartgwt.client.data.AdvancedCriteria to com.google.gwt.core.client.JavaScriptObject
at java.lang.Class.cast(Unknown Source)
at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:163)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:65)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:338)
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:219)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:279)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at com.smartgwt.client.widgets.grid.ListGrid.find(ListGrid.java)Andreas