Friday, September 6, 2013

Re: Is there any way to have event handlers for a cell in a CellTable that isn't in a column?

Actually, I'm using my own parallel to ActionCell that copies most of it's code and adds a few things.  I couldn't extend ActionCell directly due to something with private or package access, if I recall correctly. I've used that same cell in columns and it's worked OK.  (Sorry about the red herring with ButtonCell - I was speaking generally about a cell with a button, and forgot that there actually was a ButtonCell.)

I've added a CellPreviewHandler to the table to print a console message when invoked, and also print a console line from onBrowserEvent in my ActionCell, and neither of them triggers when I click my buttons.  Looking though the code for several of the API classes involved, it seems that the event path goes through the columns. (As an aside, I'm not all that fond of using an updater when there's nothing to update - somewhat the same line of reasoning that keeps me from just adding a column. But I've seen that approach taken in a few examples, like the CustomDataGrid, although that also has the associated cells in a column.)

On Friday, September 6, 2013 6:57:39 PM UTC-4, Thomas Broyer wrote:
I think you could use an ActionCell instead of ButtonCell: because you're in the footer, the cell/column doesn't correspond to a field in a row, so FieldUpdater wouldn't fit.

On Saturday, September 7, 2013 12:50:49 AM UTC+2, Steve C wrote:
I'd like to put a set of button cells into a composite cell in a celltable footer that uses a custom footer builder to create a row with a cell that spans most of the table columns.  But, I don't get any click events on those buttons.  If I put the same type of cell into a column, it works fine.

The last time I had a need like this, I created a dummy column, gave it a width of 1px, and added it to the table.  But I don't really like having the columns not map completely to my row objects, and having to fake my way through the getValue, etc.

It seems like it ought to be possible, since CellTree doesn't use the column concept, but I haven't been able to make my way though it's or AbstractCellTable's code to figure out how to make the events be recognized.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment