Getting flag value from dialog

I am new to Cq5. I have a checkbox in my dialog box and I want to get its boolean value in my jsp when the user selects or deselects it. Support with

+5
source share
3 answers

It works for me

Properties for the dialog box:

name: ./checkbox1
type: checkbox
xtype: selection

the code:

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

If you want to get the value from your JSP component, do the following:

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

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

Hope this helps.

+5
source

Each widget that you add in the components dialog is stored in CRX as a property for cq: Component node. All of these properties can be obtained in jsp by typing properties. in EL brackets (for example:) ${properties.<name_of_property>}. Remember to include the /libs/foundation/global.jsp file in your jsp.

0
source

All Articles