Re: Grid component customization

"Thiago H. de Paula Figueiredo" <[email protected]>
Newsgroups gmane.comp.java.tapestry.user
Message-ID <CAE_88GavAJEpV7c+5awut6_eV9xitFj5128dppGfDAnjZ_JnSw@mail.gmail.com>
On Tue, Nov 28, 2017 at 6:33 AM, Erich Gormann <[email protected]> wrote:

> Dear all,
>

Hi!


> I wanted to customize the GridColumns component, which is embedded inside
> the Grid component, by trying different approaches.
>
> Finally I failed, because it was neither possible by a request filter
> replacing the GridColumns component at runtime with my customized one,


This wasn't expected to work, but I'm curious in how you tried to do it. :)


> nor did it work to use an own template for the Grid component pointing to
> my customized version of GridColumns.
>
> What is the best way to do this? The GridColumns component is a private
> component inside the Grid and I wonder how to replace it.
>

Contribute to the ComponentOverride distributed configuration, which is a
Map<Class, Class>, the key being the component or page or mixin class to be
replaced, the value being the replacement.

Here's an example from Tapestry's test suite:

@Contribute(ComponentReplacer.class)
public static void
overridePageAndComponentAndMixin(MappedConfiguration<Class, Class>
configuration) {
    configuration.add(OverridenPage.class, OverridePage.class);
    configuration.add(OverridenComponent.class, OverrideComponent.class);
    configuration.add(OverridenMixin.class, OverrideMixin.class);
}

-- 
Thiago
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.