Permalink
Browse files

[inmethod-grid] Update to upstream - JavaScriptPrecondition is removed

  • Loading branch information...
1 parent 61e0f9e commit 1e652b1ae7b74ad22683fa95ad70a723d4e603b6 @martin-g martin-g committed Mar 13, 2012
@@ -6,13 +6,19 @@
import javax.swing.tree.TreeModel;
+import com.inmethod.grid.IGridColumn;
+import com.inmethod.grid.IGridSortState;
+import com.inmethod.grid.SizeUnit;
+import com.inmethod.grid.datagrid.DataGrid;
+import com.inmethod.grid.toolbar.AbstractHeaderToolbar;
+import com.inmethod.grid.toolbar.AbstractToolbar;
+import com.inmethod.grid.treegrid.TreeGrid;
import org.apache.wicket.Component;
import org.apache.wicket.MetaDataKey;
import org.apache.wicket.ajax.AbstractDefaultAjaxBehavior;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.attributes.AjaxCallListener;
import org.apache.wicket.ajax.attributes.AjaxRequestAttributes;
-import org.apache.wicket.ajax.attributes.JavaScriptPrecondition;
import org.apache.wicket.ajax.form.AjaxFormSubmitBehavior;
import org.apache.wicket.behavior.Behavior;
import org.apache.wicket.markup.ComponentTag;
@@ -36,14 +42,6 @@
import org.apache.wicket.util.visit.IVisit;
import org.apache.wicket.util.visit.IVisitor;
-import com.inmethod.grid.IGridColumn;
-import com.inmethod.grid.IGridSortState;
-import com.inmethod.grid.SizeUnit;
-import com.inmethod.grid.datagrid.DataGrid;
-import com.inmethod.grid.toolbar.AbstractHeaderToolbar;
-import com.inmethod.grid.toolbar.AbstractToolbar;
-import com.inmethod.grid.treegrid.TreeGrid;
-
/**
* Provides common functionality for {@link DataGrid} and {@link TreeGrid}.
*
@@ -836,9 +834,10 @@ protected void updateAjaxAttributes(AjaxRequestAttributes attributes)
CharSequence columnParameter = "return {'column': Wicket.$(attrs.c).imxtClickedColumn}";
attributes.getDynamicExtraParameters().add(columnParameter);
- CharSequence precon = "return InMethod.XTable.canSelectRow(attrs.event);";
- JavaScriptPrecondition precondition = new JavaScriptPrecondition(precon);
- attributes.getPreconditions().add(precondition);
+ CharSequence precondition = "return InMethod.XTable.canSelectRow(attrs.event);";
+ AjaxCallListener ajaxCallListener = new AjaxCallListener();
+ ajaxCallListener.onPrecondition(precondition);
+ attributes.getAjaxCallListeners().add(ajaxCallListener);
}
@Override

0 comments on commit 1e652b1

Please sign in to comment.