Sunday, March 6, 2011

Re: SelectionCell does not clear when cellTable reloaded

Well for anyone who's interested, after a lot more googling, I found
the problem. Apparently SelectionCell has an itty bitty problem. This
guy detailed it:

http://code.google.com/p/google-web-toolkit/issues/detail?id=5598

I basically copied the source code for SelectionCell, made my own
MySelectionCell and made the very small change to the render method
the above thread mentions (shown below):

Workaround if you have one:
Change SelectionCell.render(String value, Object key, SafeHtmlBuilder
sb)

from if (viewData != null && viewData.equals(value)) {...

to

if (viewData != null && !viewData.equals(value)) {...


On Mar 6, 1:44 pm, Josh K <kendrick.j...@gmail.com> wrote:
> I've got a layout with 2 cell tables in 2 different composites and you
> use a menubar to switch between them. Each table has different rows
> and the rows "move" between the tables by changing items in a
> selection cell.
>
> On one page, you assign a ride to a car by picking a car number out of
> a selection cell, on the other page you move the ride back by
> unassigning it.
>
> My problem is after I pick a car for a ride, I make an asynchronous
> call and update the database, remove the ride from the list backing
> the celltable, and refresh the celltable. The ride moves to the next
> page.
>
> If I go to that next page where it has appeared and unassign it, the
> same behavior happens (set ride to unassigned, make a call, remove
> from list, redraw table)
>
> When I go back to the first page to assign the car, instead of having
> a blank (for unassigned), the selection cell has the value I first
> selected! It's like it remembered it for some reason?
>
> I'm finding this really weird because the database is updated and the
> data I'm getting back is correct and if I refresh the application, the
> selection cell has the correct information.
>
> Is there something I need to be doing? Like clearing the selection
> cell after selection? I just don't get why the cell isn't cleared!

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate