Hello everybody, I want to start sharing my knowledge in CQ with this little and easy post. I will break the ice saying that Adobe CQ is an enterprise CMS that runs on a Java SE platform, which is built on standard technologies like JCR, the OSGi Framework and Apache Sling, but I will left the overview about CQ for another post and focus this one in our topic.
In CQ, the pathfield widget is an input field designed to enter paths, providing path completion and server repository browsing capabilities via a browsing button located at the right side of the field. This widget is very useful to provide an easy way to get local links from the server content repository, or to select some kind of approved external links. The problem many times is that this browser mechanism can be skipped and the author may enter code manually, pointing to an arbitrary or non approved link. When you start developing in CQ (as with other languages) you may forget this kind of details, and in fact I did, but when you are reviewing code or fixing bugs they will became notorious. How to get rid of that? Setting editable as false will do the trick. See the code below,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
xml version="1.0" encoding="UTF-8"?> jcr:primaryType="cq:Dialog" height="400" stateful="false" xtype="dialog"> jcr:primaryType="cq:Widget" title="Search" xtype="panel"> jcr:primaryType="cq:Widget" editable="{Boolean}false" fieldLabel="Link Address" name=".pathfield" xtype="pathfield"/> |
Refer to the CQ Widgets API to get more information about the widget you are using.
hehe, genau das habe ich gesucht 🙂
Danke
Bernd A
Hallo Bernd, ich freue mich darüber, dass dieser Eintrag dir helfen konnte 🙂
Sehen uns Morgen!
Alberto