Announcement

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

    Working with Boolean Smartclient 12

    Hello,

    I am having some issue using Boolean with Smartclient,

    This is how I am declaring my rest data source,

    Code:
                isc.RestDataSource.create({
                    ID: "default__PaymentType",
                    fields: [
                        { name: "PaymentTypeKey", type: "integer", primaryKey: true, canEdit: false },
                        { name: "Name", type: "text" },
                        { name: "Description", type: "text" },
    [B]                   { name: "Active", type: "boolean" }[/B]
                    ],
                    disableQueuing: true,
                    operationBindings: [{ operationType: "fetch", dataProtocol: "postXML" }],
                    fetchDataURL: "services/test.php"
                });

    In the database I am holding the data as a tinyint(4), so 0 equal false and 1 equals true,
    I am always getting this warning and I would like to get rid of it,

    Click image for larger version

Name:	2019-01-14_11-12-04.png
Views:	55
Size:	7.2 KB
ID:	256500

    I also tried to transform response with the following code but I still get the warning,
    Code:
                    transformResponse: function(dsResponse, dsRequest, data) {
                        debugger;
                        for (var i = 0; i < dsResponse.data.length; i++) {
                            if (dsResponse.data[i].Active == 1) {
                                dsResponse.data[i].Active = true;
                            }
                            else{
                                dsResponse.data[i].Active = false;
                            }
                        }
                        this.Super("transformResponse", arguments);
                    },
    I am still getting the warning what ever browser I am using,

    V. smartclient: SmartClient_v120p_2018-12-02_LGPL
    V. MySQL: 8.0.13
    Attached Files

    #2
    When you declare the field as a boolean and then you don't deliver boolean values, that's a protocol error, and there isn't a way to get rid of the warning.

    The best solution would be to have your server deliver boolean values as expected.

    Comment


      #3
      Thanks for the response I changed my back end to send the data like expected.

      Comment

      Working...
      X