Hi Ajay,
        That shouldn't be necessary.  Your data structures are correct.  The 
problem is your column identifier being "class".  The BeanAdapter is going to 
first look for a method named "getClass" in the HashMap, which, of course, will 
find the "getClass" method from Object and use the "toString()" method of that 
to print the value.  So, you should just change the column name to "clazz" (or 
similar) and then everything should be fine.
        Each column of data will be one entry in the HashMap (which you have 
done correctly), so you don't need a Map<String, String, String> (which is 
actually not possible anyway:  there can only be a map from one value to 
another).

HTH,
~Roger

On Aug 21, 2013, at 5:46 AM, Ajay Bhat wrote:

> I'm thinking I should change the
> Map <String, String>
> 
> to
> 
> Map <String, String, String>
> 
> since there are 3 columns.
> 
> 
> On Wed, Aug 21, 2013 at 6:13 PM, Ajay Bhat <a.ajay.b...@gmail.com> wrote:
> 
>> Here are the 2 attachments I sent earlier :
>> 
>> 1.
>> http://i1175.photobucket.com/albums/r628/otto_netz/Capture1_zps36f0a2a1.jpg
>> 
>> 2.
>> http://i1175.photobucket.com/albums/r628/otto_netz/Capture2_zps3c8d3a2a.jpg
>> 
>> Here's a link to the code :
>> https://github.com/ajaybhat/ApacheWorkspace/blob/master/Luke%20Sandbox/src/org/apache/lucene/luke/ui/AnalyzersTab.java
>> 
>> 
>> Check around line 192.
>> 
>> 
>> On Tue, Aug 20, 2013 at 9:53 PM, Roger L. Whitcomb <
>> roger.whitc...@actian.com> wrote:
>> 
>>> Hi Ajay,
>>> 
>>>                The attachments didn't come through.  But, I've seen
>>> this before.  Are you trying to use a HashMap for the whole row?  So
>>> that the data for the entire TableView would have to be
>>> List<HashMap<String,xxx>>?!  Or are you trying to assign a HashMap value
>>> to just one column?  By default the column renderers for TableView show
>>> the "toString()" result of whatever bean value gets fetched from the
>>> column/row data.  So, if you have put a HashMap in for a single column
>>> then I expect you would get the class name, because that's what
>>> "toString()" of a HashMap returns.  It might help to see some code from
>>> your application to see how you are setting up the data model for the
>>> TableView.  The other thing to think about is writing a custom column
>>> renderer, if you really need multiple values in a single column (but
>>> that's assuming that's your intent; without the screen shots or some
>>> code it is hard to tell).
>>> 
>>> 
>>> 
>>> HTH,
>>> 
>>> ~Roger
>>> 
>>> 
>>> 
>>> From: Ajay Bhat [mailto:a.ajay.b...@gmail.com]
>>> Sent: Tuesday, August 20, 2013 7:35 AM
>>> To: dev@pivot.apache.org
>>> Subject: Column entries not being added to table via HashMap
>>> 
>>> 
>>> 
>>> Hi,
>>> 
>>> 
>>> 
>>> I'm encountering a bit of a problem with adding an entry to
>>> TableView.Column. The class field of the TableView below [Attachment 1]
>>> shows the getClassName() of HashMap instead of expected result.
>>> 
>>> 
>>> 
>>> Writing out the value of the HashMap to the std out shows me the HashMap
>>> gives me the expected results, but it doesn't show up in TableView.
>>> [Attachment 2]
>>> 
>>> 
>>> 
>>> The Javadoc entry shown by Eclipse for put() is:
>>> 
>>> String org.apache.pivot.collections.Map.put(String key, String value)
>>> 
>>> 
>>> 
>>> Sets the value of the given key, creating a new entry or replacing the
>>> existing value, and firing a corresponding event.
>>> 
>>> 
>>> 
>>> I don't seem to be doing anything wrong. Can I get some help here?
>>> 
>>> 
>>> 
>>> 
>>> 
>>> --
>>> 
>>> Thanks and regards,
>>> 
>>> Ajay Bhat
>>> 
>>> 
>> 
>> 
>> --
>> Thanks and regards,
>> Ajay Bhat
>> 
> 
> 
> 
> -- 
> Thanks and regards,
> Ajay Bhat

Reply via email to