Announcement

Collapse
No announcement yet.
X
  • 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)

    code:

    Code:
     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.

    #2
    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
    Code:
    crit.addCriteria(new Criterion("flag", OperatorId.IN_SET, trafficLight.getSelection())
    Best regards
    Blama

    Comment


      #3
      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
      Blama

      Comment


        #4
        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.

        Comment


          #5
          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.

          Thanks,
          Isomorphic Software

          Comment

          Working...
          X