<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>wicket praxis &#187; Technologie</title>
	<atom:link href="http://www.wicket-praxis.de/blog/category/technologie/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.wicket-praxis.de/blog</link>
	<description>erfahrungen mit wicket aus dem projektalltag</description>
	<lastBuildDate>Fri, 26 Aug 2011 11:14:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Wicket &#8211; Komponentenübersicht (1.4.17)</title>
		<link>http://www.wicket-praxis.de/blog/2011/05/15/wicket-komponentenubersicht-1-4-17/</link>
		<comments>http://www.wicket-praxis.de/blog/2011/05/15/wicket-komponentenubersicht-1-4-17/#comments</comments>
		<pubDate>Sun, 15 May 2011 08:48:50 +0000</pubDate>
		<dc:creator>michael</dc:creator>
				<category><![CDATA[Technologie]]></category>
		<category><![CDATA[Wicket]]></category>

		<guid isPermaLink="false">http://www.wicket-praxis.de/blog/?p=298</guid>
		<description><![CDATA[Seit Wicket 1.4.1 haben sich bei den Komponenten und Interfaces ein paar Anpassungen ergeben, so dass ich die Komponentenübersichten aktualisiert habe. Folgende Diagramme beziehen sich auf die Version 1.4.17. Share and Enjoy: Andere BeiträgeNo Related Post]]></description>
			<content:encoded><![CDATA[<p>Seit Wicket 1.4.1 haben sich bei den Komponenten und Interfaces ein paar Anpassungen ergeben, so dass ich die Komponentenübersichten aktualisiert habe. Folgende Diagramme beziehen sich auf die Version 1.4.17.</p>
<div id="attachment_161" class="wp-caption aligncenter" style="width: 460px"><a href="http://www.wicket-praxis.de/blog/wp-content/uploads/2011/05/wicket-comp.gv_.jpg"><img class="size-medium wp-image-161" title="wicket-comp.gv" src="http://www.wicket-praxis.de/blog/wp-content/uploads/2011/05/wicket-comp.gv_-450x367.jpg" alt="Wicket Kompontenten - Basis" width="450" height="367" /></a>
<p class="wp-caption-text">Wicket Kompontenten &#8211; Basis</p>
</div>
<div id="attachment_162" class="wp-caption aligncenter" style="width: 420px"><a href="http://www.wicket-praxis.de/blog/wp-content/uploads/2011/05/wicket-comp-ext.gv_.jpg"><img class="size-medium wp-image-162" title="wicket-comp-ext.gv" src="http://www.wicket-praxis.de/blog/wp-content/uploads/2011/05/wicket-comp-ext.gv_-410x450.jpg" alt="Wicket Komponenten inklusive Extensions" width="410" height="450" /></a>
<p class="wp-caption-text">Wicket Komponenten inklusive Extensions</p>
</div>
<div id="attachment_164" class="wp-caption aligncenter" style="width: 460px"><a href="http://www.wicket-praxis.de/blog/wp-content/uploads/2011/05/wicket-model.gv_.jpg"><img class="size-medium wp-image-164" title="wicket-model.gv" src="http://www.wicket-praxis.de/blog/wp-content/uploads/2011/05/wicket-model.gv_-450x382.jpg" alt="Wicket Modelle" width="450" height="382" /></a>
<p class="wp-caption-text">Wicket Modelle</p>
</div>
<div id="attachment_160" class="wp-caption aligncenter" style="width: 460px"><a href="http://www.wicket-praxis.de/blog/wp-content/uploads/2011/05/wicket-behavior.gv_.jpg"><img class="size-medium wp-image-160" title="wicket-behavior.gv" src="http://www.wicket-praxis.de/blog/wp-content/uploads/2011/05/wicket-behavior.gv_-450x95.jpg" alt="Wicket Behavior" width="450" height="95" /></a>
<p class="wp-caption-text">Wicket Behavior</p>
</div>
<div id="attachment_163" class="wp-caption aligncenter" style="width: 460px"><a href="http://www.wicket-praxis.de/blog/wp-content/uploads/2011/05/wicket-listener.gv_.jpg"><img class="size-medium wp-image-163" title="wicket-listener.gv" src="http://www.wicket-praxis.de/blog/wp-content/uploads/2011/05/wicket-listener.gv_-450x205.jpg" alt="Wicket Listener" width="450" height="205" /></a>
<p class="wp-caption-text">Wicket Listener</p>
</div>
<div id="attachment_165" class="wp-caption aligncenter" style="width: 460px"><a href="http://www.wicket-praxis.de/blog/wp-content/uploads/2011/05/wicket-requestTarget.gv_.jpg"><img class="size-medium wp-image-165" title="wicket-requestTarget.gv" src="http://www.wicket-praxis.de/blog/wp-content/uploads/2011/05/wicket-requestTarget.gv_-450x180.jpg" alt="Wicket RequestTarget" width="450" height="180" /></a>
<p class="wp-caption-text">Wicket RequestTarget</p>
</div>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2011%2F05%2F15%2Fwicket-komponentenubersicht-1-4-17%2F&amp;title=Wicket%20-%20Komponenten%C3%BCbersicht%20%281.4.17%29&amp;bodytext=Seit%20Wicket%201.4.1%20haben%20sich%20bei%20den%20Komponenten%20und%20Interfaces%20ein%20paar%20Anpassungen%20ergeben%2C%20so%20dass%20ich%20die%20Komponenten%C3%BCbersichten%20aktualisiert%20habe.%20Folgende%20Diagramme%20beziehen%20sich%20auf%20die%20Version%201.4.17.%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A" title="Digg"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2011%2F05%2F15%2Fwicket-komponentenubersicht-1-4-17%2F" title="Sphinn"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2011%2F05%2F15%2Fwicket-komponentenubersicht-1-4-17%2F&amp;title=Wicket%20-%20Komponenten%C3%BCbersicht%20%281.4.17%29&amp;notes=Seit%20Wicket%201.4.1%20haben%20sich%20bei%20den%20Komponenten%20und%20Interfaces%20ein%20paar%20Anpassungen%20ergeben%2C%20so%20dass%20ich%20die%20Komponenten%C3%BCbersichten%20aktualisiert%20habe.%20Folgende%20Diagramme%20beziehen%20sich%20auf%20die%20Version%201.4.17.%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A" title="del.icio.us"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2011%2F05%2F15%2Fwicket-komponentenubersicht-1-4-17%2F&amp;t=Wicket%20-%20Komponenten%C3%BCbersicht%20%281.4.17%29" title="Facebook"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2011%2F05%2F15%2Fwicket-komponentenubersicht-1-4-17%2F&amp;title=Wicket%20-%20Komponenten%C3%BCbersicht%20%281.4.17%29" title="Mixx"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2011%2F05%2F15%2Fwicket-komponentenubersicht-1-4-17%2F&amp;title=Wicket%20-%20Komponenten%C3%BCbersicht%20%281.4.17%29&amp;annotation=Seit%20Wicket%201.4.1%20haben%20sich%20bei%20den%20Komponenten%20und%20Interfaces%20ein%20paar%20Anpassungen%20ergeben%2C%20so%20dass%20ich%20die%20Komponenten%C3%BCbersichten%20aktualisiert%20habe.%20Folgende%20Diagramme%20beziehen%20sich%20auf%20die%20Version%201.4.17.%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A" title="Google Bookmarks"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
</ul>
</div>
<div id="vgwpixel"></div><h3  class="related_post_title">Andere Beiträge</h3><ul class="related_post"><li>No Related Post</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wicket-praxis.de/blog/2011/05/15/wicket-komponentenubersicht-1-4-17/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wicket Eclipse Plugin &#8211;  qwickie</title>
		<link>http://www.wicket-praxis.de/blog/2010/04/14/wicket-eclipse-plugin-qwickie/</link>
		<comments>http://www.wicket-praxis.de/blog/2010/04/14/wicket-eclipse-plugin-qwickie/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 06:28:47 +0000</pubDate>
		<dc:creator>michael</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[Technologie]]></category>
		<category><![CDATA[Wicket]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://www.wicket-praxis.de/blog/?p=267</guid>
		<description><![CDATA[Zufällig bin ich auf ein Wicket-Eclipse-Plugin gestoßen, dass im täglichen Umgang mit Wicket-basierten Projekten zu einer nicht unwesentlichen Arbeitserleichterung führt. In Anbetracht des frühen Entwicklungsstadiums (Version 0.1) ist das bereits eine reife Leistung. Was macht das Plugin? Mit dem Plugin ist es möglich, durch den Klick auf die Wicket-ID einer Komponente zwischen Java-Klasse und zugehörigen [...]]]></description>
			<content:encoded><![CDATA[<p>Zufällig bin ich auf ein <a href="http://code.google.com/p/qwickie/" target="_blank">Wicket-Eclipse-Plugin</a> gestoßen, dass im täglichen Umgang mit Wicket-basierten Projekten zu einer nicht unwesentlichen Arbeitserleichterung führt. In Anbetracht des frühen Entwicklungsstadiums (Version 0.1) ist das bereits eine reife Leistung.</p>
<p><strong>Was macht das Plugin?</strong></p>
<p>Mit dem Plugin ist es möglich, durch den Klick auf die Wicket-ID einer Komponente zwischen Java-Klasse und zugehörigen Markup wechseln zu können. Dabei springt der Cursor gleich an die richtige Stelle. Kurz: Das ist genau das, was ich am häufigsten benötige.</p>
<p>Bei der Installation sollte man zwei Dinge beachten: 1. Das Plugin befindet sich wirklich noch in einem sehr frühen Stadium, so dass Fehler auftreten. Man muss also abwägen, ob der Vorteil die Nachteile aufwiegt. 2. Die Hinweise zur Installation und zur Handhabung auf der Seite sollte man beachten.</p>
<p>Diese Plugin sollte man im Auge behalten. Sofern es meine Zeit erlaubt, werde ich versuchen, an diesem Plugin mitzuentwickeln. </p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2010%2F04%2F14%2Fwicket-eclipse-plugin-qwickie%2F&amp;title=Wicket%20Eclipse%20Plugin%20-%20%20qwickie&amp;bodytext=Zuf%C3%A4llig%20bin%20ich%20auf%20ein%20Wicket-Eclipse-Plugin%20gesto%C3%9Fen%2C%20dass%20im%20t%C3%A4glichen%20Umgang%20mit%20Wicket-basierten%20Projekten%20zu%20einer%20nicht%20unwesentlichen%20Arbeitserleichterung%20f%C3%BChrt.%20In%20Anbetracht%20des%20fr%C3%BChen%20Entwicklungsstadiums%20%28Version%200.1%29%20ist%20das%20bereit" title="Digg"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2010%2F04%2F14%2Fwicket-eclipse-plugin-qwickie%2F" title="Sphinn"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2010%2F04%2F14%2Fwicket-eclipse-plugin-qwickie%2F&amp;title=Wicket%20Eclipse%20Plugin%20-%20%20qwickie&amp;notes=Zuf%C3%A4llig%20bin%20ich%20auf%20ein%20Wicket-Eclipse-Plugin%20gesto%C3%9Fen%2C%20dass%20im%20t%C3%A4glichen%20Umgang%20mit%20Wicket-basierten%20Projekten%20zu%20einer%20nicht%20unwesentlichen%20Arbeitserleichterung%20f%C3%BChrt.%20In%20Anbetracht%20des%20fr%C3%BChen%20Entwicklungsstadiums%20%28Version%200.1%29%20ist%20das%20bereit" title="del.icio.us"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2010%2F04%2F14%2Fwicket-eclipse-plugin-qwickie%2F&amp;t=Wicket%20Eclipse%20Plugin%20-%20%20qwickie" title="Facebook"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2010%2F04%2F14%2Fwicket-eclipse-plugin-qwickie%2F&amp;title=Wicket%20Eclipse%20Plugin%20-%20%20qwickie" title="Mixx"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2010%2F04%2F14%2Fwicket-eclipse-plugin-qwickie%2F&amp;title=Wicket%20Eclipse%20Plugin%20-%20%20qwickie&amp;annotation=Zuf%C3%A4llig%20bin%20ich%20auf%20ein%20Wicket-Eclipse-Plugin%20gesto%C3%9Fen%2C%20dass%20im%20t%C3%A4glichen%20Umgang%20mit%20Wicket-basierten%20Projekten%20zu%20einer%20nicht%20unwesentlichen%20Arbeitserleichterung%20f%C3%BChrt.%20In%20Anbetracht%20des%20fr%C3%BChen%20Entwicklungsstadiums%20%28Version%200.1%29%20ist%20das%20bereit" title="Google Bookmarks"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
</ul>
</div>
<div id="vgwpixel"></div><h3  class="related_post_title">Andere Beiträge</h3><ul class="related_post"><li>13. Januar 2010 -- <a href="http://www.wicket-praxis.de/blog/2010/01/13/wicket-und-eclipse/" title="Wicket und Eclipse">Wicket und Eclipse</a></li><li>29. April 2011 -- <a href="http://www.wicket-praxis.de/blog/2011/04/29/wicket-back-button-detect/" title="Wicket &#8211; Back Button zuverlässig erkennen">Wicket &#8211; Back Button zuverlässig erkennen</a></li><li>24. Oktober 2010 -- <a href="http://www.wicket-praxis.de/blog/2010/10/24/wicket-mainstream-github-mongodb/" title="Wicket &#8211; Mainstream, Github, MongoDB">Wicket &#8211; Mainstream, Github, MongoDB</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wicket-praxis.de/blog/2010/04/14/wicket-eclipse-plugin-qwickie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wicket Extensions &#8211; Anpassungen am ModalWindow</title>
		<link>http://www.wicket-praxis.de/blog/2010/03/03/wicket-extensions-anpassungen-am-modalwindow/</link>
		<comments>http://www.wicket-praxis.de/blog/2010/03/03/wicket-extensions-anpassungen-am-modalwindow/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 07:42:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Technologie]]></category>
		<category><![CDATA[Wicket]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[modalwindow]]></category>

		<guid isPermaLink="false">http://www.wicket-praxis.de/blog/?p=249</guid>
		<description><![CDATA[Wicket liefert im Bereich Extensions Komponenten mit, die zwar nicht direkt zum Kern von Wicket gehören, die aber fast so häufig wie die Standardwicketkomponenten zum Zuge kommen. Im folgenden Beitrag zeige ich, wie man die ModalWindow-Komponente benutzen kann und wie man die Darstellung an eigene Wünsche anpasst. Als erstes benötigen wir eine Komponente, die durch [...]]]></description>
			<content:encoded><![CDATA[<p>Wicket liefert im Bereich Extensions Komponenten mit, die zwar nicht direkt zum Kern von Wicket gehören, die aber fast so häufig wie die Standardwicketkomponenten zum Zuge kommen. Im folgenden Beitrag zeige ich, wie man die ModalWindow-Komponente benutzen kann und wie man die Darstellung an eigene Wünsche anpasst. Als erstes benötigen wir eine Komponente, die durch das ModalWindow angezeigt werden soll.</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Java(TM) 2 Platform Standard Edition 5.0"><div class="devcodeoverflow"><ol><li><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">de.wicketpraxis.web.blog.pages.questions.ajax.modal</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.wicket.ajax.AjaxRequestTarget</span><span style="color: #339933;">;</span></li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.wicket.ajax.markup.html.AjaxLink</span><span style="color: #339933;">;</span></li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow</span><span style="color: #339933;">;</span></li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.wicket.markup.html.panel.Panel</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">abstract</span> <span style="color: #000000; font-weight: bold;">class</span> AbstractModalClosePanel <span style="color: #000000; font-weight: bold;">extends</span> <span style="color: #003399; font-weight: bold;">Panel</span></li><li><span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> AbstractModalClosePanel<span style="color: #009900;">&#40;</span>ModalWindow modalWindow<span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">super</span><span style="color: #009900;">&#40;</span>modalWindow.<span style="color: #006633;">getContentId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;add<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> AjaxLink<span style="color: #339933;">&lt;</span><span style="color: #003399; font-weight: bold;">Void</span><span style="color: #339933;">&gt;</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;link&quot;</span><span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@<span style="color: #003399; font-weight: bold;">Override</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">void</span> onClick<span style="color: #009900;">&#40;</span>AjaxRequestTarget target<span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AbstractModalClosePanel.<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">onClick</span><span style="color: #009900;">&#40;</span>target<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">abstract</span> <span style="color: #006600; font-weight: bold;">void</span> onClick<span style="color: #009900;">&#40;</span>AjaxRequestTarget target<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li><span style="color: #009900;">&#125;</span></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>Die ModalWindow-Komponente kann nur eine andere Komponente anzeigen. Daher ist die Komponenten-ID fest definiert. Daher macht es Sinn, statt einer eigenen ID einfach das ModalWindow, in dem die Komponente angezeigt werden soll als Parameter zu übergeben. Damit diese Komponente auch eine Funktion bereitstellt, fügen wir einen Link hinzu. Wichtig: Wenn man Formulare benutzen möchte, muss man diese bei Anzeige durch ein ModalWindow per Ajax absenden.</p>
<p>Das Markup der Komponente ist wenig überraschend:<br />
<!--DEVFMTCODE--><pre class="devcodeblock" title="HTML"><div class="devcodeoverflow"><ol><li><span style="color: #009900;">&lt;wicket:panel&gt;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;Nothing to hide:)</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> wicket:<span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;link&quot;</span>&gt;</span>Link<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></li><li><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>wicket:panel&gt;</span></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>Die ModalWindow-Komponente unterscheidet sich von anderen Komponenten in einem wesentlichen Punkt. Die Darstellung wird nicht durch ein Markup realisiert, dass man überschreiben könnte. Der Rahmen für das Fenster wird per Javascript erzeugt. Um das Aussehen der Komponente anzupassen müssen wir also etwas tiefer in die Trickkiste greifen.</p>
<p>In diesem Beispiel nehmen wir Veränderungen an verschiedenen Stellen vor. Fangen wir mit den Grafiken für den Rahmen an. Der Einfachheit halber verändere ich nur die Farbwirkung aber nicht die Dimensionen, so dass ich die vorhandenen Grafiken (die man sich aus dem wicket-extension.jar extrahieren kann) nur leicht verändere:</p>
<p><a href="http://www.wicket-praxis.de/blog/wp-content/uploads/2010/03/frame-custom-1-alpha.png"><img class="alignnone size-full wp-image-251" title="frame-custom-1-alpha" src="http://www.wicket-praxis.de/blog/wp-content/uploads/2010/03/frame-custom-1-alpha.png" alt="frame-custom-1-alpha" width="100" height="100" /></a><a href="http://www.wicket-praxis.de/blog/wp-content/uploads/2010/03/frame-custom-1-ie.png"><img class="alignnone size-full wp-image-252" title="frame-custom-1-ie" src="http://www.wicket-praxis.de/blog/wp-content/uploads/2010/03/frame-custom-1-ie.png" alt="frame-custom-1-ie" width="100" height="100" /></a><a href="http://www.wicket-praxis.de/blog/wp-content/uploads/2010/03/frame-custom-2-alpha.png"><img class="alignnone size-full wp-image-253" title="frame-custom-2-alpha" src="http://www.wicket-praxis.de/blog/wp-content/uploads/2010/03/frame-custom-2-alpha.png" alt="frame-custom-2-alpha" width="20" height="100" /></a><a href="http://www.wicket-praxis.de/blog/wp-content/uploads/2010/03/frame-custom-2-ie.png"><img class="alignnone size-full wp-image-254" title="frame-custom-2-ie" src="http://www.wicket-praxis.de/blog/wp-content/uploads/2010/03/frame-custom-2-ie.png" alt="frame-custom-2-ie" width="20" height="100" /></a></p>
<p>Es gibt zwei Grafiken, wobei es für jede noch eine Version für den InternetExplorer gibt, die auf transparente Schatten verzichtet (der InternetExplorer hat da Schwierigkeiten, ähm.. nicht nur da). Wie man sieht befinden sich die Grafikinformationen für die Ränder, Ecken und Buttons in einer Grafik. Das Stylesheet sorgt dafür, dass an der richtigen Stelle die richtige Grafik eingeblendet wird. Daher müssen wir eine eigene Stylesheet-Datei einbinden, die unsere Anpassungen wiederspiegelt. Auch an dieser Stelle ist es sinnvoll, sich den Inhalt der ModalWindow-eigenen Stylesheet-Datei anzuschauen.</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="CSS"><div class="devcodeoverflow"><ol><li>div<span style="color: #6666ff;">.wicket-modal</span> div<span style="color: #6666ff;">.w_content_3</span></li><li><span style="color: #00AA00;">&#123;</span></li><li>&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span></li><li><span style="color: #00AA00;">&#125;</span></li><li>&nbsp;</li><li>div<span style="color: #6666ff;">.wicket-modal</span> div<span style="color: #6666ff;">.w_caption</span></li><li><span style="color: #00AA00;">&#123;</span></li><li>&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">inherit</span><span style="color: #00AA00;">;</span></li><li><span style="color: #00AA00;">&#125;</span></li><li>&nbsp;</li><li>div<span style="color: #6666ff;">.wicket-modal</span> a<span style="color: #6666ff;">.w_close</span> <span style="color: #00AA00;">&#123;</span>&nbsp;&nbsp;</li><li>&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">3px</span><span style="color: #00AA00;">;</span></li><li><span style="color: #00AA00;">&#125;</span></li><li>&nbsp;</li><li>div<span style="color: #6666ff;">.wicket-modal</span> div<span style="color: #6666ff;">.custom</span> div.w_left<span style="color: #00AA00;">,</span></li><li>div<span style="color: #6666ff;">.wicket-modal</span> div<span style="color: #6666ff;">.custom</span> div<span style="color: #6666ff;">.w_right</span> <span style="color: #00AA00;">&#123;</span></li><li>&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">background-image</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'frame-custom-2-alpha.png'</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> </li><li>&nbsp;&nbsp;_background-image<span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'frame-custom-2-ie.png'</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span></li><li><span style="color: #00AA00;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>div<span style="color: #6666ff;">.wicket-modal</span> div<span style="color: #6666ff;">.custom</span> div.w_top<span style="color: #00AA00;">,</span></li><li>div<span style="color: #6666ff;">.wicket-modal</span> div<span style="color: #6666ff;">.custom</span> div.w_bottom<span style="color: #00AA00;">,</span></li><li>div<span style="color: #6666ff;">.wicket-modal</span> div<span style="color: #6666ff;">.custom</span> div.w_topLeft<span style="color: #00AA00;">,</span></li><li>div<span style="color: #6666ff;">.wicket-modal</span> div<span style="color: #6666ff;">.custom</span> div.w_topRight<span style="color: #00AA00;">,</span></li><li>div<span style="color: #6666ff;">.wicket-modal</span> div<span style="color: #6666ff;">.custom</span> div.w_bottomRight<span style="color: #00AA00;">,</span></li><li>div<span style="color: #6666ff;">.wicket-modal</span> div<span style="color: #6666ff;">.custom</span> div.w_bottomLeft<span style="color: #00AA00;">,</span></li><li>div<span style="color: #6666ff;">.wicket-modal</span> div<span style="color: #6666ff;">.custom</span> a<span style="color: #6666ff;">.w_close</span> <span style="color: #00AA00;">&#123;</span></li><li>&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">background-image</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'frame-custom-1-alpha.png'</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> </li><li>&nbsp;&nbsp;_background-image<span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'frame-custom-1-ie.png'</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span></li><li><span style="color: #00AA00;">&#125;</span></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>Wie ich bereits weiter oben erwähnt habe, wird das Html für den Rahmen nicht wie üblich sondern per Javascript erzeugt. Da wir auch an dieser Stelle Anpassungen vornehmen wollen, müssen wir die entsprechende Funktion überschreiben:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Javascript"><div class="devcodeoverflow"><ol><li>Wicket.<span style="color: #660066;">Window</span>.<span style="color: #660066;">getMarkup</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>idWindow<span style="color: #339933;">,</span> idClassElement<span style="color: #339933;">,</span> idCaption<span style="color: #339933;">,</span> idContent<span style="color: #339933;">,</span> idTop<span style="color: #339933;">,</span> idTopLeft<span style="color: #339933;">,</span> idTopRight<span style="color: #339933;">,</span> idLeft<span style="color: #339933;">,</span> idRight<span style="color: #339933;">,</span> idBottomLeft<span style="color: #339933;">,</span> idBottomRight<span style="color: #339933;">,</span> idBottom<span style="color: #339933;">,</span> idCaptionText<span style="color: #339933;">,</span> isFrame<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;<span style="color: #003366; font-weight: bold;">var</span> s <span style="color: #339933;">=</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;div class=<span style="color: #000099; font-weight: bold;">\&quot;</span>wicket-modal<span style="color: #000099; font-weight: bold;">\&quot;</span> id=<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">+</span>idWindow<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span> style=<span style="color: #000099; font-weight: bold;">\&quot;</span>top: 10px; left: 10px; width: 100px;<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;form style='background-color:transparent;padding:0px;margin:0px;border-width:0px;position:static'&gt;&quot;</span><span style="color: #339933;">+</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;div id=<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">+</span>idClassElement<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #339933;">+</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;div class=<span style="color: #000099; font-weight: bold;">\&quot;</span>w_caption<span style="color: #000099; font-weight: bold;">\&quot;</span>&nbsp;&nbsp;id=<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">+</span>idCaption<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #339933;">+</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;a class=<span style="color: #000099; font-weight: bold;">\&quot;</span>w_close<span style="color: #000099; font-weight: bold;">\&quot;</span> href=<span style="color: #000099; font-weight: bold;">\&quot;</span>#<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;/a&gt;&quot;</span><span style="color: #339933;">+</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;span id=<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">+</span>idCaptionText<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span> class=<span style="color: #000099; font-weight: bold;">\&quot;</span>w_captionText<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;/span&gt;&quot;</span><span style="color: #339933;">+</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;/div&gt;&quot;</span><span style="color: #339933;">+</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;div class=<span style="color: #000099; font-weight: bold;">\&quot;</span>w_top_1<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #339933;">+</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;div class=<span style="color: #000099; font-weight: bold;">\&quot;</span>w_topLeft<span style="color: #000099; font-weight: bold;">\&quot;</span> id=<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">+</span>idTopLeft<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #339933;">+</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;/div&gt;&quot;</span><span style="color: #339933;">+</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;div class=<span style="color: #000099; font-weight: bold;">\&quot;</span>w_topRight<span style="color: #000099; font-weight: bold;">\&quot;</span> id=<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">+</span>idTopRight<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #339933;">+</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;/div&gt;&quot;</span><span style="color: #339933;">+</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;div class=<span style="color: #000099; font-weight: bold;">\&quot;</span>w_top<span style="color: #000099; font-weight: bold;">\&quot;</span> id='&quot;</span><span style="color: #339933;">+</span>idTop<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;'&gt;&quot;</span><span style="color: #339933;">+</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;/div&gt;&quot;</span><span style="color: #339933;">+</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;/div&gt;&quot;</span><span style="color: #339933;">+</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;div class=<span style="color: #000099; font-weight: bold;">\&quot;</span>w_left<span style="color: #000099; font-weight: bold;">\&quot;</span> id='&quot;</span><span style="color: #339933;">+</span>idLeft<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;'&gt;&quot;</span><span style="color: #339933;">+</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;div class=<span style="color: #000099; font-weight: bold;">\&quot;</span>w_right_1<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #339933;">+</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;div class=<span style="color: #000099; font-weight: bold;">\&quot;</span>w_right<span style="color: #000099; font-weight: bold;">\&quot;</span> id='&quot;</span><span style="color: #339933;">+</span>idRight<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;'&gt;&quot;</span><span style="color: #339933;">+</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;div class=<span style="color: #000099; font-weight: bold;">\&quot;</span>w_content_1<span style="color: #000099; font-weight: bold;">\&quot;</span> onmousedown=<span style="color: #000099; font-weight: bold;">\&quot;</span>if (Wicket.Browser.isSafari()) { event.ignore = true; }&nbsp;&nbsp;else { Wicket.stopEvent(event); } <span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #339933;">+</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;div class=<span style="color: #000099; font-weight: bold;">\&quot;</span>w_content_2<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #339933;">+</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;div class=<span style="color: #000099; font-weight: bold;">\&quot;</span>w_content_3<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #339933;">+</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;div class=<span style="color: #000099; font-weight: bold;">\&quot;</span>w_content<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>isFrame<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>Wicket.<span style="color: #660066;">Browser</span>.<span style="color: #660066;">isIELessThan7</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span>Wicket.<span style="color: #660066;">Browser</span>.<span style="color: #660066;">isIE</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s<span style="color: #339933;">+=</span> <span style="color: #3366CC;">&quot;&lt;iframe src='<span style="color: #000099; font-weight: bold;">\/</span><span style="color: #000099; font-weight: bold;">\/</span>:' frameborder=<span style="color: #000099; font-weight: bold;">\&quot;</span>0<span style="color: #000099; font-weight: bold;">\&quot;</span> id='&quot;</span><span style="color: #339933;">+</span>idContent<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;' allowtransparency=<span style="color: #000099; font-weight: bold;">\&quot;</span>false<span style="color: #000099; font-weight: bold;">\&quot;</span> style=<span style="color: #000099; font-weight: bold;">\&quot;</span>height: 200px<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #339933;">+</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;/iframe&gt;&quot;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s<span style="color: #339933;">+=</span> <span style="color: #3366CC;">&quot;&lt;iframe src='about:blank' frameborder=<span style="color: #000099; font-weight: bold;">\&quot;</span>0<span style="color: #000099; font-weight: bold;">\&quot;</span> id='&quot;</span><span style="color: #339933;">+</span>idContent<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;' allowtransparency=<span style="color: #000099; font-weight: bold;">\&quot;</span>false<span style="color: #000099; font-weight: bold;">\&quot;</span> style=<span style="color: #000099; font-weight: bold;">\&quot;</span>height: 200px<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #339933;">+</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;/iframe&gt;&quot;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s<span style="color: #339933;">+=</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;div id='&quot;</span><span style="color: #339933;">+</span>idContent<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;'&gt;&lt;/div&gt;&quot;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s<span style="color: #339933;">+=</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;/div&gt;&quot;</span><span style="color: #339933;">+</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;/div&gt;&quot;</span><span style="color: #339933;">+</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;/div&gt;&quot;</span><span style="color: #339933;">+</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;/div&gt;&quot;</span><span style="color: #339933;">+</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;/div&gt;&quot;</span><span style="color: #339933;">+</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;/div&gt;&quot;</span><span style="color: #339933;">+</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;/div&gt;&quot;</span><span style="color: #339933;">+</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;div class=<span style="color: #000099; font-weight: bold;">\&quot;</span>w_bottom_1<span style="color: #000099; font-weight: bold;">\&quot;</span> id=<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">+</span>idBottom<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #339933;">+</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;div class=<span style="color: #000099; font-weight: bold;">\&quot;</span>w_bottomRight<span style="color: #000099; font-weight: bold;">\&quot;</span>&nbsp;&nbsp;id=<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">+</span>idBottomRight<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #339933;">+</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;/div&gt;&quot;</span><span style="color: #339933;">+</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;div class=<span style="color: #000099; font-weight: bold;">\&quot;</span>w_bottomLeft<span style="color: #000099; font-weight: bold;">\&quot;</span> id=<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">+</span>idBottomLeft<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #339933;">+</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;/div&gt;&quot;</span><span style="color: #339933;">+</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;div class=<span style="color: #000099; font-weight: bold;">\&quot;</span>w_bottom<span style="color: #000099; font-weight: bold;">\&quot;</span> id=<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">+</span>idBottom<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #339933;">+</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;/div&gt;&quot;</span><span style="color: #339933;">+</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;/div&gt;&quot;</span><span style="color: #339933;">+</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;/div&gt;&quot;</span><span style="color: #339933;">+</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #3366CC;">&quot;&lt;/form&gt;&lt;/div&gt;&quot;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">return</span> s<span style="color: #339933;">;</span></li><li><span style="color: #009900;">&#125;</span></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>Da die Javascript-Datei der ModalWindow-Komponente automatisch eingebunden wird (da von dieser Klasse abgeleitet wird), muss ich nur diese eine Funktion überschreiben. Ich habe mich in diesem Beispiel darauf beschränkt, den Bereich für die Überschrift und den CloseButton oberhalb des Rahmens darstellen zu lassen (Das div mit der Klasse &#8220;w_caption&#8221;).</p>
<p>In unsere Komponentenklasse betreten wir nun wieder vertrautes Terrain. Wir leiten von ModalWindow ab und passen ein paar grundsätzliche Dinge an:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Java(TM) 2 Platform Standard Edition 5.0"><div class="devcodeoverflow"><ol><li><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">de.wicketpraxis.web.blog.pages.questions.ajax.modal</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.wicket.ResourceReference</span><span style="color: #339933;">;</span></li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.wicket.ajax.AjaxRequestTarget</span><span style="color: #339933;">;</span></li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow</span><span style="color: #339933;">;</span></li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.wicket.markup.html.CSSPackageResource</span><span style="color: #339933;">;</span></li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.wicket.markup.html.JavascriptPackageResource</span><span style="color: #339933;">;</span></li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.wicket.markup.html.resources.CompressedResourceReference</span><span style="color: #339933;">;</span></li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.wicket.markup.html.resources.JavascriptResourceReference</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> CustomModalWindow <span style="color: #000000; font-weight: bold;">extends</span> ModalWindow</li><li><span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> ResourceReference <span style="color: #003399; font-weight: bold;">CSS</span> = <span style="color: #000000; font-weight: bold;">new</span> CompressedResourceReference<span style="color: #009900;">&#40;</span>CustomModalWindow.<span style="color: #000000; font-weight: bold;">class</span>, <span style="color: #0000ff;">&quot;styles/custom-modal.css&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> ResourceReference JAVASCRIPT = <span style="color: #000000; font-weight: bold;">new</span> JavascriptResourceReference<span style="color: #009900;">&#40;</span>CustomModalWindow.<span style="color: #000000; font-weight: bold;">class</span>,&nbsp;&nbsp;<span style="color: #0000ff;">&quot;styles/custom-modal.js&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> CustomModalWindow<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">String</span> id<span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">super</span><span style="color: #009900;">&#40;</span>id<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;setCssClassName<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;custom&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;add<span style="color: #009900;">&#40;</span>JavascriptPackageResource.<span style="color: #006633;">getHeaderContribution</span><span style="color: #009900;">&#40;</span>JAVASCRIPT<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;add<span style="color: #009900;">&#40;</span>CSSPackageResource.<span style="color: #006633;">getHeaderContribution</span><span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">CSS</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;setCloseButtonCallback<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> CloseButtonCallback<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">boolean</span> onCloseButtonClicked<span style="color: #009900;">&#40;</span>AjaxRequestTarget target<span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">return</span> onCloseClicked<span style="color: #009900;">&#40;</span>target<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;setWindowClosedCallback<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> WindowClosedCallback<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">void</span> onClose<span style="color: #009900;">&#40;</span>AjaxRequestTarget target<span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CustomModalWindow.<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">onClose</span><span style="color: #009900;">&#40;</span>target<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #006600; font-weight: bold;">void</span> onClose<span style="color: #009900;">&#40;</span>AjaxRequestTarget target<span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #006600; font-weight: bold;">boolean</span> onCloseClicked<span style="color: #009900;">&#40;</span>AjaxRequestTarget target<span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #006600; font-weight: bold;">true</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li><span style="color: #009900;">&#125;</span></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>Wir setzen die Css-Klasse für den Rahmen, fügen unsere CSS- und Javascript-Anpassungen hinzu (da unsere Referenzen nach den ModalWindow-Referenzen eingebunden werden, überschreiben wir sowohl die CSS-Definitionen als auch die Javascript-Funktionen). Außerdem fügen wir zwei Callbacks hinzu, die auf einen Klick auf das Schließen-Symbol reagieren. Für diese Komponenten benötigen wir keine eigene Markup-Datei.</p>
<p>Jetzt möchten wir diese Komponente endlich verwenden. Dazu legen wir eine Seitenklasse an:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Java(TM) 2 Platform Standard Edition 5.0"><div class="devcodeoverflow"><ol><li><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">de.wicketpraxis.web.blog.pages.questions.ajax.modal</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.wicket.ajax.AbstractAjaxTimerBehavior</span><span style="color: #339933;">;</span></li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.wicket.ajax.AjaxRequestTarget</span><span style="color: #339933;">;</span></li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.wicket.ajax.markup.html.AjaxLink</span><span style="color: #339933;">;</span></li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.wicket.markup.html.WebPage</span><span style="color: #339933;">;</span></li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.wicket.util.time.Duration</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> ModalWindowPage <span style="color: #000000; font-weight: bold;">extends</span> WebPage</li><li><span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> ModalWindowPage<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">final</span> CustomModalWindow modalWindow = <span style="color: #000000; font-weight: bold;">new</span> CustomModalWindow<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;modal&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;modalWindow.<span style="color: #006633;">setTitle</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Popup&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;modalWindow.<span style="color: #006633;">setInitialWidth</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">400</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;modalWindow.<span style="color: #006633;">setInitialHeight</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">400</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;modalWindow.<span style="color: #006633;">setResizable</span><span style="color: #009900;">&#40;</span><span style="color: #006600; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;modalWindow.<span style="color: #006633;">setContent</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> AbstractModalClosePanel<span style="color: #009900;">&#40;</span>modalWindow<span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@<span style="color: #003399; font-weight: bold;">Override</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">void</span> onClick<span style="color: #009900;">&#40;</span>AjaxRequestTarget target<span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;modalWindow.<span style="color: #006633;">close</span><span style="color: #009900;">&#40;</span>target<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;add<span style="color: #009900;">&#40;</span>modalWindow<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;add<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> AjaxLink<span style="color: #339933;">&lt;</span><span style="color: #003399; font-weight: bold;">Void</span><span style="color: #339933;">&gt;</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;open&quot;</span><span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@<span style="color: #003399; font-weight: bold;">Override</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">void</span> onClick<span style="color: #009900;">&#40;</span>AjaxRequestTarget target<span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;modalWindow.<span style="color: #006633;">show</span><span style="color: #009900;">&#40;</span>target<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;add<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> AbstractAjaxTimerBehavior<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Duration</span>.<span style="color: #006633;">seconds</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@<span style="color: #003399; font-weight: bold;">Override</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #006600; font-weight: bold;">void</span> onTimer<span style="color: #009900;">&#40;</span>AjaxRequestTarget target<span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;modalWindow.<span style="color: #006633;">show</span><span style="color: #009900;">&#40;</span>target<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;stop<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li><span style="color: #009900;">&#125;</span></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>Wir erstellen eine Instanz unsere ModalWindow-Komponente und fügen ein Panel als Content-Element hinzu. Dabei wird beim Klick auf den Link innerhalb der Komponente das Fenster geschlossen. Da das ModalWindow per Ajax geöffnet und geschlossen werden muss, benötigen wir zum Öffnen einen AjaxLink. Wenn man dem Nutzer das Fenster bereits beim Aufruf der Seite einmalig anzeigen möchte, kann man sich damit behelfen, das man eine Instanz AbstractAjaxTimerBehavior-Klasse erstellt und die Zeit entsprechend klein wählt (weniger als die zwei Sekunden aus diesem Beispiel). In der onTimer()-Methode führt der Aufruf von stop() dazu, dass die Methode nach der abgelaufenen Zeit nicht noch einmal aufgerufen wird.</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="HTML"><div class="devcodeoverflow"><ol><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;</span>ModalWindow Page<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> wicket:<span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;modal&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> wicket:<span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;open&quot;</span>&gt;</span>Open<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span></li><li><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>Und so sieht das Ergebnis aus:</p>
<p><a href="http://www.wicket-praxis.de/blog/wp-content/uploads/2010/03/wicket-custom-modalwindow.jpg"><img src="http://www.wicket-praxis.de/blog/wp-content/uploads/2010/03/wicket-custom-modalwindow-382x450.jpg" alt="wicket-custom-modalwindow" title="wicket-custom-modalwindow" width="382" height="450" class="aligncenter size-medium wp-image-255" /></a></p>
<p>Der Aufwand für eine eigene Komponente ist zwar wesentlich höher als in anderen Fällen, aber der Aufwand lohnt schon deshalb, weil dann das Aussehen der ModalWindow-Kompoente zur restlichen Anwendung passt.</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2010%2F03%2F03%2Fwicket-extensions-anpassungen-am-modalwindow%2F&amp;title=Wicket%20Extensions%20-%20Anpassungen%20am%20ModalWindow&amp;bodytext=Wicket%20liefert%20im%20Bereich%20Extensions%20Komponenten%20mit%2C%20die%20zwar%20nicht%20direkt%20zum%20Kern%20von%20Wicket%20geh%C3%B6ren%2C%20die%20aber%20fast%20so%20h%C3%A4ufig%20wie%20die%20Standardwicketkomponenten%20zum%20Zuge%20kommen.%20Im%20folgenden%20Beitrag%20zeige%20ich%2C%20wie%20man%20die%20ModalWindow-Komponente%20b" title="Digg"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2010%2F03%2F03%2Fwicket-extensions-anpassungen-am-modalwindow%2F" title="Sphinn"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2010%2F03%2F03%2Fwicket-extensions-anpassungen-am-modalwindow%2F&amp;title=Wicket%20Extensions%20-%20Anpassungen%20am%20ModalWindow&amp;notes=Wicket%20liefert%20im%20Bereich%20Extensions%20Komponenten%20mit%2C%20die%20zwar%20nicht%20direkt%20zum%20Kern%20von%20Wicket%20geh%C3%B6ren%2C%20die%20aber%20fast%20so%20h%C3%A4ufig%20wie%20die%20Standardwicketkomponenten%20zum%20Zuge%20kommen.%20Im%20folgenden%20Beitrag%20zeige%20ich%2C%20wie%20man%20die%20ModalWindow-Komponente%20b" title="del.icio.us"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2010%2F03%2F03%2Fwicket-extensions-anpassungen-am-modalwindow%2F&amp;t=Wicket%20Extensions%20-%20Anpassungen%20am%20ModalWindow" title="Facebook"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2010%2F03%2F03%2Fwicket-extensions-anpassungen-am-modalwindow%2F&amp;title=Wicket%20Extensions%20-%20Anpassungen%20am%20ModalWindow" title="Mixx"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2010%2F03%2F03%2Fwicket-extensions-anpassungen-am-modalwindow%2F&amp;title=Wicket%20Extensions%20-%20Anpassungen%20am%20ModalWindow&amp;annotation=Wicket%20liefert%20im%20Bereich%20Extensions%20Komponenten%20mit%2C%20die%20zwar%20nicht%20direkt%20zum%20Kern%20von%20Wicket%20geh%C3%B6ren%2C%20die%20aber%20fast%20so%20h%C3%A4ufig%20wie%20die%20Standardwicketkomponenten%20zum%20Zuge%20kommen.%20Im%20folgenden%20Beitrag%20zeige%20ich%2C%20wie%20man%20die%20ModalWindow-Komponente%20b" title="Google Bookmarks"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
</ul>
</div>
<div id="vgwpixel"></div><h3  class="related_post_title">Andere Beiträge</h3><ul class="related_post"><li>9. April 2010 -- <a href="http://www.wicket-praxis.de/blog/2010/04/09/wicket-abstractevent-update/" title="Wicket &#8211; AbstractEvent Update">Wicket &#8211; AbstractEvent Update</a></li><li>7. März 2010 -- <a href="http://www.wicket-praxis.de/blog/2010/03/07/wicket-heatmap-ajax-mit-parametern/" title="Wicket Heatmap &#8211; Ajax mit Parametern">Wicket Heatmap &#8211; Ajax mit Parametern</a></li><li>23. Dezember 2009 -- <a href="http://www.wicket-praxis.de/blog/2009/12/23/wicket-ajax-tipp-ajaxrequesttarget-nachtraglich-ermitteln/" title="Wicket Ajax Tipp &#8211; AjaxRequestTarget nachträglich ermitteln">Wicket Ajax Tipp &#8211; AjaxRequestTarget nachträglich ermitteln</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wicket-praxis.de/blog/2010/03/03/wicket-extensions-anpassungen-am-modalwindow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wicket Form Submit &#8211; mit und ohne Ajax</title>
		<link>http://www.wicket-praxis.de/blog/2009/12/11/wicket-form-submit-mit-und-ohne-ajax/</link>
		<comments>http://www.wicket-praxis.de/blog/2009/12/11/wicket-form-submit-mit-und-ohne-ajax/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 08:52:29 +0000</pubDate>
		<dc:creator>michael</dc:creator>
				<category><![CDATA[Technologie]]></category>
		<category><![CDATA[Wicket]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[fallback]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[submit]]></category>

		<guid isPermaLink="false">http://www.wicket-praxis.de/blog/?p=213</guid>
		<description><![CDATA[Webanwendungen ohne Formulare gibt es nicht. Dabei ist die korrekte Formularbehandlung alles andere als trivial. Zum Glück bietet Wicket eine ausgezeichnete Unterstützung für Formulare, die kaum Wünsche offen lässt. Doch auch mit Wicket sind ein paar Dinge zu beachten, um die verschiedenen Interaktionsmöglichkeiten des Nutzers korrekt zu verarbeiten. Wicket bietet die Möglichkeit, neben dem normalen [...]]]></description>
			<content:encoded><![CDATA[<p>Webanwendungen ohne Formulare gibt es nicht. Dabei ist die korrekte Formularbehandlung alles andere als trivial. Zum Glück bietet Wicket eine ausgezeichnete Unterstützung für Formulare, die kaum Wünsche offen lässt. Doch auch mit Wicket sind ein paar Dinge zu beachten, um die verschiedenen Interaktionsmöglichkeiten des Nutzers korrekt zu verarbeiten.</p>
<p>Wicket bietet die Möglichkeit, neben dem normalen Abschicken eines Formulars auch auf die angeklickten Submit-Buttons reagieren zu können. Damit man aber auch zuverlässig unterscheiden kann, ob der Nutzer das Formular durch ein Enter im Textfeld oder durch einen Klick auf einen Button abgeschickt hat, muss man ein paar Vorbereitungen treffen.</p>
<p>Für das Formular legen wir eine Bean an, welche die Daten aufnimmt.<br />
<!--DEVFMTCODE--><pre class="devcodeblock" title="Java(TM) 2 Platform Standard Edition 5.0"><div class="devcodeoverflow"><ol><li><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">de.wicketpraxis.web.blog.pages.questions.form.submit</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.Serializable</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> FormBean <span style="color: #000000; font-weight: bold;">implements</span> <span style="color: #003399; font-weight: bold;">Serializable</span></li><li><span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;<span style="color: #003399; font-weight: bold;">String</span> _name<span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399; font-weight: bold;">String</span> getName<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">return</span> _name<span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">void</span> setName<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">String</span> name<span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;_name = name<span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li><span style="color: #009900;">&#125;</span></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>Für unser Beispiel benötigen wir ein Formular, einen AjaxFallbackButton, einen normalen Button und einen Button, den wir dazu benutzen, denn Fall herauszubekommen, wenn der Nutzer einfach nur Enter gedrückt hat. Das FeedbackPanel sollte man auch nicht vergessen.</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Java(TM) 2 Platform Standard Edition 5.0"><div class="devcodeoverflow"><ol><li><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">de.wicketpraxis.web.blog.pages.questions.form.submit</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.wicket.ajax.AjaxRequestTarget</span><span style="color: #339933;">;</span></li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.wicket.ajax.markup.html.form.AjaxFallbackButton</span><span style="color: #339933;">;</span></li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.wicket.markup.html.WebPage</span><span style="color: #339933;">;</span></li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.wicket.markup.html.form.Button</span><span style="color: #339933;">;</span></li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.wicket.markup.html.form.Form</span><span style="color: #339933;">;</span></li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.wicket.markup.html.form.TextField</span><span style="color: #339933;">;</span></li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.wicket.markup.html.panel.FeedbackPanel</span><span style="color: #339933;">;</span></li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.wicket.model.CompoundPropertyModel</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> FormSubmitPage <span style="color: #000000; font-weight: bold;">extends</span> WebPage</li><li><span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;<span style="color: #006600; font-weight: bold;">int</span> _counter<span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> FormSubmitPage<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">final</span> FeedbackPanel feedbackPanel = <span style="color: #000000; font-weight: bold;">new</span> FeedbackPanel<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;feedback&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;feedbackPanel.<span style="color: #006633;">setOutputMarkupId</span><span style="color: #009900;">&#40;</span><span style="color: #006600; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;add<span style="color: #009900;">&#40;</span>feedbackPanel<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;CompoundPropertyModel<span style="color: #339933;">&lt;</span>FormBean<span style="color: #339933;">&gt;</span> formModel = <span style="color: #000000; font-weight: bold;">new</span> CompoundPropertyModel<span style="color: #339933;">&lt;</span>FormBean<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> FormBean<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;Form<span style="color: #339933;">&lt;</span>FormBean<span style="color: #339933;">&gt;</span> form = <span style="color: #000000; font-weight: bold;">new</span> Form<span style="color: #339933;">&lt;</span>FormBean<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;form&quot;</span>,formModel<span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@<span style="color: #003399; font-weight: bold;">Override</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #006600; font-weight: bold;">void</span> onSubmit<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;info<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Form Submit: &quot;</span>+_counter++<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;form.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399; font-weight: bold;">TextField</span><span style="color: #339933;">&lt;</span><span style="color: #003399; font-weight: bold;">String</span><span style="color: #339933;">&gt;</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;name&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;form.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399; font-weight: bold;">Button</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;defaultSubmit&quot;</span><span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@<span style="color: #003399; font-weight: bold;">Override</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">void</span> onSubmit<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;info<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Default Button: &quot;</span>+_counter++<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;form.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399; font-weight: bold;">Button</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;submit&quot;</span><span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@<span style="color: #003399; font-weight: bold;">Override</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">void</span> onSubmit<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;info<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Button: &quot;</span>+_counter++<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;form.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> AjaxFallbackButton<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ajaxSubmit&quot;</span>,form<span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@<span style="color: #003399; font-weight: bold;">Override</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #006600; font-weight: bold;">void</span> onSubmit<span style="color: #009900;">&#40;</span>AjaxRequestTarget target, Form<span style="color: #339933;">&lt;?&gt;</span> form<span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;&nbsp;&nbsp;font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>target<span style="color: #339933;">!</span>=<span style="color: #006600; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;info<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;AjaxSubmit Button(ajax): &quot;</span>+_counter++<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;target.<span style="color: #006633;">addComponent</span><span style="color: #009900;">&#40;</span>feedbackPanel<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_counter=<span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;&nbsp;&nbsp;font-weight: bold;">else</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;info<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;AjaxFallbackButton: &quot;</span>+_counter++<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;add<span style="color: #009900;">&#40;</span>form<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;@<span style="color: #003399; font-weight: bold;">Override</span></li><li>&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #006600; font-weight: bold;">void</span> onBeforeRender<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;_counter=<span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">onBeforeRender</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li><span style="color: #009900;">&#125;</span></li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>Damit man die Reihenfolge besser erkennen kann, mit der die onSubmit-Methoden aufgerufen werden, wird ein Zähler (_counter) hochgezählt und vor dem Darstellen des Formulars wieder zurückgesetzt. In diesem Beispiel liegt die entscheidende Information im Markup. Dabei ist die Reihenfolge der verschiedenen Submit-Komponenten wichtig.</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="HTML"><div class="devcodeoverflow"><ol><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;</span>FormSubmitPage<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> wicket:<span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;feedback&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">form</span> wicket:<span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;form&quot;</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> wicket:<span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;defaultSubmit&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;border:0px; width: 0px; height: 0px; visibility: collapse; display: compact;&quot;</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Name <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> wicket:<span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;name&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> wicket:<span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;ajaxSubmit&quot;</span>&nbsp;&nbsp;<span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;AjaxButton&quot;</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> wicket:<span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Button&quot;</span>&gt;</span> </li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">form</span>&gt;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span></li><li><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>Der Button mit der Wicket-ID defaultSubmit muss vor allen anderen Submit-Komponenten stehen. Dadurch wird beim Abschicken des Formulars durch Enter dieser Button ausgewählt. Wenn einer der anderen Buttons angeklickt wird, dann wird das Formular über diesen Button abgeschickt. Doch warum soviel Aufwand? Die onSubmit()-Methode des Formulars wird doch in jedem Fall aufgerufen.</p>
<p>Der Aufwand ist notwendig, wenn man abhängig davon, ob der Nutzer auf einen Button oder eben auf keinen Button geklickt hat, eine Aktion ausführen möchte. Das bedeutet, dass man die Aktion nicht in onSubmit ausführen kann. Es ist allerdings auch nicht möglich, im onSubmit() der Buttonkomponenten ein Flag zu setzen, dass dann in der onSubmit()-Methode des Formulars aufgerufen wird, da die Methode beim AjaxFallbackButton erst nach dem onSubmit() der Komponente aufgerufen wird.</p>
<p>Folgende Ergebnisse erhält man, wenn man das Formular a) per Enter, b) per AjaxButton und c) per Button abschickt:</p>
<div id="attachment_215" class="wp-caption aligncenter" style="width: 273px"><a href="http://www.wicket-praxis.de/blog/wp-content/uploads/2009/12/wicket-form-submit-enter.png"><img src="http://www.wicket-praxis.de/blog/wp-content/uploads/2009/12/wicket-form-submit-enter.png" alt="Submit per Enter" title="wicket-form-submit-enter" width="263" height="114" class="size-full wp-image-215" /></a>
<p class="wp-caption-text">Submit per Enter</p>
</div>
<div id="attachment_216" class="wp-caption aligncenter" style="width: 281px"><a href="http://www.wicket-praxis.de/blog/wp-content/uploads/2009/12/wicket-form-submit-ajaxbutton.png"><img src="http://www.wicket-praxis.de/blog/wp-content/uploads/2009/12/wicket-form-submit-ajaxbutton.png" alt="Submit per AjaxButton" title="wicket-form-submit-ajaxbutton" width="271" height="118" class="size-full wp-image-216" /></a>
<p class="wp-caption-text">Submit per AjaxButton</p>
</div>
<div id="attachment_217" class="wp-caption aligncenter" style="width: 273px"><a href="http://www.wicket-praxis.de/blog/wp-content/uploads/2009/12/wicket-form-submit-button.png"><img src="http://www.wicket-praxis.de/blog/wp-content/uploads/2009/12/wicket-form-submit-button.png" alt="Submit per Button" title="wicket-form-submit-button" width="263" height="115" class="size-full wp-image-217" /></a>
<p class="wp-caption-text">Submit per Button</p>
</div>
<p>Wenn Javascript deaktiviert ist, dann erhält man folgende Ausgabe:</p>
<div id="attachment_215" class="wp-caption aligncenter" style="width: 273px"><a href="http://www.wicket-praxis.de/blog/wp-content/uploads/2009/12/wicket-form-submit-enter.png"><img src="http://www.wicket-praxis.de/blog/wp-content/uploads/2009/12/wicket-form-submit-enter.png" alt="Submit per Enter" title="wicket-form-submit-enter" width="263" height="114" class="size-full wp-image-215" /></a>
<p class="wp-caption-text">Submit per Enter</p>
</div>
<div id="attachment_218" class="wp-caption aligncenter" style="width: 272px"><a href="http://www.wicket-praxis.de/blog/wp-content/uploads/2009/12/wicket-form-submit-ajaxbutton-no-javascript.png"><img src="http://www.wicket-praxis.de/blog/wp-content/uploads/2009/12/wicket-form-submit-ajaxbutton-no-javascript.png" alt="Submit per AjaxButton" title="wicket-form-submit-ajaxbutton-no-javascript" width="262" height="117" class="size-full wp-image-218" /></a>
<p class="wp-caption-text">Submit per AjaxButton</p>
</div>
<div id="attachment_217" class="wp-caption aligncenter" style="width: 273px"><a href="http://www.wicket-praxis.de/blog/wp-content/uploads/2009/12/wicket-form-submit-button.png"><img src="http://www.wicket-praxis.de/blog/wp-content/uploads/2009/12/wicket-form-submit-button.png" alt="Submit per Button" title="wicket-form-submit-button" width="263" height="115" class="size-full wp-image-217" /></a>
<p class="wp-caption-text">Submit per Button</p>
</div>
<p>Wenn man dieses Vorgehen beherzigt, funktioniert die Anwendung auch mit deaktiviertem JavaScript genauso zuverlässig. Das freut den Nutzer und in diesem Fall auch den Entwickler:)</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F12%2F11%2Fwicket-form-submit-mit-und-ohne-ajax%2F&amp;title=Wicket%20Form%20Submit%20-%20mit%20und%20ohne%20Ajax&amp;bodytext=Webanwendungen%20ohne%20Formulare%20gibt%20es%20nicht.%20Dabei%20ist%20die%20korrekte%20Formularbehandlung%20alles%20andere%20als%20trivial.%20Zum%20Gl%C3%BCck%20bietet%20Wicket%20eine%20ausgezeichnete%20Unterst%C3%BCtzung%20f%C3%BCr%20Formulare%2C%20die%20kaum%20W%C3%BCnsche%20offen%20l%C3%A4sst.%20Doch%20auch%20mit%20Wicket%20sind%20ein" title="Digg"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F12%2F11%2Fwicket-form-submit-mit-und-ohne-ajax%2F" title="Sphinn"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F12%2F11%2Fwicket-form-submit-mit-und-ohne-ajax%2F&amp;title=Wicket%20Form%20Submit%20-%20mit%20und%20ohne%20Ajax&amp;notes=Webanwendungen%20ohne%20Formulare%20gibt%20es%20nicht.%20Dabei%20ist%20die%20korrekte%20Formularbehandlung%20alles%20andere%20als%20trivial.%20Zum%20Gl%C3%BCck%20bietet%20Wicket%20eine%20ausgezeichnete%20Unterst%C3%BCtzung%20f%C3%BCr%20Formulare%2C%20die%20kaum%20W%C3%BCnsche%20offen%20l%C3%A4sst.%20Doch%20auch%20mit%20Wicket%20sind%20ein" title="del.icio.us"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F12%2F11%2Fwicket-form-submit-mit-und-ohne-ajax%2F&amp;t=Wicket%20Form%20Submit%20-%20mit%20und%20ohne%20Ajax" title="Facebook"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F12%2F11%2Fwicket-form-submit-mit-und-ohne-ajax%2F&amp;title=Wicket%20Form%20Submit%20-%20mit%20und%20ohne%20Ajax" title="Mixx"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F12%2F11%2Fwicket-form-submit-mit-und-ohne-ajax%2F&amp;title=Wicket%20Form%20Submit%20-%20mit%20und%20ohne%20Ajax&amp;annotation=Webanwendungen%20ohne%20Formulare%20gibt%20es%20nicht.%20Dabei%20ist%20die%20korrekte%20Formularbehandlung%20alles%20andere%20als%20trivial.%20Zum%20Gl%C3%BCck%20bietet%20Wicket%20eine%20ausgezeichnete%20Unterst%C3%BCtzung%20f%C3%BCr%20Formulare%2C%20die%20kaum%20W%C3%BCnsche%20offen%20l%C3%A4sst.%20Doch%20auch%20mit%20Wicket%20sind%20ein" title="Google Bookmarks"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
</ul>
</div>
<div id="vgwpixel"><img src="http://vg05.met.vgwort.de/na/182d54349d0b4270ad76cfc3ce7e8d24" width="1" height="1" alt=""></div><h3  class="related_post_title">Andere Beiträge</h3><ul class="related_post"><li>9. September 2009 -- <a href="http://www.wicket-praxis.de/blog/2009/09/09/migration-zu-wicket-formulare/" title="Migration zu Wicket : Formulare">Migration zu Wicket : Formulare</a></li><li>9. April 2010 -- <a href="http://www.wicket-praxis.de/blog/2010/04/09/wicket-abstractevent-update/" title="Wicket &#8211; AbstractEvent Update">Wicket &#8211; AbstractEvent Update</a></li><li>7. März 2010 -- <a href="http://www.wicket-praxis.de/blog/2010/03/07/wicket-heatmap-ajax-mit-parametern/" title="Wicket Heatmap &#8211; Ajax mit Parametern">Wicket Heatmap &#8211; Ajax mit Parametern</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wicket-praxis.de/blog/2009/12/11/wicket-form-submit-mit-und-ohne-ajax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>E-Mail mit Wicket verschicken</title>
		<link>http://www.wicket-praxis.de/blog/2009/12/01/sending-html-email-from-wicket-app/</link>
		<comments>http://www.wicket-praxis.de/blog/2009/12/01/sending-html-email-from-wicket-app/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 06:59:14 +0000</pubDate>
		<dc:creator>michael</dc:creator>
				<category><![CDATA[Technologie]]></category>
		<category><![CDATA[Wicket]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[sending]]></category>
		<category><![CDATA[test]]></category>

		<guid isPermaLink="false">http://www.wicket-praxis.de/blog/?p=204</guid>
		<description><![CDATA[Wäre es nicht praktisch, wenn man eine E-Mail verschicken könnte, in dem man die Komponenten, die man für die Darstellung auf der Webseite verwendet, auch für das Erstellen der E-Mail heranziehen könnte. Das Unterfangen ist leider nicht trivial, weil man nicht ohne Weiteres um die &#8220;Magie&#8221;, die Wicket an vielen Stellen benutzt, herum kommt. Nun [...]]]></description>
			<content:encoded><![CDATA[<p>Wäre es nicht praktisch, wenn man eine E-Mail verschicken könnte, in dem man die Komponenten, die man für die Darstellung auf der Webseite verwendet, auch für das Erstellen der E-Mail heranziehen könnte. Das Unterfangen ist leider nicht trivial, weil man nicht ohne Weiteres um die &#8220;Magie&#8221;, die Wicket an vielen Stellen benutzt, herum kommt. Nun bietet Wicket die Möglichkeit, Komponenten und Seiten, Formulare und vieles mehr in Unit-Test zu testen. Was liegt also näher, als diese Funktionalität für unsere Zwecke zu missbrauchen.</p>
<p><strong>Die E-Mail</strong></p>
<p>Als erstes erstellen wir eine Seite, die den Inhalt der E-Mail erzeugen soll:<br />
<!--DEVFMTCODE--><pre class="devcodeblock" title="Java(TM) 2 Platform Standard Edition 5.0"><div class="devcodeoverflow"><ol><li><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">de.wicketpraxis.web.blog.pages.questions.email</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.List</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.wicket.markup.html.WebPage</span><span style="color: #339933;">;</span></li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.wicket.markup.html.basic.Label</span><span style="color: #339933;">;</span></li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.wicket.markup.html.list.ListItem</span><span style="color: #339933;">;</span></li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.wicket.markup.html.list.ListView</span><span style="color: #339933;">;</span></li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.wicket.model.IModel</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> EmailContentPage <span style="color: #000000; font-weight: bold;">extends</span> WebPage</li><li><span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> EmailContentPage<span style="color: #009900;">&#40;</span>IModel<span style="color: #339933;">&lt;</span><span style="color: #003399; font-weight: bold;">List</span><span style="color: #339933;">&lt;?</span> <span style="color: #000000; font-weight: bold;">extends</span> <span style="color: #003399; font-weight: bold;">String</span><span style="color: #339933;">&gt;&gt;</span> list<span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;add<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399; font-weight: bold;">ListView</span><span style="color: #339933;">&lt;</span><span style="color: #003399; font-weight: bold;">String</span><span style="color: #339933;">&gt;</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;list&quot;</span>,list<span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@<span style="color: #003399; font-weight: bold;">Override</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #006600; font-weight: bold;">void</span> populateItem<span style="color: #009900;">&#40;</span>ListItem<span style="color: #339933;">&lt;</span><span style="color: #003399; font-weight: bold;">String</span><span style="color: #339933;">&gt;</span> item<span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;item.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399; font-weight: bold;">Label</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;name&quot;</span>,item.<span style="color: #006633;">getModel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li><span style="color: #009900;">&#125;</span></li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>Der Code soll zeigen, dass Komponenten ganz normal Funktionieren. Deshalb bekommt die Seite von außen eine Liste mit Werten übergeben, die dann durch eine ListView dargestellt wird.</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="HTML"><div class="devcodeoverflow"><ol><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h1</span>&gt;</span>TestEmail<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h1</span>&gt;</span></li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span>&gt;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> wicket:<span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;list&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">span</span> wicket:<span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;name&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span></li><li><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span></li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>Im Markup habe ich absichtlich den &#8220;Rahmen&#8221; der Seite (html > body) weggelassen. Die Klasse und das Markup dienen in diesem Beispiel nur als Platzhalter.</p>
<p><strong>Darstellen und Abschicken</strong></p>
<p>In Wicket sind sehr viele Objekte an den aktuellen Thread gebunden. Das ist notwendig, damit man nicht eine ganze Liste von Objekten als Übergabeparameter durch Methodenaufrufe schleifen muss. Das ist allerdings genau dann ein Problem, wenn wir innerhalb einer Wicketanwendung eine andere Seite darstellen möchten. Außerdem ist es ein Problem, wenn es wie in einem im Hintergrund laufenden Prozess überhaupt keine WicketApplication gibt. Daher erstellen wir uns ein paar Hilfsklassen, die sich um dieses Problem kümmern.</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Java(TM) 2 Platform Standard Edition 5.0"><div class="devcodeoverflow"><ol><li><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">de.wicketpraxis.web.blog.pages.questions.email</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">interface</span> WicketCallback<span style="color: #339933;">&lt;</span>I,O<span style="color: #339933;">&gt;</span></li><li><span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> O getResult<span style="color: #009900;">&#40;</span>I input<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li><span style="color: #009900;">&#125;</span></li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Java(TM) 2 Platform Standard Edition 5.0"><div class="devcodeoverflow"><ol><li><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">de.wicketpraxis.web.blog.pages.questions.email</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.logging.Logger</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> WicketThreadAdapter<span style="color: #339933;">&lt;</span>I,O<span style="color: #339933;">&gt;</span> <span style="color: #000000; font-weight: bold;">extends</span> <span style="color: #003399; font-weight: bold;">Thread</span></li><li><span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399; font-weight: bold;">Logger</span> _logger = <span style="color: #003399; font-weight: bold;">Logger</span>.<span style="color: #006633;">getLogger</span><span style="color: #009900;">&#40;</span>WicketThreadAdapter.<span style="color: #000000; font-weight: bold;">class</span>.<span style="color: #006633;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;<span style="color: #003399; font-weight: bold;">Object</span> _lock=<span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399; font-weight: bold;">Object</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;WicketCallback<span style="color: #339933;">&lt;</span>I, O<span style="color: #339933;">&gt;</span> _callback<span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;I _input<span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;O _output<span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;<span style="color: #006600; font-weight: bold;">boolean</span> _done=<span style="color: #006600; font-weight: bold;">false</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">protected</span> WicketThreadAdapter<span style="color: #009900;">&#40;</span>WicketCallback<span style="color: #339933;">&lt;</span>I, O<span style="color: #339933;">&gt;</span> callback, I input<span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;_callback=callback<span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;_input=input<span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;@<span style="color: #003399; font-weight: bold;">Override</span></li><li>&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">void</span> run<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">synchronized</span> <span style="color: #009900;">&#40;</span>_lock<span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_output=_callback.<span style="color: #006633;">getResult</span><span style="color: #009900;">&#40;</span>_input<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_done=<span style="color: #006600; font-weight: bold;">true</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_lock.<span style="color: #006633;">notify</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">protected</span> O getResult<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399; font-weight: bold;">InterruptedException</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">synchronized</span> <span style="color: #009900;">&#40;</span>_lock<span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;&nbsp;&nbsp;font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>_done<span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_lock.<span style="color: #006633;">wait</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">return</span> _output<span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #339933;">&lt;</span>I,O<span style="color: #339933;">&gt;</span> O getResult<span style="color: #009900;">&#40;</span>WicketCallback<span style="color: #339933;">&lt;</span>I, O<span style="color: #339933;">&gt;</span> callback, I input<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399; font-weight: bold;">InterruptedException</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;WicketThreadAdapter<span style="color: #339933;">&lt;</span>I,O<span style="color: #339933;">&gt;</span> threadAdapter = <span style="color: #000000; font-weight: bold;">new</span> WicketThreadAdapter<span style="color: #339933;">&lt;</span>I,O<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#40;</span>callback,input<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;threadAdapter.<span style="color: #006633;">start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">return</span> threadAdapter.<span style="color: #006633;">getResult</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li><span style="color: #009900;">&#125;</span></li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>Die WicketThreadAdapter-Klasse wird über die statische Methode getResult(&#8230;) angesprochen und macht folgendes: Es wird ein neuer Thread erzeugt. Im laufenden Thread wird der Callback aufgerufen und der Thread beendet. Das Ergebnis, das im Thread ermittelt wurde, wird als Ergebnis herausgereicht. Kurz: Das Ergebnis wird in einem anderen Thread als dem aktuellen ermittelt und führt so nicht zu Kollisionen mit der laufenden Anwendung.</p>
<p><strong>Der Trick</strong></p>
<p>Das alles führt noch nicht zum Ziel. Wir müssen uns jetzt noch darum kümmern, dass wir die Seite dargestellt bekommen. Dazu benutzten wir die Klasse BaseWicketTester, die sich um alles weitere kümmert. Dort übergeben wir die Seite, die wir darstellen wollen. Dann können wir auf den Inhalt der Seite zugreifen und als Ergebnis zurück liefern. </p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Java(TM) 2 Platform Standard Edition 5.0"><div class="devcodeoverflow"><ol><li><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">de.wicketpraxis.web.blog.pages.questions.email</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.Arrays</span><span style="color: #339933;">;</span></li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.List</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.wicket.markup.html.WebPage</span><span style="color: #339933;">;</span></li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.wicket.markup.html.basic.Label</span><span style="color: #339933;">;</span></li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.wicket.model.IModel</span><span style="color: #339933;">;</span></li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.wicket.model.Model</span><span style="color: #339933;">;</span></li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.wicket.util.tester.BaseWicketTester</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> EmailFromComponentPage <span style="color: #000000; font-weight: bold;">extends</span> WebPage</li><li><span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> EmailFromComponentPage<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;WicketCallback<span style="color: #339933;">&lt;</span><span style="color: #003399; font-weight: bold;">List</span><span style="color: #339933;">&lt;</span><span style="color: #003399; font-weight: bold;">String</span><span style="color: #339933;">&gt;</span>, <span style="color: #003399; font-weight: bold;">String</span><span style="color: #339933;">&gt;</span> callback = <span style="color: #000000; font-weight: bold;">new</span> WicketCallback<span style="color: #339933;">&lt;</span><span style="color: #003399; font-weight: bold;">List</span><span style="color: #339933;">&lt;</span><span style="color: #003399; font-weight: bold;">String</span><span style="color: #339933;">&gt;</span>, <span style="color: #003399; font-weight: bold;">String</span><span style="color: #339933;">&gt;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399; font-weight: bold;">String</span> getResult<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">List</span><span style="color: #339933;">&lt;</span><span style="color: #003399; font-weight: bold;">String</span><span style="color: #339933;">&gt;</span> input<span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">final</span> IModel<span style="color: #339933;">&lt;</span><span style="color: #003399; font-weight: bold;">List</span><span style="color: #339933;">&lt;?</span> <span style="color: #000000; font-weight: bold;">extends</span> <span style="color: #003399; font-weight: bold;">String</span><span style="color: #339933;">&gt;&gt;</span> listModel = Model.<span style="color: #006633;">ofList</span><span style="color: #009900;">&#40;</span>input<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BaseWicketTester tester=<span style="color: #000000; font-weight: bold;">new</span> BaseWicketTester<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tester.<span style="color: #006633;">startPage</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> EmailContentPage<span style="color: #009900;">&#40;</span>listModel<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">return</span> tester.<span style="color: #006633;">getServletResponse</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getDocument</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #003399; font-weight: bold;">String</span> result<span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">try</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result = WicketThreadAdapter.<span style="color: #006633;">getResult</span><span style="color: #009900;">&#40;</span>callback, <span style="color: #003399; font-weight: bold;">Arrays</span>.<span style="color: #006633;">asList</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Klaus&quot;</span>,<span style="color: #0000ff;">&quot;Susi&quot;</span>,<span style="color: #0000ff;">&quot;Bert&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">InterruptedException</span> e<span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result=e.<span style="color: #006633;">getLocalizedMessage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;add<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399; font-weight: bold;">Label</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;email&quot;</span>,result<span style="color: #009900;">&#41;</span>.<span style="color: #006633;">setEscapeModelStrings</span><span style="color: #009900;">&#40;</span><span style="color: #006600; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li><span style="color: #009900;">&#125;</span></li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>Damit das Ergebnis richtig angezeigt wird, teilen wir dem Label &#8220;email&#8221; mit, dass es den Text nicht umschreiben soll.</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="HTML"><div class="devcodeoverflow"><ol><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;</span>Email Form Component<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;Email <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> wicket:<span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;email&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span></li><li><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>Wenn man die Seite aufruft, erhält man dann folgende Darstellung:</p>
<div id="attachment_207" class="wp-caption aligncenter" style="width: 335px"><img src="http://www.wicket-praxis.de/blog/wp-content/uploads/2009/12/wicket-email.png" alt="Ergebnis: Html-E-Mail aus Wicket" title="wicket-email" width="325" height="195" class="size-full wp-image-207" />
<p class="wp-caption-text">Ergebnis: Html-E-Mail aus Wicket</p>
</div>
<p>Wenn man die E-Mail durch Hintergrundprozesse versenden möchte, ist ein eigener Thread unnötig, weil keine WicketApplication-Klasse an den Thread gebunden ist. Dann sollte der Einsatz der BaseWicketTester-Klasse reichen. Es ist allerdings darauf zu achten, dass alles, was in der eigenen Application-Klasse definiert wurde, an dieser Stelle nicht ohne weiteres zur Verfügung steht (z.B. wird der OpenSessionInViewFilter für Spring nicht aufgerufen, die SpringBean-Annotationen sind ebenfalls funktionslos).</p>
<p><strong>Fazit</strong></p>
<p>Auch wenn sicher noch die eine oder andere Anpassung notwendig ist, damit man Komponenten sowohl für die Anwendung als auch für den E-Mail-Versand benutzten kann, lohnt sich der Aufwand, weil man a) auf die vielfältigen Möglichkeiten, die Wicket als &#8220;Template-Engine&#8221; bietet, zurückgreifen kann, b) man sich im besten Fall doppelten Code ersparen kann und c) man keine zweite Lösung einbinden muss. Und wieder hat mich Wicket ein wenig überrascht. Weil es dann doch so einfach ging:)</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F12%2F01%2Fsending-html-email-from-wicket-app%2F&amp;title=E-Mail%20mit%20Wicket%20verschicken&amp;bodytext=W%C3%A4re%20es%20nicht%20praktisch%2C%20wenn%20man%20eine%20E-Mail%20verschicken%20k%C3%B6nnte%2C%20in%20dem%20man%20die%20Komponenten%2C%20die%20man%20f%C3%BCr%20die%20Darstellung%20auf%20der%20Webseite%20verwendet%2C%20auch%20f%C3%BCr%20das%20Erstellen%20der%20E-Mail%20heranziehen%20k%C3%B6nnte.%20Das%20Unterfangen%20ist%20leider%20nicht%20trivial%2C" title="Digg"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F12%2F01%2Fsending-html-email-from-wicket-app%2F" title="Sphinn"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F12%2F01%2Fsending-html-email-from-wicket-app%2F&amp;title=E-Mail%20mit%20Wicket%20verschicken&amp;notes=W%C3%A4re%20es%20nicht%20praktisch%2C%20wenn%20man%20eine%20E-Mail%20verschicken%20k%C3%B6nnte%2C%20in%20dem%20man%20die%20Komponenten%2C%20die%20man%20f%C3%BCr%20die%20Darstellung%20auf%20der%20Webseite%20verwendet%2C%20auch%20f%C3%BCr%20das%20Erstellen%20der%20E-Mail%20heranziehen%20k%C3%B6nnte.%20Das%20Unterfangen%20ist%20leider%20nicht%20trivial%2C" title="del.icio.us"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F12%2F01%2Fsending-html-email-from-wicket-app%2F&amp;t=E-Mail%20mit%20Wicket%20verschicken" title="Facebook"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F12%2F01%2Fsending-html-email-from-wicket-app%2F&amp;title=E-Mail%20mit%20Wicket%20verschicken" title="Mixx"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F12%2F01%2Fsending-html-email-from-wicket-app%2F&amp;title=E-Mail%20mit%20Wicket%20verschicken&amp;annotation=W%C3%A4re%20es%20nicht%20praktisch%2C%20wenn%20man%20eine%20E-Mail%20verschicken%20k%C3%B6nnte%2C%20in%20dem%20man%20die%20Komponenten%2C%20die%20man%20f%C3%BCr%20die%20Darstellung%20auf%20der%20Webseite%20verwendet%2C%20auch%20f%C3%BCr%20das%20Erstellen%20der%20E-Mail%20heranziehen%20k%C3%B6nnte.%20Das%20Unterfangen%20ist%20leider%20nicht%20trivial%2C" title="Google Bookmarks"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
</ul>
</div>
<div id="vgwpixel"></div><h3  class="related_post_title">Andere Beiträge</h3><ul class="related_post"><li>16. Juni 2009 -- <a href="http://www.wicket-praxis.de/blog/2009/06/16/wicket-ohne-template/" title="Wicket ohne Template">Wicket ohne Template</a></li><li>29. April 2011 -- <a href="http://www.wicket-praxis.de/blog/2011/04/29/wicket-back-button-detect/" title="Wicket &#8211; Back Button zuverlässig erkennen">Wicket &#8211; Back Button zuverlässig erkennen</a></li><li>24. Oktober 2010 -- <a href="http://www.wicket-praxis.de/blog/2010/10/24/wicket-mainstream-github-mongodb/" title="Wicket &#8211; Mainstream, Github, MongoDB">Wicket &#8211; Mainstream, Github, MongoDB</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wicket-praxis.de/blog/2009/12/01/sending-html-email-from-wicket-app/feed/</wfw:commentRss>
		<slash:comments>32</slash:comments>
		</item>
		<item>
		<title>Wicket Komponentenübersicht</title>
		<link>http://www.wicket-praxis.de/blog/2009/10/16/wicket-component-overview/</link>
		<comments>http://www.wicket-praxis.de/blog/2009/10/16/wicket-component-overview/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 06:57:45 +0000</pubDate>
		<dc:creator>michael</dc:creator>
				<category><![CDATA[Technologie]]></category>
		<category><![CDATA[Wicket]]></category>
		<category><![CDATA[component]]></category>
		<category><![CDATA[listener]]></category>
		<category><![CDATA[model]]></category>
		<category><![CDATA[overview]]></category>
		<category><![CDATA[target]]></category>

		<guid isPermaLink="false">http://www.wicket-praxis.de/blog/?p=166</guid>
		<description><![CDATA[Ich habe in den letzten Tagen damit angefangen, die verschiedenen Componenten, die Wicket bereits in dem Basisbibliotheken bietet, zu visualisieren. Den ersten Versuch habe ich noch von Hand durchgeführt, um schnell festzustellen, dass man auf diese Weise nicht besonders schnell vorwärts kommt. Der zweite und damit aktuelle Ansatz ist da schon sehr viel versprechend. Es [...]]]></description>
			<content:encoded><![CDATA[<p>Ich habe in den letzten Tagen damit angefangen, die verschiedenen Componenten, die Wicket bereits in dem Basisbibliotheken bietet, zu visualisieren. Den ersten Versuch habe ich noch von Hand durchgeführt, um schnell festzustellen, dass man auf diese Weise nicht besonders schnell vorwärts kommt. Der zweite und damit aktuelle Ansatz ist da schon sehr viel versprechend. Es werden die Wicket-Quellen geparst und alle Klassendefinitionen eingelesen, die Abhängigkeiten untereinander ermittelt, verschiedene Filter angewendet um die Darstellung auf ein Thema einzugrenzen und das ganze dann mit dem dot-Programm aus dem Graphviz-Paket in ein Diagramm umgewandelt.</p>
<p>Die folgenden Grafiken sind das vorläufige Zwischenergebnis. Es ist nicht auszuschließen, dass es Fehler gibt. Für jeden gemeldeten Fehler bin ich daher sehr dankbar, aber auch Anregungen sind natürlich herzlich willkommen.</p>
<div id="attachment_161" class="wp-caption aligncenter" style="width: 460px"><a href="http://www.wicket-praxis.de/blog/wp-content/uploads/2009/10/wicket-comp.gv.jpg"><img class="size-medium wp-image-161" title="wicket-comp.gv" src="http://www.wicket-praxis.de/blog/wp-content/uploads/2009/10/wicket-comp.gv-450x365.jpg" alt="Wicket Kompontenten - Basis" width="450" height="365" /></a>
<p class="wp-caption-text">Wicket Kompontenten &#8211; Basis</p>
</div>
<div id="attachment_162" class="wp-caption aligncenter" style="width: 389px"><a href="http://www.wicket-praxis.de/blog/wp-content/uploads/2009/10/wicket-comp-ext.gv.jpg"><img class="size-medium wp-image-162" title="wicket-comp-ext.gv" src="http://www.wicket-praxis.de/blog/wp-content/uploads/2009/10/wicket-comp-ext.gv-379x450.jpg" alt="Wicket Komponenten inklusive Extensions" width="379" height="450" /></a>
<p class="wp-caption-text">Wicket Komponenten inklusive Extensions</p>
</div>
<div id="attachment_164" class="wp-caption aligncenter" style="width: 460px"><a href="http://www.wicket-praxis.de/blog/wp-content/uploads/2009/10/wicket-model.gv.jpg"><img class="size-medium wp-image-164" title="wicket-model.gv" src="http://www.wicket-praxis.de/blog/wp-content/uploads/2009/10/wicket-model.gv-450x406.jpg" alt="Wicket Modelle" width="450" height="406" /></a>
<p class="wp-caption-text">Wicket Modelle</p>
</div>
<div id="attachment_160" class="wp-caption aligncenter" style="width: 460px"><a href="http://www.wicket-praxis.de/blog/wp-content/uploads/2009/10/wicket-behavior.gv.jpg"><img class="size-medium wp-image-160" title="wicket-behavior.gv" src="http://www.wicket-praxis.de/blog/wp-content/uploads/2009/10/wicket-behavior.gv-450x97.jpg" alt="Wicket Behavior" width="450" height="97" /></a>
<p class="wp-caption-text">Wicket Behavior</p>
</div>
<div id="attachment_163" class="wp-caption aligncenter" style="width: 460px"><a href="http://www.wicket-praxis.de/blog/wp-content/uploads/2009/10/wicket-listener.gv.jpg"><img class="size-medium wp-image-163" title="wicket-listener.gv" src="http://www.wicket-praxis.de/blog/wp-content/uploads/2009/10/wicket-listener.gv-450x219.jpg" alt="Wicket Listener" width="450" height="219" /></a>
<p class="wp-caption-text">Wicket Listener</p>
</div>
<div id="attachment_165" class="wp-caption aligncenter" style="width: 460px"><a href="http://www.wicket-praxis.de/blog/wp-content/uploads/2009/10/wicket-requestTarget.gv.jpg"><img class="size-medium wp-image-165" title="wicket-requestTarget.gv" src="http://www.wicket-praxis.de/blog/wp-content/uploads/2009/10/wicket-requestTarget.gv-450x176.jpg" alt="Wicket RequestTarget" width="450" height="176" /></a>
<p class="wp-caption-text">Wicket RequestTarget</p>
</div>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F10%2F16%2Fwicket-component-overview%2F&amp;title=Wicket%20Komponenten%C3%BCbersicht&amp;bodytext=Ich%20habe%20in%20den%20letzten%20Tagen%20damit%20angefangen%2C%20die%20verschiedenen%20Componenten%2C%20die%20Wicket%20bereits%20in%20dem%20Basisbibliotheken%20bietet%2C%20zu%20visualisieren.%20Den%20ersten%20Versuch%20habe%20ich%20noch%20von%20Hand%20durchgef%C3%BChrt%2C%20um%20schnell%20festzustellen%2C%20dass%20man%20auf%20diese" title="Digg"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F10%2F16%2Fwicket-component-overview%2F" title="Sphinn"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F10%2F16%2Fwicket-component-overview%2F&amp;title=Wicket%20Komponenten%C3%BCbersicht&amp;notes=Ich%20habe%20in%20den%20letzten%20Tagen%20damit%20angefangen%2C%20die%20verschiedenen%20Componenten%2C%20die%20Wicket%20bereits%20in%20dem%20Basisbibliotheken%20bietet%2C%20zu%20visualisieren.%20Den%20ersten%20Versuch%20habe%20ich%20noch%20von%20Hand%20durchgef%C3%BChrt%2C%20um%20schnell%20festzustellen%2C%20dass%20man%20auf%20diese" title="del.icio.us"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F10%2F16%2Fwicket-component-overview%2F&amp;t=Wicket%20Komponenten%C3%BCbersicht" title="Facebook"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F10%2F16%2Fwicket-component-overview%2F&amp;title=Wicket%20Komponenten%C3%BCbersicht" title="Mixx"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F10%2F16%2Fwicket-component-overview%2F&amp;title=Wicket%20Komponenten%C3%BCbersicht&amp;annotation=Ich%20habe%20in%20den%20letzten%20Tagen%20damit%20angefangen%2C%20die%20verschiedenen%20Componenten%2C%20die%20Wicket%20bereits%20in%20dem%20Basisbibliotheken%20bietet%2C%20zu%20visualisieren.%20Den%20ersten%20Versuch%20habe%20ich%20noch%20von%20Hand%20durchgef%C3%BChrt%2C%20um%20schnell%20festzustellen%2C%20dass%20man%20auf%20diese" title="Google Bookmarks"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
</ul>
</div>
<div id="vgwpixel"></div><h3  class="related_post_title">Andere Beiträge</h3><ul class="related_post"><li>15. Juli 2010 -- <a href="http://www.wicket-praxis.de/blog/2010/07/15/wicket-flexibilitat-mit-factories/" title="Wicket &#8211; Flexibilität mit Factories">Wicket &#8211; Flexibilität mit Factories</a></li><li>5. Januar 2010 -- <a href="http://www.wicket-praxis.de/blog/2010/01/05/wicket-lose-koppelung-von-komponenten/" title="Wicket &#8211; lose Koppelung von Komponenten">Wicket &#8211; lose Koppelung von Komponenten</a></li><li>10. Dezember 2009 -- <a href="http://www.wicket-praxis.de/blog/2009/12/10/praxisbuch-wicket-ubersicht/" title="Praxisbuch Wicket &#8211; Übersicht">Praxisbuch Wicket &#8211; Übersicht</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wicket-praxis.de/blog/2009/10/16/wicket-component-overview/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Umfrage : welches Framework benutzt Du?</title>
		<link>http://www.wicket-praxis.de/blog/2009/09/09/umfrage-welches-framework-benutzt-du/</link>
		<comments>http://www.wicket-praxis.de/blog/2009/09/09/umfrage-welches-framework-benutzt-du/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 06:16:41 +0000</pubDate>
		<dc:creator>michael</dc:creator>
				<category><![CDATA[Technologie]]></category>
		<category><![CDATA[Wicket]]></category>

		<guid isPermaLink="false">http://www.wicket-praxis.de/blog/?p=123</guid>
		<description><![CDATA[Ich habe mal eine Umfrage zu diesem Thema eingerichtet und finde die Ergebnisse jetzt schon interessant. Aktuell liegt Grails vor Wicket vor JSF. Ich bin ja mal gespannt, wie sich das weiterentwickelt. Share and Enjoy: Andere BeiträgeNo Related Post]]></description>
			<content:encoded><![CDATA[<p>Ich habe mal eine <a href="http://pollpigeon.com/jsf-grails-wicket/t/25665/" target="_blank">Umfrage</a> zu diesem Thema eingerichtet und finde die Ergebnisse jetzt schon interessant. Aktuell liegt Grails vor Wicket vor JSF. Ich bin ja mal gespannt, wie sich das weiterentwickelt.</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F09%2F09%2Fumfrage-welches-framework-benutzt-du%2F&amp;title=Umfrage%20%3A%20welches%20Framework%20benutzt%20Du%3F&amp;bodytext=Ich%20habe%20mal%20eine%20Umfrage%20zu%20diesem%20Thema%20eingerichtet%20und%20finde%20die%20Ergebnisse%20jetzt%20schon%20interessant.%20Aktuell%20liegt%20Grails%20vor%20Wicket%20vor%20JSF.%20Ich%20bin%20ja%20mal%20gespannt%2C%20wie%20sich%20das%20weiterentwickelt." title="Digg"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F09%2F09%2Fumfrage-welches-framework-benutzt-du%2F" title="Sphinn"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F09%2F09%2Fumfrage-welches-framework-benutzt-du%2F&amp;title=Umfrage%20%3A%20welches%20Framework%20benutzt%20Du%3F&amp;notes=Ich%20habe%20mal%20eine%20Umfrage%20zu%20diesem%20Thema%20eingerichtet%20und%20finde%20die%20Ergebnisse%20jetzt%20schon%20interessant.%20Aktuell%20liegt%20Grails%20vor%20Wicket%20vor%20JSF.%20Ich%20bin%20ja%20mal%20gespannt%2C%20wie%20sich%20das%20weiterentwickelt." title="del.icio.us"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F09%2F09%2Fumfrage-welches-framework-benutzt-du%2F&amp;t=Umfrage%20%3A%20welches%20Framework%20benutzt%20Du%3F" title="Facebook"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F09%2F09%2Fumfrage-welches-framework-benutzt-du%2F&amp;title=Umfrage%20%3A%20welches%20Framework%20benutzt%20Du%3F" title="Mixx"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F09%2F09%2Fumfrage-welches-framework-benutzt-du%2F&amp;title=Umfrage%20%3A%20welches%20Framework%20benutzt%20Du%3F&amp;annotation=Ich%20habe%20mal%20eine%20Umfrage%20zu%20diesem%20Thema%20eingerichtet%20und%20finde%20die%20Ergebnisse%20jetzt%20schon%20interessant.%20Aktuell%20liegt%20Grails%20vor%20Wicket%20vor%20JSF.%20Ich%20bin%20ja%20mal%20gespannt%2C%20wie%20sich%20das%20weiterentwickelt." title="Google Bookmarks"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
</ul>
</div>
<div id="vgwpixel"></div><h3  class="related_post_title">Andere Beiträge</h3><ul class="related_post"><li>No Related Post</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wicket-praxis.de/blog/2009/09/09/umfrage-welches-framework-benutzt-du/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scala vs Java</title>
		<link>http://www.wicket-praxis.de/blog/2009/08/26/scala-vs-java/</link>
		<comments>http://www.wicket-praxis.de/blog/2009/08/26/scala-vs-java/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 07:52:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[scala]]></category>
		<category><![CDATA[Technologie]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.wicket-praxis.de/blog/?p=100</guid>
		<description><![CDATA[Ich habe mir gestern ein Scala-Codebeispiel angesehen, dass Scala-Objekte von und nach JSON konvertieren kann. Ich muss zugeben, dass es ein wenig gedauert hat, bis ich den Code verstanden habe. Das liegt unter anderem daran, dass ich in Scala einfach noch nicht gut genug bin. Der andere wichtigere Punkt ist aber folgender: Wenn man bisher [...]]]></description>
			<content:encoded><![CDATA[<p>Ich habe mir gestern ein Scala-Codebeispiel angesehen, dass Scala-Objekte von und nach JSON konvertieren kann. Ich muss zugeben, dass es ein wenig gedauert hat, bis ich den Code verstanden habe. Das liegt unter anderem daran, dass ich in Scala einfach noch nicht gut genug bin. Der andere wichtigere Punkt ist aber folgender:</p>
<blockquote><p>Wenn man bisher mit einer Reihe von Java-Klassen ein Framework für eine bestimmte Aufgabe entwickelt hat, kann man die selbe Anforderung mit einigen wenigen Scala-Klassen abbilden.</p></blockquote>
<p>Das bedeutet, dass sich die Funktionalität mit sehr viel weniger Code darstellen lässt. Das spiegelt die Befürchtung wieder, dass man mit Scala Code schreiben kann, der schwer zu vestehen ist. Doch dieser erste Anschein trügt. Der Code ist nur um vielfaches dichter und deshalb natürlich schwerer zu verstehen als ähnlich umfangreicher Java-Code. Der funktionsäquivalente Java-Code wäre aber entsprechend umfangreicher und kann im Zweifel schon deshalb nicht ansatzweise so gut überblickt werden. Ich kann es daher nicht nachvollziehen, dass dieser Punkt gegen Scala sprechen soll.</p>
<p>Ich glaube, dass die Entwicklung bei Scala insofern noch am Anfang steht, als dass das Ausloten der Sprachemöglichkeiten und die kreativen Auslegungen der Plattform noch in den Kinderschuhen steckt, gerade wenn man betrachtet, wo wir uns da im Java-Umfeld befinden. Doch diese Kinderschuhe sind bereits jetzt viel größer und der kleine Bub schaut entspannt über die Köpfe seiner Eltern hinweg.</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F08%2F26%2Fscala-vs-java%2F&amp;title=Scala%20vs%20Java&amp;bodytext=Ich%20habe%20mir%20gestern%20ein%20Scala-Codebeispiel%20angesehen%2C%20dass%20Scala-Objekte%20von%20und%20nach%20JSON%20konvertieren%20kann.%20Ich%20muss%20zugeben%2C%20dass%20es%20ein%20wenig%20gedauert%20hat%2C%20bis%20ich%20den%20Code%20verstanden%20habe.%20Das%20liegt%20unter%20anderem%20daran%2C%20dass%20ich%20in%20Scala%20einfac" title="Digg"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F08%2F26%2Fscala-vs-java%2F" title="Sphinn"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F08%2F26%2Fscala-vs-java%2F&amp;title=Scala%20vs%20Java&amp;notes=Ich%20habe%20mir%20gestern%20ein%20Scala-Codebeispiel%20angesehen%2C%20dass%20Scala-Objekte%20von%20und%20nach%20JSON%20konvertieren%20kann.%20Ich%20muss%20zugeben%2C%20dass%20es%20ein%20wenig%20gedauert%20hat%2C%20bis%20ich%20den%20Code%20verstanden%20habe.%20Das%20liegt%20unter%20anderem%20daran%2C%20dass%20ich%20in%20Scala%20einfac" title="del.icio.us"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F08%2F26%2Fscala-vs-java%2F&amp;t=Scala%20vs%20Java" title="Facebook"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F08%2F26%2Fscala-vs-java%2F&amp;title=Scala%20vs%20Java" title="Mixx"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F08%2F26%2Fscala-vs-java%2F&amp;title=Scala%20vs%20Java&amp;annotation=Ich%20habe%20mir%20gestern%20ein%20Scala-Codebeispiel%20angesehen%2C%20dass%20Scala-Objekte%20von%20und%20nach%20JSON%20konvertieren%20kann.%20Ich%20muss%20zugeben%2C%20dass%20es%20ein%20wenig%20gedauert%20hat%2C%20bis%20ich%20den%20Code%20verstanden%20habe.%20Das%20liegt%20unter%20anderem%20daran%2C%20dass%20ich%20in%20Scala%20einfac" title="Google Bookmarks"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
</ul>
</div>
<div id="vgwpixel"></div><h3  class="related_post_title">Andere Beiträge</h3><ul class="related_post"><li>19. Juni 2009 -- <a href="http://www.wicket-praxis.de/blog/2009/06/19/wicket-scala/" title="Wicket und Scala &#8211; der Rückweg ist anstrengend">Wicket und Scala &#8211; der Rückweg ist anstrengend</a></li><li>21. Juli 2009 -- <a href="http://www.wicket-praxis.de/blog/2009/07/21/wicket-saved-the-day/" title="Wicket saved the day">Wicket saved the day</a></li><li>21. Juli 2009 -- <a href="http://www.wicket-praxis.de/blog/2009/07/21/sails-die-scala-version-von-rails-grail/" title="Sails &#8211; die Scala Version von Rails/Grails">Sails &#8211; die Scala Version von Rails/Grails</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wicket-praxis.de/blog/2009/08/26/scala-vs-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sails &#8211; die Scala Version von Rails/Grails</title>
		<link>http://www.wicket-praxis.de/blog/2009/07/21/sails-die-scala-version-von-rails-grail/</link>
		<comments>http://www.wicket-praxis.de/blog/2009/07/21/sails-die-scala-version-von-rails-grail/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 12:19:40 +0000</pubDate>
		<dc:creator>michael</dc:creator>
				<category><![CDATA[scala]]></category>
		<category><![CDATA[Technologie]]></category>
		<category><![CDATA[Wicket]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[sails]]></category>

		<guid isPermaLink="false">http://www.wicket-praxis.de/blog/?p=83</guid>
		<description><![CDATA[Ich habe mir das Scala Webframework Lift angesehen und finde, es ist zu kompliziert. Aber ich habe mir heute morgen auch wieder ein paar Möglichkeiten angesehen, die Scala so bietet und frage mich, ob man nicht (mit etwas Hilfe) ein Stack erstellen könnte, der Scala als Basissprache benutzt und sonst sich aber eher von Rails/Grails [...]]]></description>
			<content:encoded><![CDATA[<p>Ich habe mir das Scala Webframework Lift angesehen und finde, es ist zu kompliziert. Aber ich habe mir heute morgen auch wieder ein paar Möglichkeiten angesehen, die Scala so bietet und frage mich, ob man nicht (mit etwas Hilfe) ein Stack erstellen könnte, der Scala als Basissprache benutzt und sonst sich aber eher von Rails/Grails inspirieren lassen könnte. Für das UI käme natürlich Wicket in Frage.</p>
<p>Ich glaube, das wäre reizvoll, spannend und wichtig: sehr produktiv.</p>
<p>p.s.: wenn es sowas schon gibt, bitte gerne einen Hinweis.</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F07%2F21%2Fsails-die-scala-version-von-rails-grail%2F&amp;title=Sails%20-%20die%20Scala%20Version%20von%20Rails%2FGrails&amp;bodytext=Ich%20habe%20mir%20das%20Scala%20Webframework%20Lift%20angesehen%20und%20finde%2C%20es%20ist%20zu%20kompliziert.%20Aber%20ich%20habe%20mir%20heute%20morgen%20auch%20wieder%20ein%20paar%20M%C3%B6glichkeiten%20angesehen%2C%20die%20Scala%20so%20bietet%20und%20frage%20mich%2C%20ob%20man%20nicht%20%28mit%20etwas%20Hilfe%29%20ein%20Stack%20erstellen%20" title="Digg"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F07%2F21%2Fsails-die-scala-version-von-rails-grail%2F" title="Sphinn"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F07%2F21%2Fsails-die-scala-version-von-rails-grail%2F&amp;title=Sails%20-%20die%20Scala%20Version%20von%20Rails%2FGrails&amp;notes=Ich%20habe%20mir%20das%20Scala%20Webframework%20Lift%20angesehen%20und%20finde%2C%20es%20ist%20zu%20kompliziert.%20Aber%20ich%20habe%20mir%20heute%20morgen%20auch%20wieder%20ein%20paar%20M%C3%B6glichkeiten%20angesehen%2C%20die%20Scala%20so%20bietet%20und%20frage%20mich%2C%20ob%20man%20nicht%20%28mit%20etwas%20Hilfe%29%20ein%20Stack%20erstellen%20" title="del.icio.us"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F07%2F21%2Fsails-die-scala-version-von-rails-grail%2F&amp;t=Sails%20-%20die%20Scala%20Version%20von%20Rails%2FGrails" title="Facebook"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F07%2F21%2Fsails-die-scala-version-von-rails-grail%2F&amp;title=Sails%20-%20die%20Scala%20Version%20von%20Rails%2FGrails" title="Mixx"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F07%2F21%2Fsails-die-scala-version-von-rails-grail%2F&amp;title=Sails%20-%20die%20Scala%20Version%20von%20Rails%2FGrails&amp;annotation=Ich%20habe%20mir%20das%20Scala%20Webframework%20Lift%20angesehen%20und%20finde%2C%20es%20ist%20zu%20kompliziert.%20Aber%20ich%20habe%20mir%20heute%20morgen%20auch%20wieder%20ein%20paar%20M%C3%B6glichkeiten%20angesehen%2C%20die%20Scala%20so%20bietet%20und%20frage%20mich%2C%20ob%20man%20nicht%20%28mit%20etwas%20Hilfe%29%20ein%20Stack%20erstellen%20" title="Google Bookmarks"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
</ul>
</div>
<div id="vgwpixel"></div><h3  class="related_post_title">Andere Beiträge</h3><ul class="related_post"><li>11. Mai 2009 -- <a href="http://www.wicket-praxis.de/blog/2009/05/11/die-ruhe-vor-dem-sturm/" title="Die Ruhe vor dem Sturm">Die Ruhe vor dem Sturm</a></li><li>15. September 2009 -- <a href="http://www.wicket-praxis.de/blog/2009/09/15/migration-zu-wicket-ajax/" title="Migration zu Wicket: Ajax">Migration zu Wicket: Ajax</a></li><li>12. September 2009 -- <a href="http://www.wicket-praxis.de/blog/2009/09/12/entscheidungshilfe-webframework/" title="Entscheidungshilfe Webframework">Entscheidungshilfe Webframework</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wicket-praxis.de/blog/2009/07/21/sails-die-scala-version-von-rails-grail/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Grails Ajax Update zu kompliziert&#8230;</title>
		<link>http://www.wicket-praxis.de/blog/2009/07/21/grails-ajax-update-zu-kompliziert/</link>
		<comments>http://www.wicket-praxis.de/blog/2009/07/21/grails-ajax-update-zu-kompliziert/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 09:03:46 +0000</pubDate>
		<dc:creator>michael</dc:creator>
				<category><![CDATA[Technologie]]></category>
		<category><![CDATA[Wicket]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://www.wicket-praxis.de/blog/?p=79</guid>
		<description><![CDATA[Man lernt ja jeden Tag etwas neues. Gestern habe ich gelernt, dass Grails von Haus aus nur ein Element per Ajax austauschen kann. Man klickt auf einen Link und kann dann z.B. den Inhalt eines DIV-Tags ersetzten, ergänzen oder was auch immer. Das ist alles ganz nett und einfach. Ändert sich aber durch eine Interaktion [...]]]></description>
			<content:encoded><![CDATA[<p>Man lernt ja jeden Tag etwas neues. Gestern habe ich gelernt, dass Grails von Haus aus nur ein Element per Ajax austauschen kann. Man klickt auf einen Link und kann dann z.B. den Inhalt eines DIV-Tags ersetzten, ergänzen oder was auch immer. Das ist alles ganz nett und einfach. Ändert sich aber durch eine Interaktion mehr als ein Element auf der Seite, fängt es an kompliziert zu werden. Wobei kompliziert eigentlich nicht das richtige Wort ist, denn man muss diese <a href="http://weichhold.com/2009/07/20/updating-multiple-page-fragments-with-grails-and-ajax/" target="_blank">fehlende Funktionalität selbst ergänzen</a>.</p>
<p>Es ist unzweifelhaft möglich, so das gewünschte Ziel zu erreichen. Aber ich finde es spannend, dass es eine IMHO derart triviale Anforderung nicht in den &#8220;Grails-Standard&#8221; geschafft hat. In Wicket füge ich die Komponenten, die aktualisiert werden müssen, einfach zu einer Liste hinzu. Ich muss mich nicht darum kümmern, was dann genau passiert.</p>
<p>Festzuhalten bleiben für mich die Punkte, die für mich eher gegen einen Einsatz von Grails sprechen:</p>
<ul>
<li>Ajax Update nur für ein Element möglich.</li>
<li>Spring Security ist pfadbasiert &#8211; das ist IMHO ein extrem limitierter Ansatz.</li>
<li>Taglibs sind kein Ersatz für Komponenten.</li>
</ul>
<p>Grails hat Stärken.. aber ich bezweifle zunehmend, dass in Projekten, die mit Grails angefangen wurden, Grails diese positiven Effekte aus dem Projektstart auch auf lange Sicht ausspielen kann.</p>
<p><strong>Update:</strong></p>
<p>Immerhin habe ich gerade wieder gelernt, dass man Spring Security auch mit Annotationen am Controller benutzen kann, so dass man die Pfade nicht von Hand aktualisieren muss, wenn man etwas umbaut.</p>
<p>Das ich hier vielleicht Wicket und Grails vergleiche, obwohl die beiden Technologien nicht so einfach vergleichbar sind, bezieht sich in dieser Kritik nur auf den View-Layer. Es gibt sehr viele Dinge, die ich recht cool finde, an Grails. Aber um View-Layer bin ich einfach besseres gewohnt.</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F07%2F21%2Fgrails-ajax-update-zu-kompliziert%2F&amp;title=Grails%20Ajax%20Update%20zu%20kompliziert...&amp;bodytext=Man%20lernt%20ja%20jeden%20Tag%20etwas%20neues.%20Gestern%20habe%20ich%20gelernt%2C%20dass%20Grails%20von%20Haus%20aus%20nur%20ein%20Element%20per%20Ajax%20austauschen%20kann.%20Man%20klickt%20auf%20einen%20Link%20und%20kann%20dann%20z.B.%20den%20Inhalt%20eines%20DIV-Tags%20ersetzten%2C%20erg%C3%A4nzen%20oder%20was%20auch%20immer.%20Das%20ist" title="Digg"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F07%2F21%2Fgrails-ajax-update-zu-kompliziert%2F" title="Sphinn"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F07%2F21%2Fgrails-ajax-update-zu-kompliziert%2F&amp;title=Grails%20Ajax%20Update%20zu%20kompliziert...&amp;notes=Man%20lernt%20ja%20jeden%20Tag%20etwas%20neues.%20Gestern%20habe%20ich%20gelernt%2C%20dass%20Grails%20von%20Haus%20aus%20nur%20ein%20Element%20per%20Ajax%20austauschen%20kann.%20Man%20klickt%20auf%20einen%20Link%20und%20kann%20dann%20z.B.%20den%20Inhalt%20eines%20DIV-Tags%20ersetzten%2C%20erg%C3%A4nzen%20oder%20was%20auch%20immer.%20Das%20ist" title="del.icio.us"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F07%2F21%2Fgrails-ajax-update-zu-kompliziert%2F&amp;t=Grails%20Ajax%20Update%20zu%20kompliziert..." title="Facebook"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F07%2F21%2Fgrails-ajax-update-zu-kompliziert%2F&amp;title=Grails%20Ajax%20Update%20zu%20kompliziert..." title="Mixx"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.wicket-praxis.de%2Fblog%2F2009%2F07%2F21%2Fgrails-ajax-update-zu-kompliziert%2F&amp;title=Grails%20Ajax%20Update%20zu%20kompliziert...&amp;annotation=Man%20lernt%20ja%20jeden%20Tag%20etwas%20neues.%20Gestern%20habe%20ich%20gelernt%2C%20dass%20Grails%20von%20Haus%20aus%20nur%20ein%20Element%20per%20Ajax%20austauschen%20kann.%20Man%20klickt%20auf%20einen%20Link%20und%20kann%20dann%20z.B.%20den%20Inhalt%20eines%20DIV-Tags%20ersetzten%2C%20erg%C3%A4nzen%20oder%20was%20auch%20immer.%20Das%20ist" title="Google Bookmarks"><img src="http://www.wicket-praxis.de/blog/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
</ul>
</div>
<div id="vgwpixel"></div><h3  class="related_post_title">Andere Beiträge</h3><ul class="related_post"><li>15. September 2009 -- <a href="http://www.wicket-praxis.de/blog/2009/09/15/migration-zu-wicket-ajax/" title="Migration zu Wicket: Ajax">Migration zu Wicket: Ajax</a></li><li>9. April 2010 -- <a href="http://www.wicket-praxis.de/blog/2010/04/09/wicket-abstractevent-update/" title="Wicket &#8211; AbstractEvent Update">Wicket &#8211; AbstractEvent Update</a></li><li>7. März 2010 -- <a href="http://www.wicket-praxis.de/blog/2010/03/07/wicket-heatmap-ajax-mit-parametern/" title="Wicket Heatmap &#8211; Ajax mit Parametern">Wicket Heatmap &#8211; Ajax mit Parametern</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wicket-praxis.de/blog/2009/07/21/grails-ajax-update-zu-kompliziert/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 75/200 queries in 0.122 seconds using disk: basic
Object Caching 2925/3067 objects using disk: basic

Served from: www.wicket-praxis.de @ 2012-02-06 20:56:42 -->
