I have a wcmuse class which works fine with data-sly-use.
Now I want to invoke this class and its methods from Sightly Javascript-use api.
I want to do some extra work hence i need to have data-sly-use functionality in javascript.
Please help.
When I try this code in JS its getting instantiated but the activate method is not invoked :
use(function () {
var articleList = new Packages.com.xxx.cq.unifiedweb.core.sightly.DocumentationPageHelper;
var list = articleList.getRecommendedList();
// you can reference the parameters via the this keyword.
var retValue = this.value1 + this.seperator + this.value2;
return {
newValue: retValue
};
});
Java class :
public class DocumentationPageHelper extends WCMUse {
@Override
public void activate() throws Exception {
SlingScriptHelper slingScriptHelper = getSlingScriptHelper();
/** Do something **/
}
}
Solved! Go to Solution.
Views
Replies
Total Likes
Answer is no - if you want to use WCMUse API - you call it from HTL code.
Here is breakdown of HTL Articles
1 - show how to work with WCMUsePojo - Creating an Adobe Experience Manager 6.4 HTL component that uses the WCMUsePojo API
2 - how to work with HTL and Sling Models - Creating a custom Touch UI Grid Component for Adobe Experience Manager
3 - how to use JS API - Creating a Tab layout component for Adobe Experience Manager
Typically - you pick one of these methods - you cannot mix them.
Views
Replies
Total Likes
Hi,
I think you cannot invoke in that way as per my knowledge i.e., Java Use API in JS Use API..
You can invoke Java use API and JS use API in HTL file only.
Thanks,
Ratna Kumar.
Views
Replies
Total Likes
Thanks for your reply but I am using the JS use API in HTL only.
I just want to know if we can call the custom WCMuse class from JS use API?
Views
Replies
Total Likes
Answer is no - if you want to use WCMUse API - you call it from HTL code.
Here is breakdown of HTL Articles
1 - show how to work with WCMUsePojo - Creating an Adobe Experience Manager 6.4 HTL component that uses the WCMUsePojo API
2 - how to work with HTL and Sling Models - Creating a custom Touch UI Grid Component for Adobe Experience Manager
3 - how to use JS API - Creating a Tab layout component for Adobe Experience Manager
Typically - you pick one of these methods - you cannot mix them.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies