Try this:

writer.getElement().addClassName("some_class");

>From the Element javadoc:
    /**
     * Adds one or more CSS class names to the "class" attribute. No
check for duplicates is made. Note that CSS class
     * names are case insensitive on the client.
     *
     * @param className
     *            one or more CSS class names
     * @return the element for further configuration
     */
    public Element addClassName(String... className)

Josh

On Thu, Jan 27, 2011 at 7:05 PM, Donny Nadolny <donny.nado...@gmail.com> wrote:
> I'm trying to integrate a 3rd party javascript library in to Tapestry via a
> mixin. The way it works is that the library adds behavior to fields that
> have a certain css class. All the mixin needs to do is @Import the proper js
> & css, and add a css class to the field.
>
> I tried adding it with:
>    void beginRender(MarkupWriter writer) {
>        writer.attributes("class", "some_class");
>    }
>
> This works if the field doesn't have a class already, but if it does, then
> the mixin doesn't add the class (as specified by the javadoc for
> writer.attributes - if there's already a value, then the value you pass is
> ignored).
>
> Is there any way to append to an attribute or do I just have to always
> remember to add the css class when using that mixin?
>
> Thanks,
> Donny
>

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

Reply via email to