0
votes

I have a dialog which is storing to a jcr:content level node, and that side is working OK. But when the user re-opens the dialog, it is empty (so original values can not be seen or deleted).

Has anyone had any success in populating the dialog field with the values already stored at that address?

For better/easier user experience, I am using a tag field on the author interface, rather than in page properties dialog, but want to store to the page props.

NB: This seems to be default behaviour of the out of the box Title component (Dialog "title" field is always empty). Possibly a bug?

1
I think i have cracked this.Fivebears

1 Answers

0
votes

Found on Adobe Forums site: https://forums.adobe.com/thread/1255836

Edited to use "loadcontent" as beforeloadcontent listener was not firing. edited string munging using pop etc, as it was horrible, but here is the original code which got my tags into the dialog box.

Thanks to Rush Pawan

loadcontent="function(field, record, path) {
                                var targetField=field.getName().replace('../../','./');
                                var pathParts = path.split('/');
                                pathParts.pop();
                                pathParts.pop();
                                var jcrContentPath = pathParts.join('/');
                                var response = CQ.utils.HTTP.get(jcrContentPath +'.json');
                                eval('var data ='+response.responseText);
                                var originalPropName='cq:tags';
                                if(data[originalPropName]!=undefined){
                                    var originalPropVal=data[originalPropName];
                                    this.setValue(originalPropVal);
                                    return false;
                                }
                            }"