Hi Team. I have a requirement where i need to have the count of number of times a component is dragged and dropped in a page
Suppose i have a link component and its dialog has a field(say analytics-field)
If i drag and drop component for first time in a page, that analytics-field in link component dialog should be auto-populated with value "Link1"
If i drag and drop component for second time in a page, that analytics-field in link component dialog should be auto-populated with value "Link2"
If i drag and drop component for third time in a page, that analytics-field in link component dialog should be auto-populated with value "Link3"
.
.
.
.If i drag and drop component for nth time in a page, that analytics-field in link component dialog should be auto-populated with value "Linkn"
Any way to achieve this,
Thanks
Hi Preetham
As far as I could understand , this can be achieved only via a custom logic in the back-end. Write a sling model for your component, and in the init method write the query to check the count of the component (Using query builder API, find the component count ) in current-page and for each count using Properties API and Node set the value of the property you want to manipulate
Below predicates might help
path = <current page path>
type = "nt:unstructured"
resourceType=< relative path of your component> (never start from /apps)
p.limit=-1
Thanks
Veena
Thanks Veena, Will try this and ill come back if im stuck or if i have any doubts
Views
Replies
Total Likes
Sure. Happy to help anytime. Let us know ..
Views
Replies
Total Likes
This can be achived only with custom logic. There is no particular API to return number of counts.
Thanks Bro, Will try and come back to you if im stuck somewhere
Views
Replies
Total Likes
Sure cheer. Let me know if ur stuck
Views
Replies
Total Likes