An reusable behavior can be archived using the MarkupComponentBorder.
On a side note, why do you want to write commented model values in markup?

On Mon, Mar 28, 2011 at 11:02 AM, Brown, Berlin [GCG-PFS] <
berlin.br...@primerica.com> wrote:

> This is simple code and works, do you think this is a way to add dynamic
> HTML comments that use some Wicket model?
> Or have you done something else?
>
> I am not as familiar with onComponentTagBody.
>
> public class HtmlComment extends Label {
>
>    /**
>     * @see
> org.apache.wicket.Component#onComponentTagBody(org.apache.wicket.markup.
> MarkupStream,
>     *      org.apache.wicket.markup.ComponentTag)
>     */
>    @Override
>    protected void onComponentTagBody(final MarkupStream markupStream,
> final ComponentTag openTag) {
>        replaceComponentTagBody(markupStream, openTag, "<!-- " +
> getDefaultModelObjectAsString() + " -->");
>    }
>
> }
>
> and the output will be in the final HTML output:
>
> <!-- DATA -->
>



-- 
Pedro Henrique Oliveira dos Santos

Reply via email to