Oops, I didn't see this, is this the same thing? java.lang.Object org.apache.wicket.protocol.http.documentvalidation.Comment
-----Original Message----- From: jcar...@carmanconsulting.com [mailto:jcar...@carmanconsulting.com] On Behalf Of James Carman Sent: Monday, March 28, 2011 1:04 PM To: users@wicket.apache.org Subject: Re: HTML comment tag We do this in our application by doing: add(new Label("debugInfo", new DebugInfoModel()).setEscapeModelStrings(false).setRenderBodyOnly(true)); private static class DebugInfoModel extends LoadableDetachableModel<String> { @Override protected String load() { return MessageFormat.format("<!-- \n" + "Java Version: {1}\n" + "Wicket Version: {0}\n" + "Hibernate Version: {2}\n" + "Spring Version: {3}\n" + "Oracle Driver: {4}\n" + "Application Server: {5}\n" + "Operating System: {6}\n" + "-->", WebApplication.get().getFrameworkSettings().getVersion(), System.getProperty("java.vendor") + " " + System.getProperty("java.version"), versionOf(Hibernate.class), versionOf(ApplicationContext.class), versionOf(OracleDriver.class), WebApplication.get().getServletContext().getServerInfo(), System.getProperty("os.version")); } } On Mon, Mar 28, 2011 at 1:00 PM, Brown, Berlin [GCG-PFS] <berlin.br...@primerica.com> wrote: > They may contain information like a build number, version number of > application for debugging purposes that I can see on the rendered HTML > output. > > I was thinking of sub-classing label because the output of a comment > is similar to that kind of markup. > > -----Original Message----- > From: Pedro Santos [mailto:pedros...@gmail.com] > Sent: Monday, March 28, 2011 12:19 PM > To: users@wicket.apache.org > Subject: Re: HTML comment tag > > 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 > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org