xtype=tags name value type saving different in classic (String[])& touch UI (String) | Community
Skip to main content
December 19, 2018
Solved

xtype=tags name value type saving different in classic (String[])& touch UI (String)

  • December 19, 2018
  • 2 replies
  • 1281 views

Hi All,

We have field in page property dialog with xtype=tags. We have build the dialog for both classic & touch ui. This field will allow only one tag to be selected. When we select the tag in classic UI dialog and save, the type is getting saved as String[] for field value (as shown in below screen shot). When we edit the same field through touch ui, then the value is getting saved as String Type (second screen shot). The issue is when the value type is String post saving the values through touch UI, then when we open the dialog in classic UI, the field value is blank and value is not persisting even if we reconfigure the tags as the field type is String. Any suggestion or guidance to resolve in-case if we missed any property to be added would be really appreciated.

Classic UI

Touch UI

Dialog in Classic UI

<articleprimarytag

                    jcr:primaryType="cq:Widget"

                    allowBlank="{Boolean}false"

                    fieldLabel="articleprimarytag"

                    name="./articleprimarytag"

                    namespaces="ABC"

                    xtype="tags">

                    <listeners

                        jcr:primaryType="nt:unstructured"

                        addTag="function(tag,boolean){ var tagName = this.tags[0].tag.name; if(this.tags.length > 1){ this.removeTag(this.tags[this.tags.length-1].tag.tagID); alert(CQ.I18n.getMessage(&quot;tagErrorMessage&quot;)); } }"/>

                </articleprimarytag>

   

Dialog in Touch UI

                  <articleprimarytag

                                                jcr:primaryType="nt:unstructured"

                                                sling:resourceType="cq/gui/components/coral/common/form/tagfield"

                                                fieldLabel="articleprimarytag"

                                                name="./articleprimarytag"

                                                required="{Boolean}true"

                                                rootPath="/etc/tags/abc"/>

           

Regards,

Satish

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by GaneshM

Hi Satis,

The TypeHint might be going as String[], please set the typeHint as string.

Please add below snippet in dialog and try.

<articleprimarytagTypeHint
   jcr:primaryType="cq:Widget"
   name="./articleprimarytag@TypeHint"
   value="String"
   xtype="hidden"/>

its worked for me, hope this works for you too.

Thanks!

2 replies

smacdonald2008
Level 10
December 19, 2018

I recommend putting this into a package and then put into a Google Drive so community members can download and see what is going on. This will help solve this issue.

GaneshM
GaneshMAccepted solution
Level 3
December 19, 2018

Hi Satis,

The TypeHint might be going as String[], please set the typeHint as string.

Please add below snippet in dialog and try.

<articleprimarytagTypeHint
   jcr:primaryType="cq:Widget"
   name="./articleprimarytag@TypeHint"
   value="String"
   xtype="hidden"/>

its worked for me, hope this works for you too.

Thanks!