Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Fix bug user got kick out of editor:https://bugzilla.redhat.com/show_…
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Eng committed Nov 25, 2011
1 parent 8b34011 commit 53c9cd3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
Expand Up @@ -47,6 +47,7 @@
import com.google.gwt.gen2.table.client.CellEditor;
import com.google.gwt.gen2.table.override.client.HTMLTable;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Image;
Expand Down Expand Up @@ -543,6 +544,7 @@ protected void acceptFuzzyEdit()
*/
public void cancelEdit()
{
Window.alert("cancelEdit");
// Fire the event
if (!onCancel())
{
Expand Down
Expand Up @@ -85,6 +85,7 @@
import com.google.gwt.gen2.table.event.client.HasPageCountChangeHandlers;
import com.google.gwt.gen2.table.event.client.PageChangeHandler;
import com.google.gwt.gen2.table.event.client.PageCountChangeHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.inject.Inject;

Expand Down Expand Up @@ -255,15 +256,6 @@ private void clearCacheList()
transIdPrevFuzzyCache.clear();
}

private void reloadPage()
{
if (curPage != display.getCurrentPage())
{
display.getTargetCellEditor().cancelEdit();
display.getTableModel().clearCache();
display.reloadPage();
}
}
@Override
protected void onBind()
{
Expand Down Expand Up @@ -356,15 +348,20 @@ public void onTransUnitUpdated(TransUnitUpdatedEvent event)
}
else
{
reloadPage();
if (curPage != display.getCurrentPage())
{
display.getTargetCellEditor().cancelEdit();
display.getTableModel().clearCache();
display.reloadPage();
}
}
}
else
{
display.getTableModel().clearCache();
display.getTargetCellEditor().cancelEdit();
if (inProcessing != null)
{
display.getTableModel().clearCache();
display.getTargetCellEditor().cancelEdit();
if (inProcessing.getAction().getTransUnitId().equals(event.getTransUnit().getId()))
{
int pageNum = inProcessing.getCurrentPage();
Expand All @@ -377,10 +374,6 @@ public void onTransUnitUpdated(TransUnitUpdatedEvent event)
inProcessing = null;
}
}
else
{
reloadPage();
}
}

if (selectedTransUnit != null && selectedTransUnit.getId().equals(event.getTransUnit().getId()))
Expand Down

0 comments on commit 53c9cd3

Please sign in to comment.