How to save xtype value as String Array CQ5 / AEM

I have a dialog with a set of specific types. One of the xtype is a "select" with a type of "select". Now each parameter has a value type of "String []", but when I add a component to the page and view the selected option.

It is stored as "String", not "String []".

Can someone tell me how to make / force xtype to store their values ​​in "String []" and not "String".

Thank you Sri

+4
source share
3 answers

You can use one of the Sling options to control the creation of content using SlingPostServlet. Details: here

, @TypeHint . xtype , . cities :

<citiesTypeHint
    jcr:primaryType="cq:Widget"
    name="cities@TypeHint"
    value="String[]"
    xtype="hidden"
+2

xtype dialog.xml, :

property=value

property String value.

, [], :

property="[value1,value2,value3,...]"

property String[] value. , coma.

dataType, :

property="{dataType}value"

property dataType value. dataType , Boolean, Date, Long, etc

crx/de, add multi .

, ...:)

0

The Mateusz Chromiński variant almost worked for me, except that it value="String[]"leads to the emprty property, so I used defaultValue="String[]"it and it worked just fine.

<targetGroupsTypeHint
  jcr:primaryType="cq:Widget"
  name="./targetGroups@TypeHint"
  defaultValue="String[]"
  xtype="hidden"/>
0
source

Source: https://habr.com/ru/post/1627868/


All Articles