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

    Criteria.addCriteria with Integer array not working?

    smartgwt pro 5.0 October 6 build

    Basically what the title says. I'm rewriting some code to send criteria manually to server where i previously used setdefaultparams on the DataSource. All criteria that are "single" objects work and are passed to the server, but i also have an integer array i'm sending. I call the method, no exception is thrown or anything, but the value is simply not included when sent to the server (i'm debugging with Firebug)


     List<Integer> selection = trafficLight.getSelection();
    if(selection != null){
        crit.addCriteria("flag" selection);
    Above and below this snippet i have other parameters added to the criteria. As i said, they are all included fine.

    Shouldn't this work? The Javadoc doesn't say anything restricting the use of the method.

    Hi mathias,

    you apply the criteria on the clientside, correct? If not, did you see the server's SetCriterion?
    If so, what is crit? Should be AdvancedCriteria. Then use this Criterion constructor with OperatorId.IN_SET as 2nd parameter.
    Add the criterion via
    crit.addCriteria(new Criterion("flag", OperatorId.IN_SET, trafficLight.getSelection())
    Best regards


      Ah, I see, you are using this Criteria.addCriteria() override. I think it should work, too. Might be a bug.
      But if you have SmartGWT Pro, I'd always use AdvancedCriteria and Criterion with explicit OperatorId, as you have more explicit control then about what happens IMHO. This especially applies to case-sensitivity.

      Best regards


        Hey Blama, thanks for responding. Yes i'm applying clientside. Yes, i'm using the Criteria.addcriteria, which should work. I also think it's a bug, which is why i'm hoping for someone at Iso will reply.


          Hello mathias,

          There is not a whole lot of information to go on here, so could you please verify a couple of things for us.

          1. Does it work with non array values?
          2. Does it work with other arrays, such as a string array or float array?

          Is there any way you could provide a small isolated test case for us in order to reproduce the issue?

          Oh and I assume you've manually typed out that code statement in the original post as the method call is missing a comma. Just checking to be sure.

          Isomorphic Software