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

5.0p problem w/ field of type="boolean" sqlStorageStrategy="singleCharYN" w/ length=1

$
0
0
Hello Isomorphic,

after switching to 5.0p (v10.0p_2015-03-25) from 4.1p, I got problems with my boolean fields. As Oracle does not have a boolean datatype in SQL, it needs to be mapped. I chose sqlStorageStrategy="singleCharYN" from the options you offer.
But the value your widgets send is interpreted as String and therefore disregarded by the built-in validation (errorMessage:"Must be no more than 1 characters long").

Please see this builtInDS-based sample:
supplyItem.ds.xml:
Code:

<field name="SKU" length="1" type="boolean" sqlStorageStrategy="singleCharYN" title="SKU" required="true"/>
supplyItemLarge.data.xml & supplyItem.data.xml:
RegEx-Search:<SKU>.*</SKU>
RegEx-Replace:<SKU>N</SKU>

Then start the sample and select the 1st supplyItem. Change the "SKU"-checkbox and click safe. Result is:

DSRequest-tab of Developer Console:
Code:

{
    dataSource:"supplyItem",
    operationType:"update",
    componentId:"isc_DynamicForm_0",
    data:{
        nextShipment:"2015-03-31",
        category:"Adding Machine/calculator Roll",
        itemName:"Adding Machine Roll 57x57mm Standard",
        itemID:1,
        unitCost:0.41,
        SKU:false,
        inStock:true,
        units:"Roll",
        description:null
    },
    textMatchStyle:"exact",
    callback:{
        target:[DynamicForm ID:isc_DynamicForm_0],
        methodName:"saveEditorReply"
    },
    showPrompt:true,
    prompt:"Saving form...",
    oldValues:{
        nextShipment:"2015-03-31",
        category:"Adding Machine/calculator Roll",
        itemName:"Adding Machine Roll 57x57mm Standard",
        itemID:1,
        unitCost:0.41,
        SKU:true,
        inStock:true,
        units:"Roll"
    },
    requestId:"supplyItem$6271",
    internalClientContext:{
    },
    fallbackToEval:false,
    afterFlowCallback:"isc_DynamicForm_0.$49z(dsRequest, dsResponse, data)",
    editor:[DynamicForm ID:isc_DynamicForm_0],
    lastClientEventThreadCode:"MUP1",
    bypassCache:true
}

Raw Response-Tab of Developer Console:
Code:

{
    affectedRows:0,
    errors:[
        {
            SKU:{
                errorMessage:"Must be no more than 1 characters long"
            }

        }
    ],
    invalidateCache:false,
    isDSResponse:true,
    operationType:"update",
    queueStatus:-1,
    status:-4,
    data:null
}

This error message goes away if I remove the length="1" from the field definition.
But this used to work in 4.1p and feels right the way it was. Is this a bug?

Best regards,
Blama

Viewing all articles
Browse latest Browse all 4756

Trending Articles