Вопрос

I am fairly new to Day Cq5.I am having a checkbox in my dialog and i want to retrieve its boolean value in my jsp when user selects or deselects it .Kindly help

Это было полезно?

Решение

This works for me

Properties for dialog field:

name: ./checkbox1
type: checkbox
xtype: selection

code:

boolean isChecked1 = properties.get("checkbox1", false);

Другие советы

If you want to retrieve the value from your component's JSP, then do this:

boolean foobar = properties.get("nameOfYourCheckbox", true);

You can specify the default value by using true/false as the second argument.

Hope that helps.

Every widget you add to your components dialog is stored in CRX as a property to the cq:Component node. All this properties can be accessed in the jsp by typing properties. in EL brackets (like this: ${properties.<name_of_property>}). Don't forget to include the /libs/foundation/global.jsp file to your jsp.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top