Hi ,
We are using AEM6.3 both classic and touch ui dialog.
When using the below autocomplete for tags it storing in crxde as string instead of string[] when i just select one tag .Due to this when i open the same in classic dialog the tags don't come up as it expects String[].
Please could you provide inputs as how to fix it.
The component i am using is
<tag
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/autocomplete"
fieldLabel=" Asset Tags"
multiple="{Boolean}true"
name="./assetTags"
mode="contains">
<datasource
jcr:primaryType="nt:unstructured"
sling:resourceType="cq/gui/components/common/datasources/tags"/>
<options
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/autocomplete/list"/>
<values
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/autocomplete/tags"/>
</tag>
Classic UI:-
Touch UI:-
I am selecting just one tag it stores as assetTags String instead od String[]
Solved! Go to Solution.
Views
Replies
Total Likes
Hi srinivas channappa,
This works for me although I tested in AEM 6.4
Parallel to your tag node create another node called tag-hint with same name as the original node followed by "@TypeHint" as shown below:
<tag-hint
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/hidden"
value="String[]"
ignoreData="{Boolean}true"
name="./assetTags@TypeHint">
</tag-hint>
As mentioned in the documentation:
Parameters with the @TypeHint
suffix may be used to force storing the named parameter in a property with the given type. The value of the @TypeHint
parameter, if applied to a parameter for a property, is the JCR property type name. If the @TypeHint
parameter is applied to a field upload parameter, the value is used to indicate the JCR primary node type for the node into which the uploaded file is stored.
If the @TypeHint
value ends with []
, it indicates a multi-value property. A multi-value property is usually auto-detected if there are multiple values for the property (i.e. request parameter). But if only a single value is present in the request, the desired property type needs to be explicitly defined as multi-value by stating @TypeHint=<type>[]
.
For more info check this:
https://www.argildx.com/technology/how-to-change-data-type-typecast-in-aem-use-typehint
Views
Replies
Total Likes
Hi srinivas channappa,
This works for me although I tested in AEM 6.4
Parallel to your tag node create another node called tag-hint with same name as the original node followed by "@TypeHint" as shown below:
<tag-hint
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/hidden"
value="String[]"
ignoreData="{Boolean}true"
name="./assetTags@TypeHint">
</tag-hint>
As mentioned in the documentation:
Parameters with the @TypeHint
suffix may be used to force storing the named parameter in a property with the given type. The value of the @TypeHint
parameter, if applied to a parameter for a property, is the JCR property type name. If the @TypeHint
parameter is applied to a field upload parameter, the value is used to indicate the JCR primary node type for the node into which the uploaded file is stored.
If the @TypeHint
value ends with []
, it indicates a multi-value property. A multi-value property is usually auto-detected if there are multiple values for the property (i.e. request parameter). But if only a single value is present in the request, the desired property type needs to be explicitly defined as multi-value by stating @TypeHint=<type>[]
.
For more info check this:
https://www.argildx.com/technology/how-to-change-data-type-typecast-in-aem-use-typehint
Views
Replies
Total Likes
Thanks for helping me out on fixing this issue.
Views
Replies
Total Likes