Announcement

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

    Modify DSRequest WHERE clause

    I am running SmartGWT 2.4 Pro edition.

    Is there a way to modify a DSRequest in an SQLDataSource to narrow search
    by criteria such as field_name>6. I see how to do it with field_name=6
    be using setFieldValue("field_name","6"), but cannot figure out how to change
    the operator.

    #2
    Take a look at the AdvancedCriteria docs - the AdvancedCriteria is converted to simple Java Collections when it reaches the server. You can construct the same collections server-side.

    Comment


      #3
      Originally posted by Isomorphic
      Take a look at the AdvancedCriteria docs - the AdvancedCriteria is converted to simple Java Collections when it reaches the server. You can construct the same collections server-side.
      Thank you. This is perfect. We are upgrading now.....

      Comment


        #4
        Originally posted by aarontsmith
        Thank you. This is perfect. We are upgrading now.....
        Ok. We have the Power version now. However, I cannot find examples of how to do what I want to do. In addition, which AdvancedCriteria does one use? The one in com.isomorphic.criteria.AdvancedCriteria or the one in com.smartgwt.client.data. I would say the one in the ismorphic package since this is a server side datasource.

        The client side has a nice programmatic way of building the query, however, the server side seems to just take a string. Is this the JSON string?

        Comment


          #5
          Don't use either of those packages - the Advanced Criteria is represented as Java Collections and to create your own AdvancedCriteria or modify the criteria, you should use these same Java Collections. See the docs for AdvancedCriteria for how JavaScript objects are translated to Java Collections. You can see the JavaScript Object / JSON representation of AdvancedCriteria in both the RPC tab and in the server-side log as the request is received.

          Comment

          Working...
          X