Announcement

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

    Setting Filter Operators in ds.xml file

    Hello,

    I am wondering is there is a way to set the operators inside the <field></field> section of the ds.xml file when defining the fields?

    Something like
    Code:
    <field name="field_name" type="integer" operators="EQUALS,IN_SET,NOT_IN_SET..."/>

    #2
    You may looking for DataSourceField.validOperators?

    Comment


      #3
      yes, I currently use DataSourceField.setValidOperators(), but I am wondering if there is a simpler way, like setting it while defining the field name in the ds.xml. I just don't like having to set all the operators in the DS after. Might be a nice enhancement if not.

      Thanks

      Comment


        #4
        validOperators is something you can set in the .ds.xml file. You will not it is documented as such (in the ".serverds" package that describes .ds.xml properties).

        https://smartclient.com/smartgwtee-r...validOperators

        Comment


          #5
          Cool, so something like this should be valid?

          Code:
          <field name="mark" type="text" length="100" required="true" defaultOperator="contains" validOperators="contains,notContains,equals,notEqual,startsWith">
          UPDATE: This does not work. Please provide an example of the correct usage.
          Last edited by zhene; 26 May 2022, 11:09. Reason: Usage failed

          Comment


            #6
            No, the package summary explains how array-type fields appear in XML:

            https://smartclient.com/smartgwtee-r...e-summary.html

            So:

            Code:
            <field ... >
                <validOperators>
                    <value>contains</value>
                    .. other values ...
                </validOperators>
            </field>

            Comment


              #7
              Thank you so much!

              Comment


                #8
                After applying the validOperators, I get this error:

                Example Field:
                Click image for larger version

Name:	Data Source Field with Operators.png
Views:	216
Size:	44.5 KB
ID:	268082

                Error:
                Click image for larger version

Name:	Console Error Log.png
Views:	209
Size:	128.6 KB
ID:	268083

                None of the operators are displayed, just a basic right click option menu.

                Comment


                  #9
                  We've made a change to solve this issue. The fix will be available in the nightly builds as of tomorrow May 28th.

                  Regards
                  Isomorphic Software

                  Comment


                    #10
                    Hi blingslingkling123,

                    that would be SimpleType, but I don't know if it supports <validOperators>.
                    Isomorphic: It would be great to have a list of what attributes and tags SimpleType supports in .ds.xml.
                    Is it the "Instance API" docs from the link, so <validOperators> would work?

                    Best regards
                    Blama

                    Comment


                      #11
                      Hi Isomorphic,

                      I just realized these .ds.xml docs already exist. But they list much less properties than the SmartClient clientside docs from #11. Is this correct?

                      Best regards
                      Blama

                      Comment


                        #12
                        We don't see the 28th build. Is it published yet? Isomorphic
                        Last edited by zhene; 31 May 2022, 06:08.

                        Comment


                          #13
                          Blama the part of the reference you're looking at shows properties that can be set in XML only. Other properties are on the SimpleType class in the client.data package here. In the SmartClient reference, they are instead combined, since you can set JavaScript functions inside the XML (can't do that with Java / GWT).

                          zhene there were regressions caught by our automated testing system that caused the build to not be published. They've been corrected and new builds will be up soon.

                          Comment


                            #14
                            Hi Isomorphic,

                            I think I understand the blocking issue here, at least for methods like SimpleType.editFormatter.

                            But does this also apply to the "green properties" in the SimpleType instance APIs?
                            The way I understand it, from a technical perspective valueMap (possible in .ds.xml for both DataSourceField and SimpleType) should be similar to validOperators, which is only possible in .ds.xml DataSourceField.
                            Shouldn't it then also be possible to set much more properties of .ds.xml DataSourceField also in .ds.xml SimpleType - at least all the "green properties" mentioned in the SmartClient SimpleType instance APIs that are supported clientside in the framework anyway?

                            Best regards
                            Blama

                            Comment


                              #15
                              Thanks for point that out - yes all the "green properties" (non-method properties) are actually settable in a SimpleType .type.xml file. The docs now reflect this.

                              EDIT: just a further note: those properties already worked, it's just the documentation that has been updated to reflect pre-existing support.

                              Comment

                              Working...
                              X