CQ5 - Dynamically populating options in selection xtype

最后都变了- 提交于 2019-12-03 17:18:15
Sharath Madappa

Options for the selection xtype can be set dynamically in two ways

  1. setting the options property to a path that returns a JSON array of options
  2. Writing a function that sets the options (using setOptions method ) and passing this function as the value for optionsProvider property.

In both the cases data returned in JSON must be an array.

To use method 1 , on the headerType node set options property to the path that will provide the JSON data. Set optionsRoot proprety to the name of the property that contains the JSON array. Set optionsTextField to the name of the property in the JSON data that should be text. Set optionsValueField to the name of the property in the JSOn data that should be the value.

A detailed tutorial on this can be found here : http://jenikya.com/blog/2013/04/dynamic-dialog-data-in-cq5.html

For method 2 refer this

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!