Hi,

Sorry for asking the same question again, but I can't seem to find a
definitive answer on this one. I've read through the documentation and even
mailing lists but can't seem to get it to work.

I'm relatively new to Tapestry and loving it so far. The only trouble I'm
having is when I try to override the default CSS, for client side
validation errors in particular.

I'm basically trying to change the client side validation bubbles that pop
up when validation fails.

The documentation says (http://tapestry.apache.org/css.html):

"Tapestry includes a built-in style sheet, default.css, in all HTML
documents (documents that have an outer <html> element and a nested <head>
element). The default.css style sheet is always ordered *first* ... any
additional style sheets will come after. This allows you to override
Tapestry's default styles with your own." So, I added the following CSS in
my site.css:

.t-error-popup span    {

       background:url('../images/error-bevel-left-blue.png') no-repeat;

}

And in my laout component, added the following import:

import org.apache.tapestry5.annotations.Import;



@Import(stylesheet="context:css/site.css")
public class MainPageLayout {

}
However, this did not affect the popup. When I inspected the element in
Safari, my custom URL was crossed out, suggesting it was overridden by the
default CSS. Not sure if I'm missing anything here?

Other documentation on the web seem to suggest either overriding or perhaps
even writing a custom ValidationDecorator. But that doesn't address the
client side CSS issue. The only solution that might work seems to be
writing/overriding the default java script (Tapestry.js) as hinted in this
solution:
http://jumpstart.doublenegative.com.au/jumpstart/examples/input/novalidationbubbles

I also tried using jQuery and seems like I might just be able to get it to
work, but I'd like to stick to out of the box functionality and only use
another library if I really have to.

I would like to know what is the "correct" way of doing it keeping
performance and more importantly, version 5.4 with completely re engineered
javascript support in mind.

Thank you in advance.


Best Regards,
Sanket

Reply via email to