Highlighted

AEM6.3 coral touch ui for multifield with delimiter

Avatar

Avatar

srinivas_chann1

Avatar

srinivas_chann1

srinivas_chann1

07-08-2019

Hi ,

We use both classic UI and touch ui. In the classic UI we have multifiled which has data stored as   string[]   with values as  contentpath^textvalue  where ^ is delimiter.

Please let me know how could i achieve the same in touch ui using multifield.

Below is the snapshot for the field stored as string[] in crxde for classic UI .

1809107_pastedImage_1.png

The multifield i am trying is below which is not working

<staticconfig

          jcr:primaryType="nt:unstructured"

          sling:resourceType="granite/ui/components/coral/foundation/form/multifield"

          composite="{Boolean}true"

          fieldDescription="Configure Links Manually"

          fieldLabel="Manual Configuration">

           <field

            jcr:primaryType="nt:unstructured"

            sling:resourceType="granite/ui/components/coral/foundation/container"

            name="navItems">

             <items jcr:primaryType="nt:unstructured">

             <column

              jcr:primaryType="nt:unstructured"

              sling:resourceType="granite/ui/components/coral/foundation/container">

              <items jcr:primaryType="nt:unstructured">

              <path

               jcr:primaryType="nt:unstructured"

               sling:resourceType="granite/ui/components/coral/foundation/form/pathfield"

               fieldLabel="Path"

               name="navpath"/>

              <label

               jcr:primaryType="nt:unstructured"

               sling:resourceType="granite/ui/components/coral/foundation/form/textfield"

               fieldDescription="Label of Link"

               fieldLabel="Label"

               maxlength="50"

               name="textvalue"/>

              </items>

             </column>

            </items>

           </field>

         </staticconfig>

Thanks

Replies

Highlighted

Avatar

Avatar

srinivas_chann1

Avatar

srinivas_chann1

srinivas_chann1

07-08-2019

An inputs on this

Highlighted

Avatar

Avatar

Arun_Patidar

MVP

Total Posts

2.9K

Likes

999

Correct Answer

829

Avatar

Arun_Patidar

MVP

Total Posts

2.9K

Likes

999

Correct Answer

829
Arun_Patidar
MVP

08-08-2019

what issue your facing with touch ui multifield?

Highlighted

Avatar

Avatar

srinivas_chann1

Avatar

srinivas_chann1

srinivas_chann1

08-08-2019

Hi,

As the property is getting stored as string[] by classic ui  with delimiter ^ ,due to this the code above i mentioned is not populating up the mutifield value in touch ui.

Any inputs as how i could solve.

Thanks

Highlighted

Avatar

Avatar

Arun_Patidar

MVP

Total Posts

2.9K

Likes

999

Correct Answer

829

Avatar

Arun_Patidar

MVP

Total Posts

2.9K

Likes

999

Correct Answer

829
Arun_Patidar
MVP

08-08-2019

In touch UI, Coral3, multifield data store as node, in your case it would be like navItems0, navItems1

You can easily get path and title in sling model and return as list.

Highlighted

Avatar

Avatar

srinivas_chann1

Avatar

srinivas_chann1

srinivas_chann1

08-08-2019

Hi,

It is not stored as node is stored as property navItems  of String[]  .But would want to show it up in multi-field in touch ui .hence all this issue.

Did you mean that still we can make it work using sling model. Any samples will help.

Thanks

Highlighted

Avatar

Avatar

Arun_Patidar

MVP

Total Posts

2.9K

Likes

999

Correct Answer

829

Avatar

Arun_Patidar

MVP

Total Posts

2.9K

Likes

999

Correct Answer

829
Arun_Patidar
MVP

08-08-2019

Hi,

I got it now, you are trying to poluate touch UI dialog from classic UI authored value.

This would be tricky, you have two options

1. Create a utility which would read the String[] property and create the nodes for touch ui multifield

2. When you open the touch ui dialog, get the value via ajax call and populate the multifield values in dailog.

I don't have any sample code though but 1st but would be easy, just authored one multifield again in touch UI and see how touch UI stores the value and converted same using utility

Highlighted

Avatar

Avatar

srinivas_chann1

Avatar

srinivas_chann1

srinivas_chann1

08-08-2019

Hi,

Thanks for the inputs .Any reference will help as currently i don't have much idea on Point1.

Point2 also using ajax we will have many multifields values in one dialog so cannot use id for populating it  and looks to me like  an issue.

Highlighted

Avatar

Avatar

srinivas_chann1

Avatar

srinivas_chann1

srinivas_chann1

11-08-2019

Hi,

Any inputs based on last query will be helpful.

Highlighted

Avatar

Avatar

Arun_Patidar

MVP

Total Posts

2.9K

Likes

999

Correct Answer

829

Avatar

Arun_Patidar

MVP

Total Posts

2.9K

Likes

999

Correct Answer

829
Arun_Patidar
MVP

12-08-2019

Hi Sri,

The first approach is very straight forward.

1. Create a servlet which run SQL2 query to look for the multifield resource node where data is stored in String[] type property.

2. If found, read the value of String[] type and convert into nodes and add node to above multifield resource node .

I don't know the dialog structure so couldn't exact point the steps but above is generic solution