You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by kan <ka...@gmail.com> on 2008/08/07 16:53:14 UTC

How to include some parameters in template? Custom tag? Component?

I have some page template which I want to include some blocks which
look same but some minor differences. Something like this
...
<body>
Please try our <my:productInfo
category="food"><my:id>apple</my:id></my:productInfo> and play on our
cool <my:productInfo
category="hardware"><my:id>apple</my:id></my:productInfo> computers.
</body>
....

So, after rendering my:productInfo could be replaced by some html
which may contain given product description, image, link to buy, etc.

I cannot to use <span wicket:id="food-apple"> because it less obvious
and cannot give me structured parameters (like category, id) and I
have to add each wicket:id in .java-file, which could be annoying to
change two places.

I found wicket:component tag, but it's experimental and not recommended to use.

I think to implement own IComponentResolver to handle my:productInfo
tags. Is it the best way? Or is there other way to do it?

-- 
WBR, kan.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org