Using Decimals in ZoomFlex Properties
This article covers how to use decimals in ZoomFlex properties which currently requires a few quick changes to the number control to work correclty.
When you create a property of Type "number" it creates the database field as an "int" which does not allow the use of decimals and will round numbers rather than apply decimal points. To get decimals enabled do the following:
1. In the database (mysql by default on the hosted service) make the decial filed of the property "2" as per the quantity field in the image below and then change the type to be "decimal" rather than "int".

.
2. Next open the [sitename]/app_templates/objects/[package]/[classname].xml file and change the property type from "Number" to "String" for the property you wish to use as a decmial. Also change the Class node of the property to be "shadomx.core.objects.properties.string".
3. Now change the property type in the Class VO in Flex Builder : com.[package].model.vo.[class]VO.as
From: public var quantity :String = "";
To: public var quantity :Number = 0;
Obivoulsy switching out "quantity" for your own property name.
4. Finally in the EditForm.mxml for the Class, cast the form value to a Number in the handleSaveClick() function
item.quantity = Number(quantityForm.text);
Comments
There are no comments for this page as yet.
print page
