Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

how to read checkbox/select in custommultifield from component jsp

Avatar

Level 2

Hi Experts,

 

I have created a custommultifield which consist of checkbox, textfield and textarea. custommultifield can have maxitems 3.

I am facing problem while accessing the value of checkbox from component jsp.

I am doing this from jsp:

 

<c:set var="checkBox" value="${properties.parsysValue}" scope="request"></c:set>/*check box*/
<c:set var="learnmore" value="${properties.learnmore}" scope="request"></c:set>/*text field*/
<c:set var="findlocation" value="${properties.findlocation}" scope="request"></c:set>/*Text area*/

Whenever i do a add(+) in edit mode of component i get valkue's of textfield and textarea as a ARRAY and iterating over this array i could fetch the values for all three textfields and textarea. but this does not work with checkbox. i do not get an array of checkboxes. What i get is the string value of checkbox that is checked.

Even I changed checkbox to select(dropdown) but the problem that I face now is that dropdown does not retain value once the dialog is submitted and reopened again in edit mode.

I want to capture out of three how many checkbox have been checked or unchecked and need to apply a logic acoordingly.

Would like to know what is the appropriate way of getting checkbox value for all the three checkboxes that is the part of custommultifield.

 

Thanks

Sudeep
 

1 Accepted Solution

Avatar

Correct answer by
Level 10

Here is a community article that may help you. It talks about using a multifield with custom xtype and uses a check box:

http://cq.shishank.info/2011/12/19/multifield-with-custom-xtype/

Hope this helps you. 

View solution in original post

1 Reply

Avatar

Correct answer by
Level 10

Here is a community article that may help you. It talks about using a multifield with custom xtype and uses a check box:

http://cq.shishank.info/2011/12/19/multifield-with-custom-xtype/

Hope this helps you.