質問

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