Hi I am creating a dialog with multifield which have 2 number fields . Those number fields are latitude and longitude so I want that only numbers with decimal can be entered into the field, but it is not allowing me to enter the decimal values. I have gone through the link which said to use @TypeHint but seems it is only used for saving the data in the particular format and not entering the data.
Can anyone please point if there is any OOTB number field which accepts decimal also? Any pointers will be highly appreciated.
My aem version is 6.4.
Thanks
Solved! Go to Solution.
Views
Replies
Total Likes
The above link deals with Classic UI data types - xtype.
For Granite types - I am checking with the touch ui team. [UPDATE]
Team replied:
Yes there is no mentioned but you can use decimals in it.
Also you can define step count in decimal
It step count is 0.2, it will update from 0.2 -> 0.4 -> 0.6…
Also - you can write you own AEM TOuch UI Resource type to achieve this functionality - something like:
To learn how to create your own resource type - see this article that creates a resource type that defines a color picker:
Adobe Experience Manager Help | Creating a custom Experience Manager sling:resourceType for Touch UI
If you need a data type not defined in the Granite API, then build your own using JQuery - as shown above. Hope this helps...
Views
Replies
Total Likes
Dear Rohit,
Please find following community answer[1]
[1] Decimal values in Numberfield?
Regards,
Peter
Views
Replies
Total Likes
The above link deals with Classic UI data types - xtype.
For Granite types - I am checking with the touch ui team. [UPDATE]
Team replied:
Yes there is no mentioned but you can use decimals in it.
Also you can define step count in decimal
It step count is 0.2, it will update from 0.2 -> 0.4 -> 0.6…
Also - you can write you own AEM TOuch UI Resource type to achieve this functionality - something like:
To learn how to create your own resource type - see this article that creates a resource type that defines a color picker:
Adobe Experience Manager Help | Creating a custom Experience Manager sling:resourceType for Touch UI
If you need a data type not defined in the Granite API, then build your own using JQuery - as shown above. Hope this helps...
Views
Replies
Total Likes
Hi, thank you for help. I used it in one component, it works but I have a problem at some values, which I do not understand.
If I try to enter 4,02 it shows me an validation error when I take 4,01 it is no problem.
<barValue
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/numberfield"
fieldLabel="GeneralBarValue"
name="./barValue"
value="1.1"
typeHint="Decimal"
step="0.001"
/>
Views
Replies
Total Likes