pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Baxter <scott.baxte...@gmail.com>
Subject Re: Pivot vs. ExtJS
Date Sat, 20 Feb 2010 04:58:58 GMT

Thanks for the response.  I submitted a bug report to JIRA.  Please see my
follow-on questions/responses to your responses in-line below:

> 2.  Table Views (ExtJS calls them grids).  Has anyone tried to implement
>> the following with Table Views in Pivot:  Row expanders (ability to expand a
>> row to show more information about a record, for example, a product
>> description in a textarea underneath the row), column filtering (basically
>> turn each the column header into drop down menu that allows you to enter a
>> filter by string, which then limits the results to only the rows that
>> contain the entered value in the selected column.  My guess is that this is
>> best done by removing rows (Objects) from the underlying List, but you'd
>> first need to make an unfiltered "copy" of it so that if the filter was
>> cleared, you could redisplay all the rows without having to re-query the
>> application server.
> Row expanders aren't intrinsically supported in TableView because the rows
> are just data (they're not nested components).  You could hack this together
> by registering a mouse button listener on the table view, determine which
> row and column was clicked on, then setting some property on the row item
> such that the row renderer would pick it up and render a taller row.  You'd
> need to set the "variableRowHeight" style as well in order for this to work.
As for the filtering columns, the best data model for this might be to use a
> FilteredList (in the collections package) as your table data -- the filtered
> list would wrap your primary data model.

Why didn't I think of using a filtered list?  Thank you.  As for the row
expander, I may not have explained it well initially.  A decent analogue to
what I am looking for is demonstrated by the "Summary" function of the grid
used for the message listing here:


My thinking is that spanning multiple grid columns would also be tricky with
the current implementation.  Is there any plan to allow the TableView to
contain components instead of just data in the future?  Because really, I
could come close to accomplishing the same goals by putting the "summary"
data in a tooltip for each column in the row, without having to resort to

>> 3.  Assigning values and display text to drop lists and radio buttons.
>> Let's say I create a ButtonList.  I then create a GetQuery to retrieve some
>> JSON from my application server, which is automatically placed into an
>> ArrayList of HashMaps by the JSON serializer.  So, let's assume that I'm
>> querying a product database, and I'm getting back an array of hashmaps that
>> look like {productID:33443435, productName:'Widget Number 1',
>> productDescription:'Blah blah blah'}, how do I put this into my ButtonList
>> so that the user sees the product name in the drop list, but when it is
>> serialized and sent back to the server, the id is what is actually sent?
>> When I simply setListData(myArrayofHashMaps), the drop list actually
>> displays the results of the toString() method of each hash map, which is not
>> what is desired.  It almost seems like the ButtonList.setListData() method
>> will only accept a one dimensional array of strings.
> It sounds like what you need is a custom renderer for your ListButton that
> is capable of rendering your hashmaps by displaying the product name.  In my
> Pivot apps, I've written a custom "MapRenderer" that takes a JSON path
> property and renders maps by getting the value associated with that key.
> The list button's "data renderer" will render the selected item when the
> dropdown is collapsed, and the "item renderer" will render each item in the
> dropdown when it's expanded.

I think I understand what you're saying here, but I'm not quite sure I
understand how the whole rendering system works well enough yet to make this
happen, but I will attempt this tomorrow and see if I can get it working.  I
think I may have previously confused myself by assuming that Pivot was
converting my Map to a ListItem, and since the ListItem only had a text and
icon property, there was no place to store a separate value property.  Based
on what you said, now I realize (I think) that a ListItem is one of any
object type you can put in a ButtonList, there just happens to already be a
renderer for it.  If you choose to use some other Object type, then the
default renderer will simply use that Object's toString() method to render
each option (which is of course exactly what I saw with my List of Maps).  I
think it's becoming more clear now, but correct me if I'm getting even
farther off base...

As you can probably tell, all of my GUI experience is in HTML and
JavaScript, so those are the terms I tend to think in, which will probably
continue to cause me problems as I try to figure Pivot out.

View raw message