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

Create component to filter data from backend

Avatar

Avatar
Ignite 1
Level 1
ealmeida1
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Ignite 1
Give Back
View profile

Avatar
Ignite 1
Level 1
ealmeida1
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Ignite 1
Give Back
View profile
ealmeida1
Level 1

31-10-2019

Hey guys.

I'm new in adobe AEM. I'm trying to use the 6.5 version and figuring out how it works. So, I need to create a component to show a list of files and filter that files based on a drop down value. I'm looking for an example, but I didn't found some way to send values to filter a list in my back end. For now, I'm getting all the values from my @Model class, but I don't know how to send a parameter to filter that list. Is it possible? How is the best way to do that?

Thanks!

Eder

Replies

Avatar

Avatar
Ignite 1
MVP
Ankur_Khare
MVP

Likes

151 likes

Total Posts

363 posts

Correct Reply

56 solutions
Top badges earned
Ignite 1
Validate 10
Validate 1
Give Back 50
Give Back 5
View profile

Avatar
Ignite 1
MVP
Ankur_Khare
MVP

Likes

151 likes

Total Posts

363 posts

Correct Reply

56 solutions
Top badges earned
Ignite 1
Validate 10
Validate 1
Give Back 50
Give Back 5
View profile
Ankur_Khare
MVP

01-11-2019

I would suggest to create a servlet which will get called whenever u will change the dropdown value and pass the selected dropdown value when u call ur servlet and process ur result in ur java class and send back the result to ui for display.

Avatar

Avatar
Ignite 1
Level 1
ealmeida1
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Ignite 1
Give Back
View profile

Avatar
Ignite 1
Level 1
ealmeida1
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Ignite 1
Give Back
View profile
ealmeida1
Level 1

05-11-2019

Hi ka786,

Thanks for answer. I'm trying to follow this example https://aem.adobemarketingclub.com/implementing-use-interface-using-sightly-in-aem-6-x/ . But doesn't work, I'm receiving an error:

"org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: Compilation errors in org/apache/sling/scripting/sightly/apps/test/components/structure/assets/assets_html.java:

Line 38, column 1733 : com.test.MyComponent cannot be resolved to a type". Do you have a better tutorial?

Thanks!

Avatar

Avatar
Ignite 1
MVP
Ankur_Khare
MVP

Likes

151 likes

Total Posts

363 posts

Correct Reply

56 solutions
Top badges earned
Ignite 1
Validate 10
Validate 1
Give Back 50
Give Back 5
View profile

Avatar
Ignite 1
MVP
Ankur_Khare
MVP

Likes

151 likes

Total Posts

363 posts

Correct Reply

56 solutions
Top badges earned
Ignite 1
Validate 10
Validate 1
Give Back 50
Give Back 5
View profile
Ankur_Khare
MVP

05-11-2019

Avatar

Avatar
Ignite 1
Level 1
ealmeida1
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Ignite 1
Give Back
View profile

Avatar
Ignite 1
Level 1
ealmeida1
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Ignite 1
Give Back
View profile
ealmeida1
Level 1

05-11-2019

Good!! I will try that.

One more question: Why I can't create a two way communication between @Model class and the htl page? Because I have some attributes in my model class and I need to access them. Is it correct put all that attributes in a servlet class?

Thanks for everything!