The HTML documents that Wicket uses as templates can contain several special attributes and tags
Using Wicket Tags
To make most HTML editors not complain about using wicket tags and attributes, you need to declare the namespace:
<html xmlns:wicket="http://wicket.sourceforge.net/">
By the way. This is as well how you may change the namespace Wicket will apply for this file. E.g. xmlns:wcn="http://wicket.sourceforge.net" will change it to "wcn" for this markup file only. Without any xmlns declaration the default is "wicket". xmlns:wicket and xmlns:wcn will work as well, as long as you don't have any additional namespace declarations.
What you can not do (but is possible with XHTML) that you change the namespace within the very same markup file per tag. Wicket does allow it only with the html tag.
Wicket Attributes
- wicket:id="ID_HERE" - Used on any tag that we want Wicket to replace.
Example:
<span wicket:id="hellotext">Hello World</span>
Wicket Tags
- <wicket:link> - Support for wicket autolink functionality. Normally, you need to add a model (for example, a BookmarkablePageLink) for each link that Wicket manages. Using the wicket:link tag will automatically do this in the background for you.
Example:
<wicket:link><a href="Index.html">Link to wicket document Index.html</a></wicket:link>
- <wicket:panel> - The wicket:panel tag surrounds a component. This lets you wrap the component with HTML and BODY tags (so it can be displyed in a browser) but, when you include it, only the content inside the wicket:panel tag is actually included.
Example: <html xmlns:wicket="http://wicket.sourceforge.net/"> <body> <wicket:panel> PANEL CONTENT HERE </wicket:panel> </body> </html>
- <wicket:border> and <wicket:body> - (I think this is the same as wicket:panel, except a border is drawn by default; verify).
- <wicket:extend> - Extend the markup of the superclass with this content.
- <wicket:child> - Wicket will remove this content with the markup of the derived component (see <wicket:extend>)
- <wicket:remove> - Wicket will remove this content in the final markup. This is useful for when you want your web designer to be able to show repeated content when they're working on it, but you want to generate at content using a ListView (or other loop).
- <wicket:head> - Used for header contributions. Using this, panels can add header sections to the pages they are place on. For instance:
<wicket:head> <script type="text/javascript"> function foo() { alert("Hello, World!"); } </script> </wicket:head> <wicket:panel> <a href="#" onclick="foo();">Click me!</a> </wicket:panel>
- <wicket:component> - Creates a Wicket component on the fly. Needs a class attribute. Though this has been in wicket for a long time, it is still kind of an unsupported feature, as most of the core developers believe that this may lead to misuse of the framework. Before heavily relying on this feature, you might want to contact the user list to discuss alternative strategies.