cancel
Showing results for 
Search instead for 
Did you mean: 

Assign an array as Default Value to property in contribution.xml

arijit_das
Active Contributor
0 Kudos

In my contribution.xml for an extension, I have a property like below:

<property
  id="values"
  title="Values"
  type="Array"
 />
<initialization>
       <defaultValue property="values">
            [10,12,13,16,9]
       </defaultValue>
</initialization>

I am getting error in Design Studio.

If I use property of type int then I have no problem. I guess I am passing the array incorrectly as default value. Any idea ?

arijit_das
Active Contributor
0 Kudos

I have modified the contribution.xml as below:

       <property
            id="xAxis"
            title="x-Axis"
            type="Array">
            <property
                id="xValues"
                title="x-Axis Values"
                type="int"
            />
        </property>
        
        <property
            id="yAxis"
            title="y-Axis"
            type="Array">
            <property
                id="yValues"
                title="y-Axis Values"
                type="int"
            />
        </property>

<initialization>
   <defaultValue property="LEFT_MARGIN">5</defaultValue>
   <defaultValue property="TOP_MARGIN">5</defaultValue>
   <defaultValue property="WIDTH">400</defaultValue>
   <defaultValue property="HEIGHT">300</defaultValue>
            
   <defaultValue property="xAxis">[10,20,9,25]</defaultValue>
   <defaultValue property="yAxis">[30,23,15,27]</defaultValue> 
 </initialization>

Now, I am not getting any error and the component also working in Design Studio. However, the default values are not appearing initially in the property pane.

Any idea ?

Accepted Solutions (0)

Answers (0)