Re: Sightly :: JavaScript Use-API :: what property to use instead of "granite.resource" to access the current resource in JS?

2015-10-17 Thread Vlad Bailescu
Hi Sandro, I started putting together some documentation at [2] but it's stil WIP. Vlad [2] - https://github.com/vladbailescu/sling-sightly-docs/blob/master/use-api.md On Sunday, October 18, 2015, Sandro Boehme wrote: > Hello, > > I would like to access the current resource in the Sightly Ja

Re: Sightly :: JavaScript Use-API :: passing an element attribute to JS file

2015-10-23 Thread Vlad Bailescu
Hi Sandro, Sightly blocks/expressions are only aware of the HTML context, not the whole DOM tree so you cannot use the attributes like this. However, I assume data-component-id="4" is generally not hardcoded, but rather coming from some sort of expression, like data-component-id="${some_expressio

Re: Exception when trying out the fling sample

2016-04-30 Thread Vlad Bailescu
Hi Roy, It seems Thymeleaf is not handling the HTML scripts, they get processed by Sightly instead. You could check the configured service ranking of Thymeleaf, as suggested in https://sling.apache.org/documentation/bundles/scripting/scripting-thymeleaf.html Best, Vlad On Saturday, 30 April 2016

Re: Exception when trying out the fling sample

2016-04-30 Thread Vlad Bailescu
On Saturday, 30 April 2016, Oliver Lietz wrote: > (service ranking is not honored by Sling's script engine manager, no need > to try). Any idea why this is not a bug? https://issues.apache.org/jira/browse/SLING-4330 > > I was under the impression SLING-4330 is about using both Sightly and Th

Re: Exception when trying out the fling sample

2016-05-01 Thread Vlad Bailescu
Hi, My comments are inline. On Sunday, 1 May 2016, Oliver Lietz wrote: > On Saturday 30 April 2016 22:04:57 Vlad Bailescu wrote: > > On Saturday, 30 April 2016, Oliver Lietz > wrote: > > > (service ranking is not honored by Sling's script engine manager, no > ne

Re: Including attributes with Sightly/HTL

2016-10-28 Thread Vlad Bailescu
Hi Roy, HTL does not allow arbitrary inclusion of scripts output. The scripts output for data-sly-include is appended to the current element content. The proper way to add attributes would be to use data-sly-attribute and provide the attributes from a Use API object and not from an external script

Re: JS Use API usability or limitations

2017-01-11 Thread Vlad Bailescu
Hi Lance! The problem is not the JS Use API but the way the JS Iterator is used. One should do: for (var [key, res] in Iterator(children)) { returnObj.content += res.name; } Also, Robert is right, you should strive to keep your business logic (use objects) as light as possible do the ite

Re: JS Use API usability or limitations

2017-01-11 Thread Vlad Bailescu
Hi Regarding syntax, I'm not very good at JS and had to peek at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator. I understood that this syntax is standard for..in usage (when not using keyOnly Iterator constructor) and tested it quickly in REPL. The JS AP

Re: Best Sling samples for a beginner to look at?

2017-03-29 Thread Vlad Bailescu
Hi Greg, There's also Nate Yolles' Publick blog [5] Best, Vlad [5] https://github.com/nateyolles/publick-sling-blog On Wed, Mar 29, 2017 at 10:41 AM, Greg Fullard wrote: > Tx Chris, Bertrand, Andreas > > I think that gives me a good starting point. > > I'll keep a mini-journal of my experienc

Re: Flexible adaptable not resulting in instantiation of correct model

2019-06-11 Thread Vlad Bailescu
Hi Liam, AFAIK, the mentioned pattern is not designed to work with Sling Models. It simply uses the adaptTo pattern to transform the adaptable to the given class. Best, Vlad On Tue, Jun 11, 2019 at 9:00 PM Liam C wrote: > Hello, > > Is anyone able to replicate this, or to confirm that they ha