-1

I have a design dialog where the values are getting stored in etc/design//. But now how should i read these property in Sling model?

Ishita Gandhi
  • 21
  • 1
  • 2
  • 6

2 Answers2

1

you could use script-bindings to get currentStyle -

@Inject @Source("script-bindings")
private Style currentStyle

then use -

currentStyle.get("<name of the text field>",String.class)
Ameesh Trikha
  • 1,652
  • 2
  • 12
  • 18
0

You can inject a ResourceResolverFactory then get a ResourceResolver and then obtain any property you need.

Danil Gaponov
  • 1,413
  • 13
  • 23