Hello,
I want to update the rootpath of pathfield in authoring dialog based on other filed value (dropdown selection). Appreciated for quick pointers on this.
Thanks.
Solved! Go to Solution.
Views
Replies
Total Likes
I did not find solution at https://helpx.adobe.com/experience-manager/using/jstl.html.
But i have fixed the problem as below. When user click on path field it will open a browse dialog (At back-end, in pathfield.js it will invoke a "onTriggerClick" function. In that function it will check if browseDialog object is null or not. If yes it will create new browseDialog (configs based on the rootPath property configured in dialog.xml, if nothing set, by default takes /content) and shown to user.
As per my requirement, when i change the dropdown value in authoring dialog, path field rootpath should be changed. After i changed the dropdown value, click on path field will again trigger "onTriggerCallFunction function" . As per below code it should change the rootPath. But it will not change the rootpath and show the previous value. Because "onTriggerCallFunction" will not create new browsedialog, it will show the same browsedialog crated with previous value. One way to fix this add "parhfiledObj.browseDialog=null" after setting the treeRoot in if statement
var selectValue = pane.find(...);
var pathfiledObj = panel.find(....)
if (selectValue == "c1"){pathfiledObj.treeRoot.name="/content....")}
Fix: pathfiledObj.browseDialog=null
if (selectValue == "c1"){pathfiledObj.treeRoot.name="/content....");pathfiledObj.browseDialog=null;}
Let me know for more details
Views
Replies
Total Likes
Are you working in Touch UI or Classic
Views
Replies
Total Likes
working on AEM 6.0 classic UI.
Please share the links for both classic & touch UI.
Views
Replies
Total Likes
See this AEM article - it covers this as part of building a component that uses a Pathfield in a Multifield:
https://helpx.adobe.com/experience-manager/using/jstl.html
this.devImage = new CQ.form.PathField ({
fieldLabel: "Image",
rootPath:"/content/dam",
regex :/\.(png|jpg|jpeg|gif|tiff|bmp|pnm|pgm|pbm|ppm|psd|eps|dng)$/,
regexText : "Please choose an image file",
editable : false,
allowBlank: false,
width: 225,
listeners: {
Views
Replies
Total Likes
i am able to set Rootpath.
In my case authoring dialog has two fields. Type(dropdown) & target (path field). Based on the selection in type droodown i want to set the rootpath dynamically. i tried setting dailog...getField().treeRoot.name to required path but it didnt work.
Views
Replies
Total Likes
"i want to set the rootpath dynamically"
Here is the reference for this data type:
https://docs.adobe.com/docs/en/cq/5-3/widgets-api/index.html?class=CQ.form.PathField
Set rootPath using code.
Views
Replies
Total Likes
In this example - there is a package.
https://helpx.adobe.com/experience-manager/using/jstl.html
I am going to try and set rootPath of a Pathfield in an event handler (in the JS file) and report back. It should display the value that is set.
Views
Replies
Total Likes
I did not find solution at https://helpx.adobe.com/experience-manager/using/jstl.html.
But i have fixed the problem as below. When user click on path field it will open a browse dialog (At back-end, in pathfield.js it will invoke a "onTriggerClick" function. In that function it will check if browseDialog object is null or not. If yes it will create new browseDialog (configs based on the rootPath property configured in dialog.xml, if nothing set, by default takes /content) and shown to user.
As per my requirement, when i change the dropdown value in authoring dialog, path field rootpath should be changed. After i changed the dropdown value, click on path field will again trigger "onTriggerCallFunction function" . As per below code it should change the rootPath. But it will not change the rootpath and show the previous value. Because "onTriggerCallFunction" will not create new browsedialog, it will show the same browsedialog crated with previous value. One way to fix this add "parhfiledObj.browseDialog=null" after setting the treeRoot in if statement
var selectValue = pane.find(...);
var pathfiledObj = panel.find(....)
if (selectValue == "c1"){pathfiledObj.treeRoot.name="/content....")}
Fix: pathfiledObj.browseDialog=null
if (selectValue == "c1"){pathfiledObj.treeRoot.name="/content....");pathfiledObj.browseDialog=null;}
Let me know for more details
Views
Replies
Total Likes
I have same requirement for tagpicker, can you please share the code snippet that you used for this.
Views
Replies
Total Likes
Could you please share the code snippet a little more elaborately, it would be really helpful. I have the same requirement.
Regards,
Bhavya S
Views
Replies
Total Likes
Views
Likes
Replies
Views
Like
Replies