is it possible to use the wicket:id of some element/component for CSS styling instead of "class"?
for example:
.tooltipster-arrow span, .column-shifter {
display: block;
width: 0;
height: 0;
position: absolute;
}
and i have in html code something like:
<body>
<wicket:panel>
<div wicket:id="column-shifter"></div>
</wicket:panel>
</body>
Thanks!
This is not possible, as the browser will look for the class attribute when processing CSS. Furthermore, Wicket markup is removed in deployment mode, so the wicket:id attribute should not be present in the final HTML (as it would reveal internal data of your application).
You could use an AttributeModifier to add the ID of your component as class attribute:
myComponent.add(new AttributeModifier("class", myComponent.getId()));
You can just add a class="column-shifter" to the markup, like this:
<div wicket:id="column-shifter" class="column-shifter"></div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With