Expand my Community achievements bar.

SOLVED

Inject Tagfield and selection with multiple='true'?

Avatar

Level 2

How to retrieve value from below field with multiple='true' i.e can select ,multiple values  via sling model ?

1. tagfiled

2. selection

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

 

Map the respective tagfield/select resource in Sling model using the same "name" attribute value with data type as String[]. 

Further processing of the values can be done either in init method or in respective getters

 

Eg: tagfield resource "name" property value is tagValues

@inject

private String[] tagValues;

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi,

 

Map the respective tagfield/select resource in Sling model using the same "name" attribute value with data type as String[]. 

Further processing of the values can be done either in init method or in respective getters

 

Eg: tagfield resource "name" property value is tagValues

@inject

private String[] tagValues;