Expand my Community achievements bar.

Save property value at 2 places

Avatar

Level 4

Hi,

I have a requirement to save property values at 2 places under the page as soon as ok button is clicked in the dialog. At one place it is getting saved automatically. How can I save it at the other place. e.g. under jcr:content node.

2 Replies

Avatar

Level 4

Shallu Rohilla wrote...

Hi,

I have a requirement to save property values at 2 places under the page as soon as ok button is clicked in the dialog. At one place it is getting saved automatically. How can I save it at the other place. e.g. under jcr:content node.

 

Avatar

Community Advisor

Hi Shallu,

I don't think so it is possible OOTB. You will need to write a listener in dialog, that listener will modify the form values that are posted on click of OK in a dialog.

  1. ./sling:resourceType:
    geometrixx-media/components/article-summary
  2. ./jcr:lastModified:
     
  3. ./jcr:lastModifiedBy:
     
  4. _charset_:
    utf-8
  5. :status:
    browser
  6. ./pagePath:
    /content/geometrixx-media/en/events/the-lineup-you-ve-been-waiting-for

Above is the ideal POST call that happens on click of OK in dialog. All you need to do is, modify the form parameters on dialog post to something like:

  1. ./sling:resourceType:
    geometrixx-media/components/article-summary
  2. ./jcr:lastModified:
     
  3. ./jcr:lastModifiedBy:
     
  4. _charset_:
    utf-8
  5. :status:
    browser
  6. ./pagePath:
    /content/geometrixx-media/en/events/the-lineup-you-ve-been-waiting-for
  7. ../parentNodeProp: /content/geometrixx-media/en/events/the-lineup-you-ve-been-waiting-for

the last form parameter stores the record on the parent node of the component node with property name - parentNodeProp with same value.

- Runal