Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can we use the Wicket:id to make CSS?

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!

like image 601
ZelelB Avatar asked Dec 06 '25 08:12

ZelelB


2 Answers

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()));

like image 172
phm Avatar answered Dec 08 '25 22:12

phm


You can just add a class="column-shifter" to the markup, like this:

<div wicket:id="column-shifter" class="column-shifter"></div>
like image 44
thg Avatar answered Dec 08 '25 22:12

thg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!