On Mon, Mar 21, 2022 at 4:24 AM Ben Weidig <[email protected]> wrote:
> Hi Chris,
>
Hello, Chris and Ben!
> - Allow an anchor at the end of the String, and set it
> PageNameComponentEventResultProcessor
>
You mean overriding the contribution to the ComponentEventResultProcessor
for the String.class key with your own alternate
PageNameComponentEventResultProcessor-inspired implementation? Yes, that
would work. Not something I'd do (I prefer having another return type and
ComponentEventResultProcessor, but it's definitely a valid approach.
> - Use an intermediate type holding all the options available for a Link
> with a fluent API instead, e.g.
> LinkParams.page("index").anchor("footer").addQueryParameter("foo",
> "bar").activationContext(myContext1, myContext2)
>
IMHO, it's too close to what Link and PageRenderLinkSource already does, so
I wouldn't do that.
> The first option would be the easiest to implement because it only affects
> a single class (if I'm correct).
>
I believe you're correct indeed. :)
> The second option would require a new ComponentEventResultProcessor and the
> holder type.
>
That's my recommended approach. Or just use PageRenderLinkSource and Link
if this would be only used in a few places.
--
Thiago