problems with granite.resources | Community
Skip to main content
germansan1992pl
August 24, 2018
Solved

problems with granite.resources

  • August 24, 2018
  • 2 replies
  • 2961 views

Hi, excuse me, Im noob in AEM 6.3. I have a cq: Client Library Folder that contain a js with a function as shown below.

but it said "granite is not defined" when I try to get some property from the touch UI dialog like this:
var prueba = granite.resource.properties["showComercializable"];

where "showComercializable" its the name property in touch UI dialog.

thanks in advance

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by arunpatidar

Hi,

You need to create JS Use-API(server side JS) and use inside HTL, clientlibs are use for client side. Please check below.

HTL JavaScript Use-API

Thanks

Arun

2 replies

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
August 24, 2018

Hi,

You need to create JS Use-API(server side JS) and use inside HTL, clientlibs are use for client side. Please check below.

HTL JavaScript Use-API

Thanks

Arun

Arun Patidar
edubey
Level 10
August 27, 2018

AFAIK, on client side there is no object with name granite but there is one with Granite

What are you trying to achieve, based on which I can recommend client/server side