Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

Exam AD0-E103 topic 1 question 14 discussion

Actual exam question from Adobe's AD0-E103
Question #: 14
Topic #: 1
[All AD0-E103 Questions]

A developer creates a custom component. The component dialog includes the following two fields:

The component should display the first "˜X' characters of the text entered in the "˜text' input where "˜X' is the number entered in the "˜charLimit' input. If zero, or no value, is entered in the "˜charLimit' input then the text should be unaltered. The developer creates the following Sling Model to perform the trancation:

A Null Pointer Exception occurs if NO charLimit values is set in the component dialog.
What should the developer do to resolve this issue?

  • A. Replace the defaultValue="0" attribute of the "˜charLimit' field in the dialog with min="0".
  • B. Add the @Default annotation to the "˜chatLimit' variable in the Sling Model.
  • C. Replace the defaultValue="0" attribute of the charLimit field in the dialog with defaultValue="{Long}0".
  • D. Change the defaultInjectionStrategy of the Truncation Sling Model to DefaultInjectionStrategy.REQUIRED.
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
chunpin
3 years, 3 months ago
Answer: B A. Replace the defaultValue=”0″ attribute of the ‘charLimit’ field in the dialog with min=”0″. (min property is for minimum value allowed) B. Add the @Default annotation to the ‘chatLimit’ variable in the Sling Model. (Correct Answer) C. Replace the defaultValue=”0″ attribute of the charLimit field in the dialog with defaultValue=”{Long}0″. (No such property called defaultValue) D. Change the defaultInjectionStrategy of the Truncation Sling Model to DefaultInjectionStrategy.REQUIRED. (@Optional annotations are only evaluated when using the defaultInjectionStrategy = DefaultInjectionStrategy.REQUIRED (which is the default), )
upvoted 2 times
...
cs1979
3 years, 8 months ago
Answer is B
upvoted 4 times
...
AEMSR
3 years, 9 months ago
Ans is C
upvoted 1 times
kasyap1125
3 years, 6 months ago
The default value is set using 'value' property, NOT 'defaultValue'. Here @Default will work
upvoted 1 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...