Permalink
Browse files

[InMethod Grid] final Compilation fixes

manually "merged" the JavaScript Precondition fix to AbstractGrid.
Updated necessary imports.
removed no longer used getAjaxCallDecorator() methods.
  • Loading branch information...
=Tom B
=Tom B committed Mar 15, 2012
1 parent db68867 commit 1d42400e6a251e1c533d8fda098cfa5d05c68f7a
@@ -1,24 +1,14 @@
package com.inmethod.grid.examples;
import org.apache.wicket.Page;
+import org.apache.wicket.core.request.mapper.MountedMapper;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.protocol.http.WebApplication;
import org.apache.wicket.request.Request;
import org.apache.wicket.request.Response;
-import org.apache.wicket.request.mapper.MountedMapper;
-import com.inmethod.grid.examples.pages.datagrid.DataGridColumnPropertiesPage;
-import com.inmethod.grid.examples.pages.datagrid.DataGridSelectionPage;
-import com.inmethod.grid.examples.pages.datagrid.DataGridWithUnknownItemCount;
-import com.inmethod.grid.examples.pages.datagrid.EditableDataGridPage;
-import com.inmethod.grid.examples.pages.datagrid.EditableDataGridWithSelectionPage;
-import com.inmethod.grid.examples.pages.datagrid.SimpleDataGridPage;
-import com.inmethod.grid.examples.pages.datagrid.VerticalScrollingDataGridPage;
-import com.inmethod.grid.examples.pages.treegrid.EditableTreeGridPage;
-import com.inmethod.grid.examples.pages.treegrid.SimpleTreeGridPage;
-import com.inmethod.grid.examples.pages.treegrid.TreeGridColumnPropertiesPage;
-import com.inmethod.grid.examples.pages.treegrid.TreeGridSelectionPage;
-import com.inmethod.grid.examples.pages.treegrid.VerticalScrollingTreeGridPage;
+import com.inmethod.grid.examples.pages.datagrid.*;
+import com.inmethod.grid.examples.pages.treegrid.*;
/**
*
@@ -16,7 +16,7 @@
*/
package com.inmethod.grid.examples.contact;
-import org.apache.wicket.IClusterable;
+import org.apache.wicket.util.io.IClusterable;
/**
* domain object for demonstrations.
@@ -2,8 +2,6 @@
import org.apache.wicket.Component;
import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.ajax.IAjaxCallDecorator;
-import org.apache.wicket.ajax.calldecorator.CancelEventIfNoAjaxDecorator;
import org.apache.wicket.ajax.form.AjaxFormSubmitBehavior;
import org.apache.wicket.markup.ComponentTag;
import org.apache.wicket.markup.html.WebMarkupContainer;
@@ -191,12 +189,6 @@ protected CharSequence getPreconditionScript()
return "window.setTimeout(function(){this.checked=!this.checked}.bind(this),0);" +
super.getPreconditionScript();
}
-
- @Override
- protected IAjaxCallDecorator getAjaxCallDecorator()
- {
- return new CancelEventIfNoAjaxDecorator();
- }
});
}
@@ -348,12 +340,6 @@ protected CharSequence getPreconditionScript()
return "window.setTimeout(function(){this.checked=!this.checked}.bind(this),0);" +
super.getPreconditionScript();
}
-
- @Override
- protected IAjaxCallDecorator getAjaxCallDecorator()
- {
- return new CancelEventIfNoAjaxDecorator();
- }
});
}
@@ -9,9 +9,8 @@
import org.apache.wicket.MetaDataKey;
import org.apache.wicket.ajax.AbstractDefaultAjaxBehavior;
import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.ajax.IAjaxCallDecorator;
+import org.apache.wicket.ajax.attributes.AjaxCallListener;
import org.apache.wicket.ajax.attributes.AjaxRequestAttributes;
-import org.apache.wicket.ajax.calldecorator.AjaxCallDecorator;
import org.apache.wicket.ajax.form.AjaxFormSubmitBehavior;
import org.apache.wicket.behavior.Behavior;
import org.apache.wicket.markup.ComponentTag;
@@ -835,8 +834,9 @@ protected void updateAjaxAttributes(AjaxRequestAttributes attributes)
attributes.getDynamicExtraParameters().add(columnParameter);
CharSequence precon = "return InMethod.XTable.canSelectRow(attrs.event);";
- JavaScriptPrecondition precondition = new JavaScriptPrecondition(precon);
- attributes.getPreconditions().add(precondition);
+ AjaxCallListener ajaxCallListener = new AjaxCallListener();
+ ajaxCallListener.onPrecondition(precon);
+ attributes.getAjaxCallListeners().add(ajaxCallListener);
}
@Override
@@ -845,23 +845,6 @@ public CharSequence getCallbackUrl()
return getCallbackFunction("col");
}
- @Override
- protected IAjaxCallDecorator getAjaxCallDecorator()
- {
- return new AjaxCallDecorator()
- {
- private static final long serialVersionUID = 1L;
-
- @Override
- public CharSequence decorateScript(Component c, CharSequence script)
- {
- return super.decorateScript(c,
- "if (InMethod.XTable.canSelectRow(event)) { " +
- "var col=(this.imxtClickedColumn || ''); this.imxtClickedColumn='';" +
- script + " }");
- }
- };
- }
});
}
@@ -2,8 +2,6 @@
import org.apache.wicket.ajax.AjaxEventBehavior;
import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.ajax.IAjaxCallDecorator;
-import org.apache.wicket.ajax.calldecorator.CancelEventIfNoAjaxDecorator;
import org.apache.wicket.markup.ComponentTag;
import org.apache.wicket.markup.html.panel.Panel;
@@ -59,12 +57,6 @@ protected void onEvent(AjaxRequestTarget target)
sortStateChanged(target);
}
-
- @Override
- protected IAjaxCallDecorator getAjaxCallDecorator()
- {
- return new CancelEventIfNoAjaxDecorator();
- }
});
}

0 comments on commit 1d42400

Please sign in to comment.