Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

String[] type for Multivalued Properties - AEM

Avatar

Avatar
Validate 1
Level 2
MeenakshiP
Level 2

Likes

11 likes

Total Posts

35 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 2
MeenakshiP
Level 2

Likes

11 likes

Total Posts

35 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
MeenakshiP
Level 2

06-12-2016

[Thread Edited By Adobe]

/*Don’t forget to meet and greet your fellow peers virtually by telling them about yourself here

Go ahead and to it now: https://adobe.ly/3eDnB4v */

 

Actual Post:

Hi,

I have a question regarding multivalued property of type granite/ui/components/foundation/form/multifield in AEM.
My understanding is that it will always be stored in AEM with String[] Multi Array type for a given node's property, no matter if user provides 1 or greater than 1 property values.

But I have observed that some values are getting stored with Single String data type if I provide one value And stored as String[] multi value type in crxde, if I enter more than 1 values.

Why AEM does not store all values in unique way? i.e. By setting data type as; String[] multi value, if it's sling:resourceType is defined as multifield.

Is it a defect?

Thanks.

desktop_exl_promo_600x100_weempoweryou.png

Replies

Avatar

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,168 likes

Total Posts

6,294 posts

Correct Reply

1,144 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,168 likes

Total Posts

6,294 posts

Correct Reply

1,144 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile
kautuk_sahni
Community Manager

07-12-2016

Let me check this with internal team.

~kautuk

Avatar

Avatar
Establish
MVP
Nupur_Jain
MVP

Likes

165 likes

Total Posts

186 posts

Correct Reply

76 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 25
View profile

Avatar
Establish
MVP
Nupur_Jain
MVP

Likes

165 likes

Total Posts

186 posts

Correct Reply

76 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 25
View profile
Nupur_Jain
MVP

07-12-2016

I Don't know whether it is a defect or implementation but have observed the same.

Thanks,

Nupur

Avatar

Avatar
Validate 1
Level 2
MeenakshiP
Level 2

Likes

11 likes

Total Posts

35 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 2
MeenakshiP
Level 2

Likes

11 likes

Total Posts

35 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
MeenakshiP
Level 2

07-12-2016

Thanks. Please let me know. I can raise a ticket then.

Avatar

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,168 likes

Total Posts

6,294 posts

Correct Reply

1,144 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,168 likes

Total Posts

6,294 posts

Correct Reply

1,144 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile
kautuk_sahni
Community Manager

07-12-2016

I would request you to please share your observation with daycare till i get response from internal team.

~kautuk

Avatar

Avatar
Validate 1
Level 2
Veena_Vikraman
Level 2

Likes

5 likes

Total Posts

23 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
Veena_Vikraman
Level 2

Likes

5 likes

Total Posts

23 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Affirm 1
View profile
Veena_Vikraman
Level 2

08-12-2016

Hi Meenakshi

     For xtype like multifield, if you are saving only 1 value in property, it will get saved as String. This behavior is there from the beginning itself, (I have started from  5.4  )

Thanks

Veena

Avatar

Avatar
Validate 10
Level 6
leeasling
Level 6

Likes

73 likes

Total Posts

292 posts

Correct Reply

75 solutions
Top badges earned
Validate 10
Validate 1
Boost 50
Boost 5
Boost 3
View profile

Avatar
Validate 10
Level 6
leeasling
Level 6

Likes

73 likes

Total Posts

292 posts

Correct Reply

75 solutions
Top badges earned
Validate 10
Validate 1
Boost 50
Boost 5
Boost 3
View profile
leeasling
Level 6

08-12-2016

You need to set the typeHint in the dialog

typeHint="String"

This will save the value as a String[] regardless of 1 or multiple values.

Avatar

Avatar
Validate 1
Level 2
MeenakshiP
Level 2

Likes

11 likes

Total Posts

35 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 2
MeenakshiP
Level 2

Likes

11 likes

Total Posts

35 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
MeenakshiP
Level 2

08-12-2016

Thanks. Is there any property key to define directly at node level in crxde to set it as always String and overriding default current behavior?

I tried typeHint as property key but that did not work.

Avatar

Avatar
Validate 10
Level 6
leeasling
Level 6

Likes

73 likes

Total Posts

292 posts

Correct Reply

75 solutions
Top badges earned
Validate 10
Validate 1
Boost 50
Boost 5
Boost 3
View profile

Avatar
Validate 10
Level 6
leeasling
Level 6

Likes

73 likes

Total Posts

292 posts

Correct Reply

75 solutions
Top badges earned
Validate 10
Validate 1
Boost 50
Boost 5
Boost 3
View profile
leeasling
Level 6

08-12-2016

Delete the property that is currently just a "String" and then try again (this my answer was for classic UI).  For Touch UI, use this:

<myFieldString jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/foundation/form/hidden" name="./myField@TypeHint" value="String"/>

Avatar

Avatar
Validate 1
Level 2
MeenakshiP
Level 2

Likes

11 likes

Total Posts

35 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 2
MeenakshiP
Level 2

Likes

11 likes

Total Posts

35 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
MeenakshiP
Level 2

08-12-2016

I did not get you. I need to show this as one of the metadata for asset.

This is my current property configuration:

<keywords jcr:primaryType="nt:unstructured"
                                    sling:resourceType="granite/ui/components/foundation/form/multifield"
                                    fieldLabel="Keywords"
                                    metaType="mvtext"
                                    name="./jcr:content/metadata/dc:subject"
                                    renderReadOnly="true">
                                    <field
                                        jcr:primaryType="nt:unstructured"
                                        sling:resourceType="granite/ui/components/foundation/form/textfield"
                                        name="./jcr:content/metadata/dc:subject"/>
                                </keywords>