Expand my Community achievements bar.

SOLVED

AEM:: dropdown select values and checkbox not being saved

Avatar

Level 4

I have added a new tab to page properties. The tab consists of a multifieldpanel (acs-aem-commons bundle). I am trying to add a textfield, a dropdown and a number of checkboxes. The issue is that when I select the value under dropdown and select the checkboxes, everything looks fine but when I open the Page properties again it doesn't look like the values have been saved. Here is the code

<tab_myuhc_suppression xmlns:social="http://www.adobe.com/social/1.0" jcr:primaryType="cq:Panel" title="Suppression"> <items jcr:primaryType="cq:WidgetCollection"> <idsuppress jcr:primaryType="cq:Widget" fieldDescription="Press + to add more" fieldLabel="Configure ID card suppress" name="./idsuppress" width="1000" xtype="multifield"> <fieldConfig jcr:primaryType="cq:Widget" name="./fieldConfig" xtype="multifieldpanel"> <items jcr:primaryType="cq:WidgetCollection"> <providedValue jcr:primaryType="cq:Widget" allowBlank="false" fieldDescription="Please provide the value for option selected above" fieldLabel="Provide value here" key="providedValue" labelStyle="width:150px" name="./providedValue" xtype="textfield"/> <selectList jcr:primaryType="cq:Widget" defaultValue="0" fieldLabel="Business Rules" name="./suppress" type="select" xtype="selection"> <options jcr:primaryType="cq:WidgetCollection"> <one jcr:primaryType="nt:unstructured" text="Vanity URL" value="Vanity"/> <two jcr:primaryType="nt:unstructured" text="PV/RC" value="PVRC"/> <three jcr:primaryType="nt:unstructured" text="SA/OI" value="SAOI"/> <four jcr:primaryType="nt:unstructured" text="Market Type" value="Market"/> <five jcr:primaryType="nt:unstructured" text="Product Code" value="Product"/> <six jcr:primaryType="nt:unstructured" text="Div Code" value="Div"/> <seven jcr:primaryType="nt:unstructured" text="State of Issue" value="State"/> <eight jcr:primaryType="nt:unstructured" text="Government Program Code" value="Government"/> </options> </selectList> <suppressOptions jcr:primaryType="cq:Widget" title="Selection Options" xtype="dialogfieldset"> <items jcr:primaryType="cq:WidgetCollection"> <whole jcr:primaryType="cq:Widget" fieldLabel="Suppress View ID Card Functionality" labelStyle="width:240px" name="./whole" type="checkbox" width="auto" xtype="selection"/> <order jcr:primaryType="cq:Widget" fieldLabel="Suppress Order ID card Functionality" labelStyle="width:239px" name="./order" type="checkbox" width="auto" xtype="selection"/> <view jcr:primaryType="cq:Widget" fieldLabel="Suppress View ID Card Functionality" labelStyle="width:238px" name="./view" type="checkbox" width="auto" xtype="selection"/> </items> </suppressOptions> </items> </fieldConfig> </idsuppress> </items> </tab_myuhc_suppression>
1 Accepted Solution

Avatar

Correct answer by
Level 10

Did you overlay the page props dialog - as discussed here:

https://helpx.adobe.com/experience-manager/kb/CQ5PageProps.html 

Also - i modified my first comment - i was thinking the use case of widgets on the web page. 

View solution in original post

11 Replies

Avatar

Level 10

Hi,

Have you added the checkbox within the multifield panel or outside the panel ?

Can you also share your multifield widget script

Avatar

Level 10

Are you saying that you enter values and then close and when you open - the values are gone?  Dialog fields do not need persist logic. (when I stated saved - i was thinking the widgets on the web page - in which case - yeah - you need to write persist logic). 

Avatar

Employee

Can you remove the name attribute from the multifield items(select and text box) and then check?

Avatar

Level 4

smacdonald2008 wrote...

There is no app logic to save/persist these values. When you enter values into a dialog, the values are retrieved and used in the components JSP. To save them you have to write logic and store them somewhere like the JCR.

 

Thanks for the response. So, does that mean that every time I have to include a checkbox or a dropdown in Page properties I have to write some custom logic. What about the textfield ? I haven't written any custom logic for that. Also, what about the Page Properties that are by default included on /libs/foundation/page template. I am sure they have some sort of dropdown too. Is there any logic implemented there as well ? I have added dropdowns and checkboxes to Page Properties before but never had to write custom logic to save the values. Is it because I am implementing this whole thing inside a multifled, that is why I have to write some logic.

Avatar

Level 4

bsloki wrote...

Hi,

Have you added the checkbox within the multifield panel or outside the panel ?

Can you also share your multifield widget script

 

The checkboxes have been added inside the multifieldpanel. Also, the multifieldpanel is the part of the acs-aem-commons bundle. It's not something that I have written.

Avatar

Level 10

Can you post a screen shot of the dialog.  

Avatar

Level 4

kalyanar wrote...

Can you remove the name attribute from the multifield items(select and text box) and then check?

 

Not helping either.

Avatar

Level 4

smacdonald2008 wrote...

Can you post a screen shot of the dialog.  

 

Here are four screenshots. I have attached. Let me know if you need any further information.

Avatar

Correct answer by
Level 10

Did you overlay the page props dialog - as discussed here:

https://helpx.adobe.com/experience-manager/kb/CQ5PageProps.html 

Also - i modified my first comment - i was thinking the use case of widgets on the web page. 

Avatar

Level 10

Can you please package you your apps example (with the overlay page props as talked about in the KB above) into a package and send to scottm@adobe.com. Also tell me what version you are using. I want to look at your code to get to the bottom of this. 

Avatar

Level 4

smacdonald2008 wrote...

Can you please package you your apps example (with the overlay page props as talked about in the KB above) into a package and send to scottm@adobe.com. Also tell me what version you are using. I want to look at your code to get to the bottom of this. 

 

I have sent the package to you. I am using AEM 6.0 and using the version 1.9.4 of the acs-aem-commons package.