That was the way brought me to my trouble. In IE the parent selector was ignored.
{.sidebar * .facet} definition was nicely rendered in FF but ignored in IE.
The solution for this non-wicket problem was to add the doc-type to my page html.
Now i get the results i've expected.

Thanks
Mike

you can use css child selectors to override the layout when they are
inside a specific div.

-igor


On Tue, May 17, 2011 at 4:49 AM, Mike Mander<wicket-m...@gmx.de>  wrote:
Hi,

i use a component twice. Layout of first component has to be horizontal of
second vertical (MainMenu, Sidebar).
Because the component itself provides the layout (horizontal version) i run
into trouble with vertical layout.
My solution would be to add a prefix to vertical layout component and it's
children. So i could modify the layout
by css class overriding. But strangely my solution is not working (= no
prefix in any component child).

Modifier for css class
import org.apache.wicket.AttributeModifier;
import org.apache.wicket.model.Model;

public class FirstCssClassDecorator extends AttributeModifier {

    public FirstCssClassDecorator(String prefix) {
        super("class", Model.<String>  of(prefix));
    }

    @Override
    protected String newValue(String currentValue, String replacementValue) {
      // Here add "sidebar-" to current css class
      return replacementValue.concat(currentValue);
    }
}

Visitor for appending FirstCssClassDecorator to all children
import org.apache.wicket.Component;
import org.apache.wicket.Component.IVisitor;
import org.apache.wicket.MarkupContainer;

public class FirstCssClassDecorationVisitor implements IVisitor<Component>  {

    private final String _prefix;

    public FirstCssClassDecorationVisitor(String prefix) {
        _prefix = prefix;
    }

    @Override
    public Object component(Component component) {
        if (component instanceof MarkupContainer) {
            ((MarkupContainer) component).visitChildren(new
FirstCssClassDecorationVisitor(_prefix));
        }
        component.add(new FirstCssClassDecorator(String.valueOf(_prefix)));
        return CONTINUE_TRAVERSAL;
    }
}

I've added the visitor
    visitChildren(new FirstCssClassDecorationVisitor("sidebar-"));
+ in sidebar Constructor
+ in sidebar onConfigure
+ in Page Constructor

But all did the same - no sidebar-xyz class in Markup.

What am i missing here?
Thanks
Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to