Facing issues while passing string array from Sightly to Java WCMUse Class
Hi All,
In my component.html I have the below :
#1] <div data-sly-use.componentUse="${'com.xxx.xxx.componentUse' @ propertyName='properties.relatedPath'}" data-sly-unwrap>
</div>
where "relatedPath" is of type String[] holding values for the below dialog section
<multi
jcr:primaryType="cq:Widget"
fieldLabel="Multi-Field"
hideLabel="{Boolean}true"
name="./relatedPath"
xtype="multifield">
<fieldConfig
jcr:primaryType="nt:unstructured"
xtype="pathfield"/>
</multi>
#2] In my corresponding Java WCMUse class, I have the below :
private static final String PROPERTY_NAME = "propertyName";
private String[] properties;
public void activate() throws Exception {
properties = get(PROPERTY_NAME, String[].class);
But "properties" is always returning null, though the property has two values of pathfields.
#3] Also, I see com.adobe.cq.sightly.WCMUse Failed to cast value
java.lang.ClassCastException: Cannot cast java.lang.String to [Ljava.lang.String; getting logged.
Not sure what am I missing. Any thoughts/pointers/reference/snippet will be really helpful.