• Post Reply Bookmark Topic Watch Topic
  • New Topic

[Solved][Expression Language] Key to Map can be variable?  RSS feed

 
Vikas Kapoor
Ranch Hand
Posts: 1374
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

If I replace x[0] with actual value it works but not otherwise.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66158
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you can use a variable as a map key.

In your example, are you sure that x is a collection? If not, x[0] makes no sense.
 
Vikas Kapoor
Ranch Hand
Posts: 1374
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
XList is List<Object[]> so x would be Object[] and that's why I am using x[0] that is key to YMap.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66158
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vishal Pandya wrote:If I replace x[0] with actual value it works but not otherwise.


I tried to use my crystal ball to figure out what the problem actually is, but...
 
Vikas Kapoor
Ranch Hand
Posts: 1374
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Change the Crystal Ball.
Anyways, thanks for leg pulling, it was end of day yesterday so was bit tired. Now I made it working.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66158
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What was the issue? (For anyone else that might run into the same problem.)
 
Vikas Kapoor
Ranch Hand
Posts: 1374
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, the value x[0] of and keys of map were not matching. Not any technical issue.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!