Wednesday, 6 February 2013

How to make tag input field accept a single value in CQ5.4



Is there any way to make a Tag input field  (aka a widget with xtype="tags") to accept a single value?



In usual case we can do this manually (e.g. on 'add' event); To achieve this through a property we can follow below methods.


{

"xtype":"tags",

"fieldLabel":"Select one tag",

"name":"./categorytag",

"allowBlank":"false",

"jcr:primaryType":"cq:Widget",



"namespaces":{

"jcr:primaryType":"cq:WidgetCollection",

"categorynm":{"name":"nameofcategory",

"maximum":"1",

"jcr:primaryType":"nt:unstructured"

  }

   }

}

No comments:

Post a comment