ArrayList al2 = new ArrayList(); al2.add("AA2"); al2.add("BB2"); al2.add("CC2"); hm.put("TWO", al2);
Now I have a Datatable with two columns. First column shows the key and the second column I again have a datatable to show the ArrayList. So I will have one row with a key and the values again shown in a datatable. So far I no luck and need some help on how to achieve this. Here is the index2.jsp code I have:
Now when I run this application the keys are shown in the respective column but values are coming up as
[AA2, BB2, CC2] in one row rather in a separate Row as I am using a Datatable inside UIColumn to show the values.
Here is what I see in the output:
keys Values TWO [AA2, BB2, CC2] [AA, BB, CC] ONE [AA2, BB2, CC2] [AA, BB, CC]
As above output is not correct as it shows both list values in front of each key rather than what those keys are tied to. I wanted the following output:
keys Values ONE AA BB CC TWO AA2 BB2 CC2
So I can do sorting pagination on the values datatable. But currently the output is not shown correctly. Any help is really appreciated. My hashmap will be populated dynamically so wants to show the key and values in separate column but also need to show the values in an embedded datatable as the list can be huge.
Otherwise ,if we have someother type example like this.please help me in this,needful to me. Thanks in advance Thanks
Joined: Apr 17, 2008
Did you find an answer for this?
I have a need to bind a textbox to an object living inside HashMap. Share your thoughts, if you have found the answer.
Thanks!<br />Rahul, IOWA
Joined: Aug 06, 2004
This might work :
Here bean.getEntrySet method is written like this :