ExamGecko
Question list
Search
Search

Related questions











Question 15 - AD0-E134 discussion

Report
Export

A developer needs to create sling models for two fields name and occupations. The dialog has two fields, name - a single value field, and occupations - a multi value field.

The following code is included in sling models inherited from interface com.adobe.aem.guides.wknd.core.models.Byline

A)

B)

C)

D)

A.
Option A
Answers
A.
Option A
B.
Option B
Answers
B.
Option B
C.
Option C
Answers
C.
Option C
D.
Option D
Answers
D.
Option D
Suggested answer: C

Explanation:

Option C is the correct implementation for the Sling Model. Option C uses the @Model annotation with the adaptables parameter set to Resource.class. This allows the Sling Model to adapt from a resource object and access its properties using the ValueMap interface. Option C also uses the @Inject annotation with the name parameter set to "./name" and "./occupations" to inject the values of the name and occupations properties into the name and occupations fields. Option C also uses the @Named annotation with the value parameter set to "byline" to specify the name of the Sling Model that can be used in HTL scripts. Reference:

https://sling.apache.org/documentation/bundles/models.html

https://experienceleague.adobe.com/docs/experience-manager-htl/using-htl/htl-blockstatements.html?lang=en#use

asked 02/10/2024
Joost Huggers
34 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first