Alright, I'll bite.

If you're talking about model building logic. Is there some architectural 
constraint on why  you don't just stick with java?

-Jason

-----Original Message-----
From: lancedolan [mailto:lance.do...@gmail.com] 
Sent: Wednesday, January 11, 2017 2:37 PM
To: users@sling.apache.org
Subject: RE: JS Use API usability or limitations

Thank you for your time everybody! For posterity:

First to clarify, my very specific question is how to iterate an iterable in 
the model-building logic (what us old timers might call a "backing bean"). I do 
already know that I can use HTL to iterate the children, and I do recognize 
that in this contrived example it's a better separation of view/model concerns 
to do so. However I'm going to need to do lots of iterating on resources in my 
"backing beans" as I build model data for increasingly complex objects. Imagine 
a component that searches various parts of the JCR and filters on specific 
properties to generate a heterogenous list of content links... To suggest HTL 
just skirts around my development need in model-building logic.

Vlad's syntax solved my problem. I'd love to understand why. It seems the 
Iterable contains a Map or List objects with a key and resource... Is that due 
to Rhino? The Sling docs say getChildren returns Iterable<Resource>. I didn't 
expect this.

I'm already feeling the pain of debugging JS Use API, which Stefan has warned 
about, and so did the sling docs on.

I'm concluding that the JS Use API probably isn't ready and requires too much 
esoteric/idiomatic knowledge to give the sort of development speed one would 
expect with JS. I'm going to keep it as an option for very simple components.






--
View this message in context: 
http://apache-sling.73963.n3.nabble.com/JS-Use-API-usability-or-limitations-tp4069490p4069521.html
Sent from the Sling - Users mailing list archive at Nabble.com.

Reply via email to