Skip to content

Commit

Permalink
[datatable-autocomplete] Enable custom CSS resources for the overlay …
Browse files Browse the repository at this point in the history
…and table

The CSS classes on the rendered markup remains the same but now we support
custom CSS resources being provided.

This was added because in my work application the default style against the
root elements impacted the overlay panel.

With this fix I can write a custom stylesheet to cancel out the impact of the
main style.
  • Loading branch information
mocleiri committed Jul 13, 2011
1 parent 3f515d6 commit ca2d098
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
import org.wicketstuff.datatable_autocomplete.trie.TrieNodeInspectingVisitor;

/**
* @author mocleirihe boot class path for the rt.jar and then loading X methods where X is large.
* @author mocleiri
*
* the boot class path for the rt.jar and then loading X methods where X is large.
*
*/
public final class TrieBuilder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ public class AutoCompletingPanel<T> extends Panel {

private boolean initialRenderMode = false;

private static final ResourceReference CSS = new CompressedResourceReference(
public static final ResourceReference OVERLAY_CSS = new CompressedResourceReference(
AutoCompletingPanel.class, "dta_auto_complete_overlay.css");

private static final ResourceReference TABLE_CSS = new CompressedResourceReference(
public static final ResourceReference TABLE_CSS = new CompressedResourceReference(
AutoCompletingPanel.class, "dta_autocomplete_table.css");

private Label theLabel;
Expand All @@ -76,7 +76,7 @@ public AutoCompletingPanel(String id, IModel<String> fieldStringModel,
ITableRowSelectionHandler<T> rowSelectionHandler, IAutocompleteControlPanelProvider controlPanelProvider,
IAutocompleteRenderingHints renderingHints) {

this (id, CSS, TABLE_CSS, fieldStringModel, columns, aliasDataProvider, rowSelectionHandler, controlPanelProvider, renderingHints);
this (id, OVERLAY_CSS, TABLE_CSS, fieldStringModel, columns, aliasDataProvider, rowSelectionHandler, controlPanelProvider, renderingHints);

}
public AutoCompletingPanel(String id, ResourceReference panelCSS, ResourceReference tableCSS, IModel<String> fieldStringModel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.apache.wicket.markup.ComponentTag;
import org.apache.wicket.markup.MarkupStream;
import org.apache.wicket.markup.repeater.Item;
import org.apache.wicket.markup.repeater.OddEvenItem;
import org.apache.wicket.markup.repeater.ReuseIfModelsEqualStrategy;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
Expand Down Expand Up @@ -156,7 +157,7 @@ protected void onComponentTagBody(MarkupStream markupStream,
@Override
protected Item<T> newRowItem(String id, int index, IModel<T> model) {

Item<T> rowItem = super.newRowItem(id, index, model);
Item<T> rowItem = new OddEvenItem<T>(id, index, model);

if (itemModifier != null) {

Expand Down

0 comments on commit ca2d098

Please sign in to comment.