Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

ResultTree returned wrong value for isFolder?

$
0
0
Hi,

I have been following the instruction on

http://www.smartclient.com/smartgwt/javadoc/com/smartgwt/client/widgets/tree/ResultTree.html

I have a DataSource for such a result tree for which I have defined a field called "isFolder". The ds.xml looks like this

Code:

    ...
    <fields>
        ...
        <field name="isFolder" type="boolean"    title="Is Folder" required="true"  />
    </fields>
    <operationBindings>
        <operationBinding  operationType="fetch"  >
            <selectClause>
                ...
                , if(treeNodeType='FOLDER', true, false) as isFolder
                ...

I checked with my DB (MySQL) and confirmed that the select clause would return correct values (true or false, depending on the record) for the "isFolder" column/field.

However, when I put the above into SmartGWT, and I used SmartGWT Dev Console to look at the RawResponse to the DSRequest. I noticed that value of "isFolder" was false for every record, even when it should have been "true" (according to the DB value).

Code:

{
    affectedRows:0,
    data:[
        {
            ...
            isFolder:false,
            ...
        },
        {
            ...
            isFolder:false,
            ...
        },
        ...
    endRow:14,
    invalidateCache:false,
    isDSResponse:true,
    operationType:"fetch",
    queueStatus:0,
    startRow:0,
    status:0,
    totalRows:14
}

As a test, I then changed my select clause and hard coded the value to be true for every record

Code:

    ...
    <fields>
        ...
        <field name="isFolder" type="boolean"    title="Is Folder" required="true"  />
    </fields>
    <operationBindings>
        <operationBinding  operationType="fetch"  >
            <selectClause>
                ...
                , true as isFolder
                -- , if(treeNodeType='FOLDER', true, false) as isFolder

                ...

But still I saw that in RawResponse, all the value for isFolder was returned as false. It looks to me somehow the server side SmartGWT hard-coded the value for isFolder and ignore what the DB told it. Could this be a bug on the server side?

SmartClient Version: v10.0p_2015-06-28/PowerEdition Deployment (built 2015-06-28)

I was using Firefox (26.0)

There were no error/warning messages from the server log. But here is the version string

=== 2015-08-31 16:29:48,872 [main] INFO ISCInit - Isomorphic SmartClient/SmartGWT Framework (v10.0p_2015-06-28/PowerEdition Deployment 2015-06-28) - Initialization Complete

Viewing all articles
Browse latest Browse all 4756

Trending Articles