Announcement

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

    DynamicForm.getValuesAsCriteria() doesn't use data values

    v8.3p_2012-12-04/PowerEdition Deployment (built 2012-12-04)

    I have CanvasItem with different display and data values inside.

    Seems like DynamicForm.getValuesAsCriteria() doesn't use data values, it uses display values.

    Code:
    form.getField("roles").getValue() = {com.google.gwt.core.client.JavaScriptObject$@19042}"[object Object],[object Object],[object Object]"
    Code:
    form.getValuesAsCriteria().getValues().toString() = {java.lang.String@19045}"{operator=and, _constructor=AdvancedCriteria, criteria=[{operator=and, _constructor=AdvancedCriteria, criteria=[{fieldName=isc_TextItem_0, operator=iContains, value=[b]3 records chosen[/b]}]}]}"

    #2
    There isn't really a behavior that's clearly going to be correct when the value of the FormItem is an Object or some other non-atomic value, so we just use the display value. You can override getCriterion() to do something else.

    Comment


      #3
      I agree that sometimes it's difficult or impossible to get the correct value from an object, but i think DynamicForm.getValuesAsCriteria() behaved differently a couple of builds ago. It was returning correct array like roles:[{id:111},{id:303}] as for example ValuesManager.saveData() saves now.

      Anyway, getCriterion declared as final in formItem and can't be overridden.
      Last edited by vostapenko; 9 Dec 2012, 19:34.

      Comment


        #4
        You should be able to customize the criterion returned by a FormItem via the setCriterionGetter() API.

        Comment

        Working...
        X