Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

How to get properties of page from JavaScript?

bhoang
Level 4
Level 4

Hi,

I am create an admin form on AEM for the admin input the data for a page. So, I will use JavaScript to get the content from properties page to show into the field when edit page.

Example:

In this admin form to create a page with some fields, the user will choose the path and the list of PPD property of that path will display on the select list. After that the admin will sync and save the data.

ppd-property-select-2.PNG

When they choose "View properties" to edit the page, I want the select list will be select the previous value.

I want to use JavaScript to get value from the page properties when it load ready.

ppd-property-select.PNG

Thank you for your help,

1 Accepted Solution
Feike_Visser1
Correct answer by
Employee
Employee

things like 'granite.resource' are only available in serverside Javascript.

View solution in original post

3 Replies
Feike_Visser1
Correct answer by
Employee
Employee

things like 'granite.resource' are only available in serverside Javascript.

View solution in original post

Rima_Mittal
Level 4
Level 4

Try writing the logic in a backend service which reads and returns child nodes under the path specified and from your JS file, ajax a servlet which brings all the required content through the service.

Hope this helps!

edubey
Level 10
Level 10

If you know the path, make a request directly from browser with .json without servlet/service. I am assuming this is only author specific case.