Announcement

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

    Problem with Velocity statement

    I am trying to pass a parameter along with a filterData() operation. I have an operationsBinding with a whereClause. I am using the $criteria.parameter method. I keep getting exception in postgres about unknown operator $. This is because the $criteria.parameter is not being replaced with the value. I have put in a check to is if the parameter exists and that is a certain value. If I add a Criteria with the proper value, the whereClause is executed and the error occurs. If I add a Criteria with the wrong value, there is not an error. I guess the first question is am I passing parameters correctly to the server side using Criteria? Is there a better mechanism. Specifically, I have a ListGrid that needs an addition parameter passed to the query to limit it to a certain group of records. The parameter is selected in another part of the UI.

    The test binding is below...

    <operationBindings>
    <operationBinding operationType="fetch" serverMethod="fetch">
    <serverObject className="com.smartgwt.sample.server.dmi.TreeDMI"/>
    <tableClause>pro_id</tableClause>
    <whereClause>
    ($defaultWhereClause) #if ($criteria.root == '5') AND critieria.root = pro_id.id #end
    </whereClause>
    </operationBinding>
    </operationBindings>

    what I really need to do is

    <whereClause>
    ($defaultWhereClause) AND stored_procedure($criteria.currentRootId)
    </whereClause>

    Any suggestions?

    #2
    Look in the server-side log - the inbound criteria is shown, so you can see whether your value was successfully passed.

    Comment


      #3
      Originally posted by Isomorphic
      Look in the server-side log - the inbound criteria is shown, so you can see whether your value was successfully passed.
      The value never showed up. Switched to passing parameters using setDefaultParameters and reading the value in the velocity using $values.fieldname.

      Thank you.

      Comment

      Working...
      X