• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

cannot use var in <t:columns>

 
Ranch Hand
Posts: 287
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using JSF 1.1 and tomahawk to develop a web app.
I'm trying to create a table dynamically.


In my back bean 'myBean', I have defined a LinkedHashMap<String, Map<Integer, Integer>> variable, where I wanna display its key and value accordingly. But I couldn't get var, listOption, to be used at all. When I try to open the page, its always throwing NullPointerException from #{listOption.key}
Where is wrong with this code? What's the right way to use <t:columns>?
Thanks.
 
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Looking at the JavaDocs, I don't see an iterator for that class. When they said "predictable iteration", I think they meant that iterators of the keyset were predictable, not the internal key-value pairs, which aren't directly accessible.

A further problem is that your attempt to get the value wouldn't be correct anyway. If it worked, the more proper EL would be value="#{listOption.value[listOption.key]}"

Actually, more like:


However, that probably won't work either.
 
reubin haz
Ranch Hand
Posts: 287
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
instead of using map, now I create a class to store those values, and in the back bean I just use an arraylist to store this class object list. Then the problem solved.
thanks for the reply anyway.
 
reply
    Bookmark Topic Watch Topic
  • New Topic