Chuyển đến nội dung chính

Bài đăng

Hiển thị các bài đăng có nhãn Listeners in CQ (Getting value from one widget into other widget)

Listeners in CQ (Getting value from one widget into other widget)

Listeners in CQ (Getting value from one widget into other widget) Problem: While working on a component in CQ I got struck while finding a value from one of the widgets which was to be used in other widget. The solution came with the name "listeners". But how to create one and how to implement it remained a problem. Solution: In CQ you can associate a listener with a component, a dialog, a widget etc. For that you just need to create a folder with the name listeners as shown below. As I was looking to use the value in my second widget( title= "SecondWidget") from the first widget( title= "FirstWidget"), I created a listener for it just as shown above with type as nt:unstructured. I used the property name as beforeshow as I want to do the functionality before showing of that widget. Now just write the functionality under function(){<functionality in pure javascript>}. Thats it you are done. e.g. function(){alert("123");} in this ...