Announcement

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

    Handling boolean type variables in ds.xml

    Hi ,

    I am trying to use ds.xml to populate fields into the grid, and trying to set boolean values for few fields.
    In the query fetched it comes as Y/1 or N/0, but even using valuemap to set true /false does not make them appear checked/unchecked
    Please find the code sample tried till now:

    <field name="test" " width="100">
    <valueMap>
    <value id="Y">true</value>
    <value id="N">false</value>
    </valueMap>
    <editorType>Checkbox</editorType>
    </field>

    or tied this

    <field name="test" " type="boolean" width="100">
    <valueMap>
    <value id="Y">true</value>
    <value id="N">false</value>
    </valueMap>
    </field>

    Also if there is a probability of two values being set in this field (say y/1), how can we use the same in value map , do we need to mention two value maps?


    #2
    See the docs.serverds.datasourcefield Package again.
    You are looking type=boolean, customSelectExpresssion for normalizing 1/y and 0/n, customUpdateExpression for changes, and for sqlStorageStrategy for the type you are normalizing to.
    After that, it just works in the GUI because of the type attribute.
    The whole serverds package as well as the Quick Start Guide are a good and recommended read.

    Best regards
    Blama

    Comment


      #3
      Thanks Blama , it worked that way with customSelectExpression and boolean data type .

      Comment

      Working...
      X