Announcement

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

    manual creation of AdvancedCriteria

    Hi,

    I want to create a AdvancedCriteria object manually. If I use following code the execution fails:

    Code:
    import com.smartgwt.client.data.AdvancedCriteria;
    import com.smartgwt.client.data.Criteria;
    import com.smartgwt.client.data.Criterion;
    import com.smartgwt.client.types.OperatorId;
    
    AdvancedCriteria root = new AdvancedCriteria(OperatorId.AND);
    root.addCriteria(new Criterion("someId", OperatorId.EQUALS, "someValue"));
    with stack trace being:
    Code:
    com.smartgwt.client.core.JsObject$SGWT_WARN: 14:54:02.462:MUP5:WARN:Log:appendToCriterionList called when no criterion list exists
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)
        at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
        at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:167)
        at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326)
        at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207)
        at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:132)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:289)
        at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
        at com.smartgwt.client.util.SC.logWarn(SC.java)
        at com.smartgwt.client.data.Criterion.appendToCriterionList(Criterion.java:308)
        at com.smartgwt.client.data.Criterion.addCriteria(Criterion.java:219)
    To bypass this exception I have to use:
    Code:
    root = new AdvancedCriteria();
    root.buildCriterionFromList(OperatorId.AND, new Criterion[] {});
    After this I can safely use addCriterion() method.

    Is this expected behavior?

    I am using SmartGWT 2.4.

    Thanks
Working...
X