Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt in paramValues

 
Srividhya Kiran
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all

In HFSJ mock exam chapter 8 question 1 its given option E is incorrect syntax.

${paramValues[hobbies][0]}

given that hobbies is a request parameter checkbox with multiple values.

I m not getting any error for this syntax and I get the first value of hobbies.

what is wrong in this syntax?

Thanks
Srividhya
 
Tony romer
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it is wrong i did not understand why it works fine on you.
paramValues is a Map
If you say
paramValues[hobbies]

Then it looks hobbies attribute is pageContext, since it is a parameter it could not find it and should give you an error.

normal usage

paramValues.hobbies[0]
paramValues['hobbies'][0]
paramValues["hobbies"][0]
 
Srividhya Kiran
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry tony I used it with quotes.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic