<?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; Migration</title>
	<atom:link href="http://www.wicket-praxis.de/blog/category/migration/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>Anfang und Ende</title>
		<link>http://www.wicket-praxis.de/blog/2010/01/02/anfang-und-ende/</link>
		<comments>http://www.wicket-praxis.de/blog/2010/01/02/anfang-und-ende/#comments</comments>
		<pubDate>Sat, 02 Jan 2010 17:28:08 +0000</pubDate>
		<dc:creator>michael</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[JSF]]></category>
		<category><![CDATA[Wicket]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[gwt]]></category>
		<category><![CDATA[next]]></category>

		<guid isPermaLink="false">http://www.wicket-praxis.de/blog/?p=223</guid>
		<description><![CDATA[Ich wünsche allen ein gesundes neues Jahr. 2009 hat sich verabschiedet und 2010 zeigt sich bereits jetzt von seiner besten Seite (wenn man Schnee mag). Ich freue mich auf die vielen spannenden Themen, die das neue Jahr bereithält. Auch wenn es anders kommt, als man sich denkt, wage ich hier doch mal ein paar Vorhersagen. [...]]]></description>
			<content:encoded><![CDATA[<p>Ich wünsche allen ein gesundes neues Jahr. 2009 hat sich verabschiedet und 2010 zeigt sich bereits jetzt von seiner besten Seite (wenn man Schnee mag). Ich freue mich auf die vielen spannenden Themen, die das neue Jahr bereithält.</p>
<p>Auch wenn es anders kommt, als man sich denkt, wage ich hier doch mal ein paar Vorhersagen. Manches davon ist offensichtlich und wird vermutlich schon deshalb nicht eintreten, Anderes ist frei erfunden und hat damit die besten Chancen, zum Volltreffer zu werden.</p>
<p>Nachdem 2009 eigentlich ein Scala-Jahr war, wird es auch 2010 in diesem Bereich interessant bleiben. Zu meiner Überraschung konnte allerdings auch Java durch den Scala-Hype profitieren. Einige fühlten sich wohl durch die Möglichkeiten von Scala entsprechend angestachelt, dass selbst für Dinge wie Scala Traits Implementierungen (z.B. <a href="http://code.google.com/p/java-mixins/">java-mixins</a>) für Java geschrieben wurden. Java ist zwar etwas angestaubt aber eben noch nicht tot. Und was Google mit GWT und Android alles auf Basis von Java anstellt, zeigt deutlich, dass da noch Platz für Innovationen ist. Das bedeutet, dass es auch 2010 nicht verkehrt ist, auf Java zu setzen.</p>
<p>Nachdem JSF 2.0 wie zu erwarten war, nicht alle Probleme, die JSF bis jetzt angesammelt hat, lösen wird, gehe ich davon aus, dass wie schon 2009 immer mehr Projekte auch mit Wicket realisiert werden. Da Wicket als Basis schon sehr ausgereift ist, wird sich der Zustrom an Entwicklern vermutlich eher auf Integrationsthemen auswirken: Web-Worker, Javascript-Frameworks und andere noch unbekannte Entwicklungen. Ich erwarte außerdem (unabhängig von meinem <a href="http://www.wicket-praxis.de/blog/2009/11/03/wicket-theme-css-layout-fur-wicket-anwendungen/">eigenen Teilprojekt</a> auf wicketstuff.org) ein paar Standardvorlagen für Wicket-Projekte.</p>
<p>Nachdem Groovy in der neuesten Version alle Sprachfeatures hat, die für eine saubere Wicket-Integration notwendig sind, wird es auch in diesem Bereich interessant. Die Bedenken, die ich trage, richten sich vielmehr an die Plattform Groovy/Grails an sich. Es gibt Entwicklungen, die bei mir Bauchschmerzen hervorrufen (<a href="http://docs.codehaus.org/display/GROOVY/Groovy+1.7+release+notes">Grape</a> &#8211; Dependency Management als Annotation auf einem Import &#8211; WTF)), die merkwürdig sind und auf die Frage &#8220;Warum?&#8221; vermutlich nur mit einem &#8220;Weil es geht.&#8221; beantwortet werden.</p>
<p>Alles in Allem, es bleibt und wird spannend. Ich wünsche allen (unabhängig von der technologischen Präferenz) ein gutes und erfolgreiches Jahr.</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%2F01%2F02%2Fanfang-und-ende%2F&amp;title=Anfang%20und%20Ende&amp;bodytext=Ich%20w%C3%BCnsche%20allen%20ein%20gesundes%20neues%20Jahr.%202009%20hat%20sich%20verabschiedet%20und%202010%20zeigt%20sich%20bereits%20jetzt%20von%20seiner%20besten%20Seite%20%28wenn%20man%20Schnee%20mag%29.%20Ich%20freue%20mich%20auf%20die%20vielen%20spannenden%20Themen%2C%20die%20das%20neue%20Jahr%20bereith%C3%A4lt.%0D%0A%0D%0AAuch%20wenn%20es%20a" 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%2F01%2F02%2Fanfang-und-ende%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%2F01%2F02%2Fanfang-und-ende%2F&amp;title=Anfang%20und%20Ende&amp;notes=Ich%20w%C3%BCnsche%20allen%20ein%20gesundes%20neues%20Jahr.%202009%20hat%20sich%20verabschiedet%20und%202010%20zeigt%20sich%20bereits%20jetzt%20von%20seiner%20besten%20Seite%20%28wenn%20man%20Schnee%20mag%29.%20Ich%20freue%20mich%20auf%20die%20vielen%20spannenden%20Themen%2C%20die%20das%20neue%20Jahr%20bereith%C3%A4lt.%0D%0A%0D%0AAuch%20wenn%20es%20a" 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%2F01%2F02%2Fanfang-und-ende%2F&amp;t=Anfang%20und%20Ende" 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%2F01%2F02%2Fanfang-und-ende%2F&amp;title=Anfang%20und%20Ende" 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%2F01%2F02%2Fanfang-und-ende%2F&amp;title=Anfang%20und%20Ende&amp;annotation=Ich%20w%C3%BCnsche%20allen%20ein%20gesundes%20neues%20Jahr.%202009%20hat%20sich%20verabschiedet%20und%202010%20zeigt%20sich%20bereits%20jetzt%20von%20seiner%20besten%20Seite%20%28wenn%20man%20Schnee%20mag%29.%20Ich%20freue%20mich%20auf%20die%20vielen%20spannenden%20Themen%2C%20die%20das%20neue%20Jahr%20bereith%C3%A4lt.%0D%0A%0D%0AAuch%20wenn%20es%20a" 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>12. September 2009 -- <a href="http://www.wicket-praxis.de/blog/2009/09/12/entscheidungshilfe-webframework/" title="Entscheidungshilfe Webframework">Entscheidungshilfe Webframework</a></li><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>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></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wicket-praxis.de/blog/2010/01/02/anfang-und-ende/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Praxisbuch Wicket &#8211; Übersicht</title>
		<link>http://www.wicket-praxis.de/blog/2009/12/10/praxisbuch-wicket-ubersicht/</link>
		<comments>http://www.wicket-praxis.de/blog/2009/12/10/praxisbuch-wicket-ubersicht/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 06:58:45 +0000</pubDate>
		<dc:creator>michael</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[JSF]]></category>
		<category><![CDATA[Wicket]]></category>
		<category><![CDATA[mindmap]]></category>
		<category><![CDATA[overview]]></category>
		<category><![CDATA[struktur]]></category>

		<guid isPermaLink="false">http://www.wicket-praxis.de/blog/?p=210</guid>
		<description><![CDATA[Hinterher ist man meistens schlauer, hofft man. Nachdem ich gerade per Twitter auf eine JSF-Mindmap gestoßen bin (dank @ptrthomas), dachte ich mir, dass es hilfreich sein könnte, die Mindmap, die ich mir bei der Arbeit am Buch erstellt habe, auch anderen zur Verfügung zu stellen. Perfektionismus führt manchmal dazu, dass man nie ankommt, daher hier [...]]]></description>
			<content:encoded><![CDATA[<p>Hinterher ist man meistens schlauer, hofft man. Nachdem ich gerade per Twitter auf eine <a href="http://mcatr.blogspot.com/2009/11/jsf-2-mind-map.html" target="_blank">JSF-Mindmap</a> gestoßen bin (dank <a href="http://twitter.com/ptrthomas" target="_blank" rel="nofollow">@ptrthomas</a>), dachte ich mir, dass es hilfreich sein könnte, die Mindmap, die ich mir bei der Arbeit am Buch erstellt habe, auch anderen zur Verfügung zu stellen. Perfektionismus führt manchmal dazu, dass man nie ankommt, daher hier sofort das ungefilterte Ergebnis.</p>
<div id="attachment_211" class="wp-caption aligncenter" style="width: 370px"><a href="http://www.wicket-praxis.de/blog/wp-content/uploads/2009/12/Struktur.png"><img src="http://www.wicket-praxis.de/blog/wp-content/uploads/2009/12/Struktur-360x450.png" alt="Wicket Struktur - Übersicht aus der Arbeit am Buch" title="Wicket Struktur - Übersicht aus der Arbeit am Buch" width="360" height="450" class="size-medium wp-image-211" /></a>
<p class="wp-caption-text">Wicket Struktur &#8211; Übersicht aus der Arbeit am Buch</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%2F12%2F10%2Fpraxisbuch-wicket-ubersicht%2F&amp;title=Praxisbuch%20Wicket%20-%20%C3%9Cbersicht&amp;bodytext=Hinterher%20ist%20man%20meistens%20schlauer%2C%20hofft%20man.%20Nachdem%20ich%20gerade%20per%20Twitter%20auf%20eine%20JSF-Mindmap%20gesto%C3%9Fen%20bin%20%28dank%20%40ptrthomas%29%2C%20dachte%20ich%20mir%2C%20dass%20es%20hilfreich%20sein%20k%C3%B6nnte%2C%20die%20Mindmap%2C%20die%20ich%20mir%20bei%20der%20Arbeit%20am%20Buch%20erstellt%20habe%2C%20auch%20a" 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%2F10%2Fpraxisbuch-wicket-ubersicht%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%2F10%2Fpraxisbuch-wicket-ubersicht%2F&amp;title=Praxisbuch%20Wicket%20-%20%C3%9Cbersicht&amp;notes=Hinterher%20ist%20man%20meistens%20schlauer%2C%20hofft%20man.%20Nachdem%20ich%20gerade%20per%20Twitter%20auf%20eine%20JSF-Mindmap%20gesto%C3%9Fen%20bin%20%28dank%20%40ptrthomas%29%2C%20dachte%20ich%20mir%2C%20dass%20es%20hilfreich%20sein%20k%C3%B6nnte%2C%20die%20Mindmap%2C%20die%20ich%20mir%20bei%20der%20Arbeit%20am%20Buch%20erstellt%20habe%2C%20auch%20a" 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%2F10%2Fpraxisbuch-wicket-ubersicht%2F&amp;t=Praxisbuch%20Wicket%20-%20%C3%9Cbersicht" 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%2F10%2Fpraxisbuch-wicket-ubersicht%2F&amp;title=Praxisbuch%20Wicket%20-%20%C3%9Cbersicht" 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%2F10%2Fpraxisbuch-wicket-ubersicht%2F&amp;title=Praxisbuch%20Wicket%20-%20%C3%9Cbersicht&amp;annotation=Hinterher%20ist%20man%20meistens%20schlauer%2C%20hofft%20man.%20Nachdem%20ich%20gerade%20per%20Twitter%20auf%20eine%20JSF-Mindmap%20gesto%C3%9Fen%20bin%20%28dank%20%40ptrthomas%29%2C%20dachte%20ich%20mir%2C%20dass%20es%20hilfreich%20sein%20k%C3%B6nnte%2C%20die%20Mindmap%2C%20die%20ich%20mir%20bei%20der%20Arbeit%20am%20Buch%20erstellt%20habe%2C%20auch%20a" 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. Oktober 2009 -- <a href="http://www.wicket-praxis.de/blog/2009/10/16/wicket-component-overview/" title="Wicket Komponentenübersicht">Wicket Komponentenübersicht</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/10/praxisbuch-wicket-ubersicht/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Migration zu Wicket: Model</title>
		<link>http://www.wicket-praxis.de/blog/2009/09/22/migration-zu-wicket-model/</link>
		<comments>http://www.wicket-praxis.de/blog/2009/09/22/migration-zu-wicket-model/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 07:30:16 +0000</pubDate>
		<dc:creator>michael</dc:creator>
				<category><![CDATA[Migration]]></category>
		<category><![CDATA[Wicket]]></category>
		<category><![CDATA[detach]]></category>
		<category><![CDATA[model]]></category>

		<guid isPermaLink="false">http://www.wicket-praxis.de/blog/?p=143</guid>
		<description><![CDATA[Wicket ist ein Webframework nach dem MVC-Prinzip. Dabei orientiert sich Wicket in vielen Dingen eher an Grundprinzipien der Anwendungsentwicklung von Desktop-Anwendungen. Eine wesentliche Rolle spielen dabei die Modelle, die in Komponenten benutzt werden und die die Daten liefern, die durch verschiedenen Komponenten zur Anzeige gebracht werden. Dabei gibt es aber gerade in diesem Bereich sehr [...]]]></description>
			<content:encoded><![CDATA[<p>Wicket ist ein Webframework nach dem MVC-Prinzip. Dabei orientiert sich Wicket in vielen Dingen eher an Grundprinzipien der Anwendungsentwicklung von Desktop-Anwendungen. Eine wesentliche Rolle spielen dabei die Modelle, die in Komponenten benutzt werden und die die Daten liefern, die durch verschiedenen Komponenten zur Anzeige gebracht werden. Dabei gibt es aber gerade in diesem Bereich sehr viele Irritationen. Problematisch erweist sich dabei vielleicht der Umstand, dass man auch ohne Modelle zu benutzen, mit Wicket bereits Daten zur Anzeige bringen kann. Man versteht dann erst einmal nicht, wie sich dass von einer Anwendung z.B. in PHP unterscheiden soll. Betrachtet man die Label-Komponente (die häufig für die Darstellung herangezogen wird) näher, stellt man fest, dass auch der Aufruf ohne Model intern dazu führt, dass der Übergabeparameter in ein Model gelegt wird.</p>
<p>In einem kleinen Beispiel möchte ich veranschaulichen, wie die verschiedenen Model-Klassen zum Einsatz kommen können und warum man immer Modelle benutzen sollte.</p>
<p>Wir erstellen zuerst eine Model-Klasse, die eine Liste von Ergebnissen liefert. In diesem Fall werden die Einträge zwar fest kodiert, könnten aber genauso gut aus der Datenbank kommen.</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.migration.model</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> <span style="color: #003399; font-weight: bold;">Result</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: #003399; font-weight: bold;">Double</span> _betrag<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;">Result</span><span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">String</span> name, <span style="color: #006600; font-weight: bold;">double</span> betrag<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;&nbsp;&nbsp;_betrag=betrag<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: #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: #003399; font-weight: bold;">Double</span> getBetrag<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> _betrag<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><!--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.migration.model</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.ArrayList</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.model.LoadableDetachableModel</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> ResultListModel <span style="color: #000000; font-weight: bold;">extends</span> LoadableDetachableModel<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;">Result</span><span style="color: #339933;">&gt;&gt;</span></li><li><span style="color: #009900;">&#123;</span></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: #003399; font-weight: bold;">List</span><span style="color: #339933;">&lt;</span><span style="color: #003399; font-weight: bold;">Result</span><span style="color: #339933;">&gt;</span> load<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: #003399; font-weight: bold;">List</span><span style="color: #339933;">&lt;</span><span style="color: #003399; font-weight: bold;">Result</span><span style="color: #339933;">&gt;</span> ret=<span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399; font-weight: bold;">ArrayList</span><span style="color: #339933;">&lt;</span><span style="color: #003399; font-weight: bold;">Result</span><span style="color: #339933;">&gt;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;ret.<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;">Result</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Popcorn&quot;</span>,<span style="color: #cc66cc;">3.15</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;ret.<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;">Result</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Eis&quot;</span>,<span style="color: #cc66cc;">2.80</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;ret.<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;">Result</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Eintritt&quot;</span>,<span style="color: #cc66cc;">5.50</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: #000000; font-weight: bold;">return</span> ret<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>Das LoadableDetachableModel ist immer dann die beste Wahl, wenn Daten dynamisch erzeugt werden sollen und jedes mal sicher gestellt werden soll, dass die aktuellsten Daten verwendet werden. Wir das Model während eines Request geladen, werden die Daten so lange vorgehalten, bis die detach()-Methode aufgerufen wird, und die Liste zurückgesetzt wird. Das Model liefert uns in diesem Fall 3 Datensätze der Result-Klasse.</p>
<p>Die Beispielliste ist eine Liste von Posten auf einer Rechnung. Wir möchten aber zum Betrag auch noch den MwSt-Anteil ausweisen. Dazu schreiben wir ein allgemeines Model, dass von einer Erweiterung des LoadableDetachableModel abgeleitet ist: <a href="http://www.wicket-praxis.de/blog/2009/01/03/modell-referenzen/">CascadingLoadableDetachableModel</a>.</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.migration.model</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.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.LoadableDetachableModel</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">de.wicketpraxis.web.blog.model.CascadingLoadableDetachableModel</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> MwStAnteilModel <span style="color: #000000; font-weight: bold;">extends</span> CascadingLoadableDetachableModel<span style="color: #339933;">&lt;</span><span style="color: #003399; font-weight: bold;">Double</span>, <span style="color: #003399; font-weight: bold;">Double</span><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;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399; font-weight: bold;">Double</span> MWST=<span style="color: #cc66cc;">19.0</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> MwStAnteilModel<span style="color: #009900;">&#40;</span>IModel<span style="color: #339933;">&lt;?</span> <span style="color: #000000; font-weight: bold;">extends</span> <span style="color: #003399; font-weight: bold;">Double</span><span style="color: #339933;">&gt;</span> parent<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>parent<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: #003399; font-weight: bold;">Double</span> load<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Double</span> brutto<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;&nbsp;&nbsp;font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>brutto<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;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">return</span> brutto<span style="color: #339933;">*</span>MWST/<span style="color: #cc66cc;">100.0</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;">return</span> <span style="color: #006600; font-weight: bold;">null</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>Das Model entnimmt dem referenzierten Model den Betrag und ermittelt den MwSt-Anteil, den es seinerseits bereitstellt. Der Wert wird auch hier bis zum Aufruf von detach() gepuffert. Als Referenzmodell kann jede Klasse dienen, die IModel<Double> implementiert.</p>
<p>Jetzt fügen wir die Bestandteile zusammen:</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.migration.model</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.PropertyListView</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.PropertyModel</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">de.wicketpraxis.web.blog.model.CascadingLoadableDetachableModel</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> SomeModelsPage <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> SomeModelsPage<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;ResultListModel resultList=<span style="color: #000000; font-weight: bold;">new</span> ResultListModel<span style="color: #009900;">&#40;</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> PropertyListView<span style="color: #339933;">&lt;</span><span style="color: #003399; font-weight: bold;">Result</span><span style="color: #339933;">&gt;</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;list&quot;</span>,resultList<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;">Result</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;IModel<span style="color: #339933;">&lt;</span><span style="color: #003399; font-weight: bold;">Result</span><span style="color: #339933;">&gt;</span> model = item.<span style="color: #006633;">getModel</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;&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>,<span style="color: #000000; font-weight: bold;">new</span> PropertyModel<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>model,<span style="color: #0000ff;">&quot;name&quot;</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;&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;betrag&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;&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;mwst&quot;</span>,<span style="color: #000000; font-weight: bold;">new</span> MwStAnteilModel<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> PropertyModel<span style="color: #339933;">&lt;</span><span style="color: #003399; font-weight: bold;">Double</span><span style="color: #339933;">&gt;</span><span style="color: #009900;">&#40;</span>model,<span style="color: #0000ff;">&quot;betrag&quot;</span><span style="color: #009900;">&#41;</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;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;IModel<span style="color: #339933;">&lt;</span><span style="color: #003399; font-weight: bold;">Double</span><span style="color: #339933;">&gt;</span> summeModel = <span style="color: #000000; font-weight: bold;">new</span> CascadingLoadableDetachableModel<span style="color: #339933;">&lt;</span><span style="color: #003399; font-weight: bold;">Double</span>, <span style="color: #003399; font-weight: bold;">List</span><span style="color: #339933;">&lt;</span><span style="color: #003399; font-weight: bold;">Result</span><span style="color: #339933;">&gt;&gt;</span><span style="color: #009900;">&#40;</span>resultList<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: #003399; font-weight: bold;">Double</span> load<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;">Result</span><span style="color: #339933;">&gt;</span> liste<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>liste<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;<span style="color: #006600; font-weight: bold;">double</span> summe=<span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000;&nbsp;&nbsp;font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Result</span> r : liste<span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;&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;&nbsp;&nbsp;summe=summe+r.<span style="color: #006633;">getBetrag</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;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">return</span> summe<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; font-weight: bold;">return</span> <span style="color: #006600; font-weight: bold;">null</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;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;summe&quot;</span>,summeModel<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><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;mwst&quot;</span>,<span style="color: #000000; font-weight: bold;">new</span> MwStAnteilModel<span style="color: #009900;">&#40;</span>summeModel<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;<span style="color: #009900;">&#125;</span></li><li><span style="color: #009900;">&#125;</span></li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>Zuerst erstellen wir eines Instanz des ResultListModel. Die Ergebnisliste wird durch eine PropertyListView dargestellt. Der Unterschied zur ListView-Komponente besteht darin, dass bei Komponenten ohne eigenes Model die Id als Property-Expression herangezogen wird, um das Model für die Anzeige der Daten zu ermitteln. Die Schreibarbeit, die man für das Label &#8220;name&#8221; aufwenden müsste, kann man auf diese Weise erheblich reduzieren. Wie man beim Label mit der Id &#8220;mwst&#8221; erkennen kann, können die Modelle beliebig geschachtelt werden.</p>
<p>Um die Summe aller Einträge zu ermitteln, könnten wir jetzt die Ergebnisliste durchgehen und die Summe berechnen. Doch der Konstruktor einer Komponente wird ja nur einmal aufgerufen. Ändert sich durch eine Aktion auf der Seite oder in einer Komponente etwas an den zugrunde liegenden Daten, dann wird die Summe so nicht automatisch aktualisiert. Daher erstellen wir ein Model, dass diese Berechnung immer wieder durchführt. Dann können wir die aktuelle Summe und auch hierfür den MwSt-Anteil anzeigen lassen. Sollte sich an den Daten in der Datenbank etwas ändern, dann werden automatisch alle angezeigten Werte neu berechnet.</p>
<p>In diesem Beispiel sind mehrere wichtige Themen versteckt:</p>
<ul>
<li>Alle Daten sollten in einem Model abgelegt werden. Daten sollten nicht im Konstruktor einer Komponente aufbereitet werden.</li>
<li>Für Modelle, die nicht an eine Komponente gebunden sind, wird die detach()-Methode <strong>nicht</strong> automatisch aufgerufen. Die CascadingLoadableDetachableModel-Klasse behandelt diesen Umstand entsprechend.</li>
<li>Model-Klassen kann man wiederverwenden.</li>
<li>Das Beispiel veranschaulicht, wie man z.B. die Summe aller sichtbaren Einträge über den Model-Weg ermitteln kann.</li>
</ul>
<p>Ich hoffe, ich konnte wieder etwas Licht in das Dunkel rund um die Model-Klassen bringen. Fragen und Anregungen gerne in dem Kommentaren oder per Email.</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%2F22%2Fmigration-zu-wicket-model%2F&amp;title=Migration%20zu%20Wicket%3A%20Model&amp;bodytext=Wicket%20ist%20ein%20Webframework%20nach%20dem%20MVC-Prinzip.%20Dabei%20orientiert%20sich%20Wicket%20in%20vielen%20Dingen%20eher%20an%20Grundprinzipien%20der%20Anwendungsentwicklung%20von%20Desktop-Anwendungen.%20Eine%20wesentliche%20Rolle%20spielen%20dabei%20die%20Modelle%2C%20die%20in%20Komponenten%20benutzt%20we" 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%2F22%2Fmigration-zu-wicket-model%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%2F22%2Fmigration-zu-wicket-model%2F&amp;title=Migration%20zu%20Wicket%3A%20Model&amp;notes=Wicket%20ist%20ein%20Webframework%20nach%20dem%20MVC-Prinzip.%20Dabei%20orientiert%20sich%20Wicket%20in%20vielen%20Dingen%20eher%20an%20Grundprinzipien%20der%20Anwendungsentwicklung%20von%20Desktop-Anwendungen.%20Eine%20wesentliche%20Rolle%20spielen%20dabei%20die%20Modelle%2C%20die%20in%20Komponenten%20benutzt%20we" 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%2F22%2Fmigration-zu-wicket-model%2F&amp;t=Migration%20zu%20Wicket%3A%20Model" 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%2F22%2Fmigration-zu-wicket-model%2F&amp;title=Migration%20zu%20Wicket%3A%20Model" 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%2F22%2Fmigration-zu-wicket-model%2F&amp;title=Migration%20zu%20Wicket%3A%20Model&amp;annotation=Wicket%20ist%20ein%20Webframework%20nach%20dem%20MVC-Prinzip.%20Dabei%20orientiert%20sich%20Wicket%20in%20vielen%20Dingen%20eher%20an%20Grundprinzipien%20der%20Anwendungsentwicklung%20von%20Desktop-Anwendungen.%20Eine%20wesentliche%20Rolle%20spielen%20dabei%20die%20Modelle%2C%20die%20in%20Komponenten%20benutzt%20we" 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>28. Oktober 2009 -- <a href="http://www.wicket-praxis.de/blog/2009/10/28/wicket-model-transformation/" title="Wicket Model Transformation">Wicket Model Transformation</a></li><li>3. Januar 2009 -- <a href="http://www.wicket-praxis.de/blog/2009/01/03/modell-referenzen/" title="Modell-Referenzen">Modell-Referenzen</a></li><li>4. November 2009 -- <a href="http://www.wicket-praxis.de/blog/2009/11/04/dont-use-property-model-at-all/" title="PropertyModel &#8211; einfach ist nicht immer gut">PropertyModel &#8211; einfach ist nicht immer gut</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wicket-praxis.de/blog/2009/09/22/migration-zu-wicket-model/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Migration zu Wicket: Ajax</title>
		<link>http://www.wicket-praxis.de/blog/2009/09/15/migration-zu-wicket-ajax/</link>
		<comments>http://www.wicket-praxis.de/blog/2009/09/15/migration-zu-wicket-ajax/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 06:29:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Migration]]></category>
		<category><![CDATA[Wicket]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[grails]]></category>

		<guid isPermaLink="false">http://www.wicket-praxis.de/blog/?p=137</guid>
		<description><![CDATA[Einer der Aspekte, die bei meiner Entscheidung für ein neues Webframework eine große Rolle spielten, war die Integration von Ajax. Fast jedes aktuelle Framework bietet eine Unterstützung von Ajax, doch unterscheiden sie sich in Handhabung und Möglichkeit. Die komponentenorientierte Arbeitsweise von Wicket führt dazu, dass eine Wicket-Seite (die Entsprechung einer Webseite), aus einem Komponentenbaum besteht, [...]]]></description>
			<content:encoded><![CDATA[<p>Einer der Aspekte, die bei meiner Entscheidung für ein neues Webframework eine große Rolle spielten, war die Integration von Ajax. Fast jedes aktuelle Framework bietet eine Unterstützung von Ajax, doch unterscheiden sie sich in Handhabung und Möglichkeit.</p>
<p>Die komponentenorientierte Arbeitsweise von Wicket führt dazu, dass eine Wicket-Seite (die Entsprechung einer Webseite), aus einem Komponentenbaum besteht, bei der jede Komponente für ihre Darstellung verantwortlich ist. Daher ist es besonders einfach, den Teil zu identifizieren, der durch die jeweilige Komponente dargestellt wird. Diesen Umstand macht sich Wicket zu nutze, um im Gegensatz zu anderen Frameworks, beliebig viele Bereiche der Webseite aktualisieren zu können.</p>
<p>Im folgenden Beispiel soll das veranschaulicht werden:<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.migration.ajax</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.AjaxFallbackLink</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.WebMarkupContainer</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.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.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.Model</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> AjaxMultiUpdatePage <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> AjaxMultiUpdatePage<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 feedback=<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;feedback.<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>feedback<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #666666; font-style: italic;">// die geschweiften Klammern haben keine Funktion</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #666666; font-style: italic;">// sie sollen nur den Komponentenbaum veranschaulichen</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;WebMarkupContainer block = getBlock<span style="color: #009900;">&#40;</span>feedback,<span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WebMarkupContainer block2 = getBlock<span style="color: #009900;">&#40;</span>feedback,<span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</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;WebMarkupContainer block3 = getBlock<span style="color: #009900;">&#40;</span>feedback,<span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;block2.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>block3<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;block.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>block2<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;add<span style="color: #009900;">&#40;</span>block<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;">private</span> WebMarkupContainer getBlock<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">final</span> FeedbackPanel feedback, <span style="color: #006600; font-weight: bold;">int</span> start<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> WebMarkupContainer block = <span style="color: #000000; font-weight: bold;">new</span> WebMarkupContainer<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ajaxUpdate&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;block.<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;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;Model<span style="color: #339933;">&lt;</span><span style="color: #003399; font-weight: bold;">Integer</span><span style="color: #339933;">&gt;</span> model = Model.<span style="color: #006633;">of</span><span style="color: #009900;">&#40;</span>start<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399; font-weight: bold;">Label</span> label = <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;count&quot;</span>,model<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;label.<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;block.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>label<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;block.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> AjaxFallbackLink<span style="color: #339933;">&lt;</span><span style="color: #003399; font-weight: bold;">Integer</span><span style="color: #339933;">&gt;</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;link&quot;</span>,model<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;setModelObject<span style="color: #009900;">&#40;</span>getModelObject<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>+<span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;info<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Aktualisiere &quot;</span>+getPath<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;&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;target.<span style="color: #006633;">addComponent</span><span style="color: #009900;">&#40;</span>feedback<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>block<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;<span style="color: #666666; font-style: italic;">// ist nicht nötig</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>label<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;<span style="color: #000000; font-weight: bold;">return</span> block<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>Wir fügen der Seite ein FeedbackPanel hinzu. Für jede Komponente, die per Ajax aktualisiert werden soll, muss die <strong>setOutputMarkupId(true)</strong> aufgerufen werden. Dass veranlasst Wicket, in dem Html-Tag dieser Komponente das id-Attribut zu setzen. Das ist notwendig, damit Wicket diesen Tag dann durch neuen Inhalt ersetzen kann.</p>
<p>Als weiteres erzeugen wir einen WebMarkupContainer. Dieses Element dient uns als Rahmen, um die Aktualisierung des ganzen Blocks anstoßen zu können. Als Kindelemente definieren wir zusätzlich ein Label, das den Inhalt eines Modells darstellt, dass wir gleichzeitig in einem AjaxFallbackLink benutzen. Klickt der Nutzer auf den Link, wird der Wert im Modell erhöht und der Block sowie das FeedbackPanel in die Liste der zu aktualisierenden Komponenten aufgenommen. Auch das Label wurde zu dieser Liste hinzugefügt. Allerdings kommt hier bereits eine Optimierung zum Vorschein, die Wicket vornehmen kann, da der Komponentenbaum bekannt ist: Wicket ersetzt den ganzen Block und weiß, dass damit auch das Label aktualisiert wurde, weshalb es nicht gesondert ersetzt werden muss.</p>
<p>Innerhalb eines Blockes fügen wir einen weiteren als Kindelement ein. Das wiederholen wir noch einmal. Wird in dieser Konstellation nun der äußere Block aktualisiert, werden auch alle Kindelemente aktualisiert. Dieses Verhalten kann man überprüfen, in dem man die Kommunikation im WicketAjaxDebug-Fenster betrachtet.</p>
<div id="attachment_139" class="wp-caption aligncenter" style="width: 460px"><a href="http://www.wicket-praxis.de/blog/wp-content/uploads/2009/09/wicket-ajax-debug.jpg"><img class="size-medium wp-image-139" title="wicket-ajax-debug" src="http://www.wicket-praxis.de/blog/wp-content/uploads/2009/09/wicket-ajax-debug-450x266.jpg" alt="Wicket Ajax Debug Window" width="450" height="266" /></a>
<p class="wp-caption-text">Wicket Ajax Debug Window</p>
</div>
<p>Deaktiviert man JavaScript und damit Ajax, dann funktioniert die Seite trotzdem, da dann die ganze Seite neu gerendert wird. Auf diese Weise kann man Webanwendungen mit Ajax-Unterstützung entwickeln, ohne dass man Nutzer, die aus welchen Gründen auch immer JavaScript deaktiviert haben, im Regen stehen lässt.</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>AjaxMultiUpdate<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;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">style</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.<span style="color: #993333;">block</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">dashed</span><span style="color: #00AA00;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">style</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;">h1</span>&gt;</span>Ajax Test<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h1</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;">div</span> wicket:<span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;ajaxUpdate&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;block&quot;</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<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;count&quot;</span>&gt;</span>123<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span> <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>+1<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;&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;ajaxUpdate&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;block&quot;</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<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;count&quot;</span>&gt;</span>123<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span> <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>+1<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;&nbsp;&nbsp;&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;ajaxUpdate&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;block&quot;</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<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;count&quot;</span>&gt;</span>123<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span> <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>+1<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&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>&nbsp;&nbsp;&nbsp;&nbsp;&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>&nbsp;&nbsp;&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>&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>Dieses Beispiel offenbart wesentliche Unterschiede zwischen der Ajax-Integration von Wicket und anderen Frameworks:</p>
<ul>
<li>Wicket kann beliebig viele Komponenten innerhalb eines Request aktualisieren.</li>
<li>Wicket kann die Aktualisierung optimieren.</li>
<li>Auch bei deaktiviertem Javascript ist die Funktion der Anwendung gewährleistet.</li>
</ul>

<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%2F15%2Fmigration-zu-wicket-ajax%2F&amp;title=Migration%20zu%20Wicket%3A%20Ajax&amp;bodytext=Einer%20der%20Aspekte%2C%20die%20bei%20meiner%20Entscheidung%20f%C3%BCr%20ein%20neues%20Webframework%20eine%20gro%C3%9Fe%20Rolle%20spielten%2C%20war%20die%20Integration%20von%20Ajax.%20Fast%20jedes%20aktuelle%20Framework%20bietet%20eine%20Unterst%C3%BCtzung%20von%20Ajax%2C%20doch%20unterscheiden%20sie%20sich%20in%20Handhabung%20und%20M%C3%B6g" 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%2F15%2Fmigration-zu-wicket-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%2F09%2F15%2Fmigration-zu-wicket-ajax%2F&amp;title=Migration%20zu%20Wicket%3A%20Ajax&amp;notes=Einer%20der%20Aspekte%2C%20die%20bei%20meiner%20Entscheidung%20f%C3%BCr%20ein%20neues%20Webframework%20eine%20gro%C3%9Fe%20Rolle%20spielten%2C%20war%20die%20Integration%20von%20Ajax.%20Fast%20jedes%20aktuelle%20Framework%20bietet%20eine%20Unterst%C3%BCtzung%20von%20Ajax%2C%20doch%20unterscheiden%20sie%20sich%20in%20Handhabung%20und%20M%C3%B6g" 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%2F15%2Fmigration-zu-wicket-ajax%2F&amp;t=Migration%20zu%20Wicket%3A%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%2F09%2F15%2Fmigration-zu-wicket-ajax%2F&amp;title=Migration%20zu%20Wicket%3A%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%2F09%2F15%2Fmigration-zu-wicket-ajax%2F&amp;title=Migration%20zu%20Wicket%3A%20Ajax&amp;annotation=Einer%20der%20Aspekte%2C%20die%20bei%20meiner%20Entscheidung%20f%C3%BCr%20ein%20neues%20Webframework%20eine%20gro%C3%9Fe%20Rolle%20spielten%2C%20war%20die%20Integration%20von%20Ajax.%20Fast%20jedes%20aktuelle%20Framework%20bietet%20eine%20Unterst%C3%BCtzung%20von%20Ajax%2C%20doch%20unterscheiden%20sie%20sich%20in%20Handhabung%20und%20M%C3%B6g" 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>21. Juli 2009 -- <a href="http://www.wicket-praxis.de/blog/2009/07/21/grails-ajax-update-zu-kompliziert/" title="Grails Ajax Update zu kompliziert&#8230;">Grails Ajax Update zu kompliziert&#8230;</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/09/15/migration-zu-wicket-ajax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Entscheidungshilfe Webframework</title>
		<link>http://www.wicket-praxis.de/blog/2009/09/12/entscheidungshilfe-webframework/</link>
		<comments>http://www.wicket-praxis.de/blog/2009/09/12/entscheidungshilfe-webframework/#comments</comments>
		<pubDate>Sat, 12 Sep 2009 15:40:57 +0000</pubDate>
		<dc:creator>michael</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[JSF]]></category>
		<category><![CDATA[JSP]]></category>
		<category><![CDATA[Migration]]></category>
		<category><![CDATA[Wicket]]></category>
		<category><![CDATA[compare]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[gwt]]></category>
		<category><![CDATA[jsf]]></category>

		<guid isPermaLink="false">http://www.wicket-praxis.de/blog/?p=127</guid>
		<description><![CDATA[Ich hatte in einem der letzten Beiträge eine Umfrage gestartet, um herauszufinden, welche Frameworks gerade wie intensiv eingesetzt werden. Natürlich ist das Ergebnis der Umfrage nicht mehr als ein Indiz, entspricht aber meinen Erwartungen. Die erste Schwierigkeit, auf die man bei jedem Framework stößt, ist die Frage, ob es das Richtige für die Problemstellung ist. [...]]]></description>
			<content:encoded><![CDATA[<p>Ich hatte in einem der letzten Beiträge eine <a href="http://pollpigeon.com/jsf-grails-wicket/t/25665/" target="_blank">Umfrage</a> gestartet, um herauszufinden, welche Frameworks gerade wie intensiv eingesetzt werden. Natürlich ist das Ergebnis der Umfrage nicht mehr als ein Indiz, entspricht aber meinen Erwartungen.</p>
<p>Die erste Schwierigkeit, auf die man bei jedem Framework stößt, ist die Frage, ob es das Richtige für die Problemstellung ist. Dabei spielen natürlich verschiedene nicht technische Aspekte eine Rolle, die in die Entscheidung mit einfließen sollten. Anbei eine kleine Auswahl von Kriterien, die man in die Entscheidung einfließen lassen sollte:</p>
<ul>
<li>Ist das neue Framework eine Erweiterung meines Portfolios und sind mittel- und langfristig Synergieeffekte zu erwarten?</li>
<li>Ist das neue Framework ein Ersatz für ein anderes im Einsatz befindliches Framework und wie kann eine Migrationsstrategie aussehen?</li>
<li>Mit wieviel neuem muss ich mich beschäftigen? Wie steil ist die Lernkurve?</li>
<li>Gibt es gute Dokumentationen (Bücher, Wiki, gut lesbarer Quelltext, etc.)?</li>
<li>Ist zu erwarten, dass die Verbreitung dieses Frameworks eher zu- oder abnimmt?</li>
</ul>
<p>Das letzten Fragen befassen sich nur mit einem Ausschnitt der Problematik und sind doch schon für sich genommen recht komplex. Diese Fragen kann man allerdings schwer für jemand anderen, sondern meist nur halbwegs gut für sich selbst und seinen Verantwortungsbereich beantworten. Deshalb beziehe ich mich in der folgenden Übersicht eher auf technische und organisatorische Aspekte, die aus den Erfahrungen im Umgang mit diesen Frameworks resultieren und daher natürlich subjektiv sind. Trotzdem glaube ich, dass die Einschätzung eine Hilfe für jeden sein kann, der sich mit den betreffenden Frameworks nicht beschäftigen konnte und sich trotzdem für eins einscheiden muss.</p>
<p><strong>Grails</strong></p>
<p>Grails ist ein an &#8220;Ruby on Rails&#8221; angelegtes Framework, was Groovy als Programmiersprache benutzt. Dinge die für Grails sprechen:</p>
<ul>
<li>Grails bringt alles mit, was man für eine Webanwendung braucht. Datenbank, Services, Präsentation, Ajax, etc.</li>
<li>Es ist einfach, ausgehend von einer Datenbank mit Daten Anwendungen zu entwickeln, die diese Daten pflegen können.</li>
<li>Die Java-Integration in Grails/Groovy ist sehr gut. Man kann als recht einfach auf bestehende Bibliotheken zurückgreifen.</li>
</ul>
<p>Dinge die eher gegen Grails sprechen:</p>
<ul>
<li>Groovy ist eine dynamisch typisierte Sprache. Das hat Auswirkungen auf die IDE-Unterstützung und den Entwicklungsprozess.</li>
<li>Grails benutzt für die verschiedenen Aspekte einer Anwendung etablierte Frameworks, die immer dann hervorscheinen, wenn man ein Problem hat und man sich dann nicht nur mit diesem Framework, sondern vor allem mit der Integration in Groovy beschäftigen muss.</li>
<li>Grailsprojekte tendieren nicht zur Modularisierung. Ein nachträgliches Herauslösen von Funktionalität ist eher schwer.</li>
<li>Wer auf eine gute Ajax-Unterstützung baut, der sollte wissen, dass Grails per Ajax nur einen Block auf der Seite aktualisieren kann. Es gibt Lösungen, die dieses Limit umgehen. Allerdings ist es überraschend, dass diese Lösungen es bisher nicht in den Grails-Kern geschafft haben.</li>
</ul>
<p>Wer mit Grails Anwendung entwickeln möchte, der kann im Moment eigentlich nur auf <a href="http://www.jetbrains.com/idea" rel="nofollow" target="_blank">IDEA</a> und Netbeans als Entwicklungsumgebung zurückgreifen. Mit Grails lassen sich vor allem Probleme gut lösen, die genau in die Grails-Vorgehensweise passen: Datenbank anlegen, Tabellen definieren, Eingabemasken für den Datenzugriff generieren, eigene Ansichten mit eigenen Abfragen erstellen. Das ganze mit ein wenig Ajax würzen. Fertig.</p>
<p>Werden die Anwendungen in der Darstellung komplex, fängt es an, auch in Grails komplexer zu werden (und unterscheidet sich damit nicht von Ruby on Rails). Wenn der Fokus der Entwicklung eher in der Präsentationsschicht liegt, kann sich ein Framework lohnen, dass da seine Stärken hat. Grails ist IMHO vergleichbar mit einem etwas besseren Ansatz als Java Server Pages.</p>
<p>Ein in meinen Augen wichtiger Aspekt ist die fehlende Typsicherheit. Das bedeutet, dass nicht nur der letztmögliche Zeitpunkt, sondern oft auch der frühestmögliche Zeitpunkt, an dem ein Fehler sichtbar wird, der ist, wenn die Anwendung gestartet wurde und die fehlerhafte Funktion das erste mal aufgerufen wird. Dieser Fehler ist dann leicht zu beheben, weil es im Gegensatz zu anderen eher Java-basierten Frameworks keinen Server-Neustart nach sich zieht (meist nicht). Um solche Fehler in den Griff zu bekommen, müsste man dann aber entsprechende Unit-Tests erstellen. Wenn man der Argumentation von <a href="http://jars.de/fun/techie-tv-what-killed-smalltalk-could-kill-ruby-too" target="_blank">Robert Martin</a> folgt, dann ist dieser Ansatz (dem auch jede PHP-Anwendung folgt) nicht mit TDD vereinbar, noch Clean Code ist.</p>
<p>Man kann Grails nutzen, man muss nur wissen, worauf man sich einlässt.</p>
<p><strong>GWT</strong></p>
<p>Im Gegensatz zu Grails benutzt GWT Java als Programmiersprache. GWT unterscheidet sich von allen anderen Frameworks dadurch, dass der Schwerpunkt der Entwicklung von GWT-Anwendungen darin liegt, einen wesentlichen Anteil der Anwendung per Javascript im Browser des Anwenders laufen zu lassen. Wenn man in Grails eine Liste neu sortiert hat, konnte man dieses Ergebnis per Ajax auf der Seite ersetzen lassen. Bei GWT ist es möglich, diese Liste nur im Browser neu zu sortieren, ohne das dadurch eine Verbindung zum Server aufgebaut werden müsste. Man kann komplexe Anwendungen schreiben, die vollständig im Browser laufen und keinerlei Verbindung zum Server aufbauen müssen. Man könnte die selbe Anwendung direkt in Javascript entwickeln.</p>
<p>Da Google GWT für eigenen Anwendungen nutzt, ist der Ansatz, den Google damit verfolgt, recht offensichtlich. Alles, was nicht auf dem Server, sondern im Browser des Users ausgeführt wird, belastet die eigenen Server nicht. Wenn man Probleme dieser Kategorie erwartet, könnte GWT eine Lösung sein. Allerdings bedeutet das, dass der Nutzer ohne aktiviertes Javascript überhaupt nichts zu sehen bekommt.</p>
<p>Anwendungen, die mit GWT entwickelt wurden, verhalten sich eher wie Flash-Anwendungen oder Applets, man kann sie auf beliebigen Seiten einbinden. Das bedeutet aber auch, dass eine Suchmaschine (auch Google in diesem Fall) nichts von der Anwendung sieht. Wer also Webanwendungen entwickeln möchte, die Inhalte auch für Suchmaschinen zur Verfügung stellen oder zu erwarten ist, dass Javascript deaktiviert sein könnte, sollte GWT nicht in Betracht ziehen.</p>
<p>Der GWT-Ansatz fordert natürlich Tribut. Der Entwicklungszyklus ist kompliziert, das der Javacode erst in Javascript kompiliert werden muss. Die Trennung in Client- und Servercode ist nicht ohne Weiteres nachvollziehbar. Die erste eigene Beispielanwendung ist mit Schmerzen verbunden und geht nicht leicht von der Hand.</p>
<p>Wer eher Desktop-orientierte Anwendungen entwickeln möchte, aber das Lastproblem, das man mit GWT lösen könnte, nicht für den anstehenden Themenkomplex als Problem identifiziert hat, der sollte sich vielleicht <a href="http://vaadin.com/home" target="_blank" rel="nofollow">Vaadin</a> ansehen. Der Unterschied zu GWT liegt im wesentlich einfacheren Entwicklungszyklus (der auf die Schmerzen verzichtet) und der bereits vorbereiteten Komponenten, die von Haus aus recht ansprechend aussehen. Vaadin benutzt GWT nur für die Darstellung und ist eher ein serverlastiges Framework. Die Vorteile, die GWT gerade im Lastbereich hat, werden durch Vaadin reduziert.</p>
<p>GWT eignet sich für Webanwendungen immer dann, wenn die Anwendung eher einen Service als Inhalte zur Verfügung stellt. Webanwendungen, die auf Inhalte setzen, die der Nutzer in Suchmaschinen findet und die Verlinkt werden können, eher auf andere Frameworks setzen.</p>
<p><strong>Wicket</strong></p>
<p>Wicket benutzt Java als Programmiersprache. Im Gegensatz zu JSF, Grails und Anderen, werden in den Html-Schnipseln, die für die Darstellung verantwortlich sind, kein Code benutzt. Alles wird mit Java realisiert. Das hört sich im ersten Moment wie ein Nachteil an, erweist sich spätestens bei Benutzung als Vorteil. Auf diese Weise kann man jede beliebige IDE einsetzen und von allen Möglichkeiten profitieren, die eine Entwicklungsumgebung in Bezug auf Java bereitstellt.</p>
<p>Wie bei GWT muss man sich bei allen anderen Aspekten einer Webanwendung mit der Auswahl der richtigen Frameworks beschäftigen und diese auf einander abstimmen. Allerdings kann man sich das ganze auch einfach machen und auf die selbe Frameworks wie Grails setzen. Einzig die Integration muss man selbst bewerkstelligen. Für Wicket gibt es eine gute Integration von Spring und damit Hibernate als Persistenzschicht.</p>
<p>Was Wicket fehlt (möchte man meinen), sind Komponenten, die bereits ein ansprechendes Layout mitbringen. Das ist allerdings auch nicht der Fokus von Wicket. Mit Wicket kann man von klassischen Web-1.0 Anwendungen bis zu Ajax-reichen Desktop-ähnlichen Anwendungen alles umsetzen. Die Komponentenarchitektur macht das ganze beherrschbar, die Anwendungen suchmaschinentauglich zu machen, ist ohne größere Aufwände (vor allen auch nachträglich) möglich.</p>
<p>Im Desktop-Bereich wird die Differenzierung jetzt etwas schwer: Wicket sollte man benutzen, wenn Suchmaschinenoptimierung ein Thema ist und die Anwendung auch ohne Ajax/Javascript funktionieren muss. Wenn man kein Lastproblem erwartet aber auf alle Fälle auf fertige, ansprechende Komponenten zurückgreifen möchte, benutzt man am besten Vaadin. Bei zu erwartenden Lastproblemen kann sich der Einsatz von GWT auszahlen.</p>
<p>Besonders bei Anwendungen die sich irgendwo zwischen Web-1.0 und Desktop befinden, oder einen großen Teil davon abdecken müssen, sollte man Wicket benutzten. Gerade in diesem Bereich kann Wicket seine Stärken ausspielen. Durch den OO-Ansatz von Wicket kann man jederzeit bestehende Komponenten umarbeiten, erweitern, vereinfachen oder aufteilen, so das man nach recht kurzer Zeit ein stabiles Grundgerüst an eigenen Komponenten besitzt, mit denen dann sehr schnell neue Entwicklungen realisiert werden können.</p>
<p><strong>der Rest</strong></p>
<p>Was ist mit den ganzen anderen Frameworks? Bisher konnte ich keine Punkte identifizieren, die nicht eins der erwähnten Frameworks nicht abbilden kann, so dass man auf dieses Framework weiterhin angewiesen ist. Da ich mir nicht alle Frameworks angesehen habe, fehlt natürlich das eine oder andere. In der folgenden Übersicht folgen meine Empfehlungen für eine Migration auf eines der auserwählten Frameworks:</p>
<ul>
<li>JSF: GWT, Vaadin oder Wicket</li>
<li>Tapestry,Struts: Wicket</li>
<li>PHP,JSP: Grails oder Wicket (je nachdem wie komplex da UI wird)</li>
</ul>
<p><strong>Schwere Entscheidung</strong></p>
<p>Jetzt muss man sich nur noch entscheiden. Man sollte sich allerdings die Entscheidung nicht zu schwer machen, wenn man zwischen zwei geeigneten Kandidaten wählen muss. Es dient vielmehr dazu, ein besseres Fundament für die eigenen Entscheidung zu gießen. Wie oft ist man in den letzten Jahren einem Hype gefolgt, um dann feststellen zu müssen, dass es nicht das eine Framework gibt, dass alle Probleme lösen kann. Im Zweifel fährt man besser, wenn man auch einmal &#8220;nein&#8221; sagt und bewusst auf ein Feature verzichtet.</p>
<p><strong>Feedback</strong></p>
<p>Rückmeldungen sind natürlich willkommen. Aspekte, die ich vergessen habe, pflege ich gern ein, ansonsten ist ja genug Platz in den Kommentaren, um die eigene Sichtweise und Erfahrung darzulegen.</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%2F12%2Fentscheidungshilfe-webframework%2F&amp;title=Entscheidungshilfe%20Webframework&amp;bodytext=Ich%20hatte%20in%20einem%20der%20letzten%20Beitr%C3%A4ge%20eine%20Umfrage%20gestartet%2C%20um%20herauszufinden%2C%20welche%20Frameworks%20gerade%20wie%20intensiv%20eingesetzt%20werden.%20Nat%C3%BCrlich%20ist%20das%20Ergebnis%20der%20Umfrage%20nicht%20mehr%20als%20ein%20Indiz%2C%20entspricht%20aber%20meinen%20Erwartungen.%0D%0A%0D%0ADie%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%2F09%2F12%2Fentscheidungshilfe-webframework%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%2F12%2Fentscheidungshilfe-webframework%2F&amp;title=Entscheidungshilfe%20Webframework&amp;notes=Ich%20hatte%20in%20einem%20der%20letzten%20Beitr%C3%A4ge%20eine%20Umfrage%20gestartet%2C%20um%20herauszufinden%2C%20welche%20Frameworks%20gerade%20wie%20intensiv%20eingesetzt%20werden.%20Nat%C3%BCrlich%20ist%20das%20Ergebnis%20der%20Umfrage%20nicht%20mehr%20als%20ein%20Indiz%2C%20entspricht%20aber%20meinen%20Erwartungen.%0D%0A%0D%0ADie%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%2F09%2F12%2Fentscheidungshilfe-webframework%2F&amp;t=Entscheidungshilfe%20Webframework" 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%2F12%2Fentscheidungshilfe-webframework%2F&amp;title=Entscheidungshilfe%20Webframework" 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%2F12%2Fentscheidungshilfe-webframework%2F&amp;title=Entscheidungshilfe%20Webframework&amp;annotation=Ich%20hatte%20in%20einem%20der%20letzten%20Beitr%C3%A4ge%20eine%20Umfrage%20gestartet%2C%20um%20herauszufinden%2C%20welche%20Frameworks%20gerade%20wie%20intensiv%20eingesetzt%20werden.%20Nat%C3%BCrlich%20ist%20das%20Ergebnis%20der%20Umfrage%20nicht%20mehr%20als%20ein%20Indiz%2C%20entspricht%20aber%20meinen%20Erwartungen.%0D%0A%0D%0ADie%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"><img src="http://vg05.met.vgwort.de/na/a7e0a1de3ab9482db72471ef2b2cd721" width="1" height="1" alt=""></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>6. September 2009 -- <a href="http://www.wicket-praxis.de/blog/2009/09/06/migration-zu-wicket/" title="Migration zu Wicket">Migration zu Wicket</a></li><li>2. Januar 2010 -- <a href="http://www.wicket-praxis.de/blog/2010/01/02/anfang-und-ende/" title="Anfang und Ende">Anfang und Ende</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wicket-praxis.de/blog/2009/09/12/entscheidungshilfe-webframework/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Migration zu Wicket : Formulare</title>
		<link>http://www.wicket-praxis.de/blog/2009/09/09/migration-zu-wicket-formulare/</link>
		<comments>http://www.wicket-praxis.de/blog/2009/09/09/migration-zu-wicket-formulare/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 06:08:08 +0000</pubDate>
		<dc:creator>michael</dc:creator>
				<category><![CDATA[Migration]]></category>
		<category><![CDATA[Wicket]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[submit]]></category>

		<guid isPermaLink="false">http://www.wicket-praxis.de/blog/?p=120</guid>
		<description><![CDATA[Formulare sind wesentlicher Bestandteil einer Webanwendung. Doch gerade beim Umstieg von einem anderen Framework kommt es in diesem Bereich zu Irritationen. Warum? Ein wesentlicher Unterschied besteht darin, dass es in Wicket nicht zwingend eine Ergebnisseite geben muss. Ich möchte das an einem Beispiel veranschaulichen. Als erstes erstellen wir eine JavaBean in der das Formular die [...]]]></description>
			<content:encoded><![CDATA[<p>Formulare sind wesentlicher Bestandteil einer Webanwendung. Doch gerade beim Umstieg von einem anderen Framework kommt es in diesem Bereich zu Irritationen. Warum? Ein wesentlicher Unterschied besteht darin, dass es in Wicket nicht zwingend eine Ergebnisseite geben muss. Ich möchte das an einem Beispiel veranschaulichen.</p>
<p>Als erstes erstellen wir eine JavaBean in der das Formular die Daten ablegt:</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.migration.forms</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>Nichts besonderes. Die Bean hat das Attribut &#8220;Name&#8221;. Erstellen wir eine Seite, die über ein Formular diese Bean mit Werten füllt:</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.migration.forms</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;">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.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.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> MinimalFormPage <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> MinimalFormPage<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;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>,<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: #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;">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;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><span style="color: #009900;">&#125;</span></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>Wie wir sehen, wird ein Formular eingebunden und in dieses Formular ein Textfeld für das Attribut benutzt. Damit ist dieses Beispiel funktionsfähig. Es macht nur nicht besonders viel. Was aber gut zu erkennen ist:</p>
<ul>
<li>es wird keine Ergebnisseite benötigt</li>
<li>es muss keine Methode überschrieben werden, um die Eingabedaten in der Bean abzulegen</li>
</ul>
<p>Das Markup ist ebenfalls recht einfach:</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>MinimalFormPage<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;">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;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> <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;Absenden&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></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>Interessant: der Submit-Button hat in diesem Beispiel keine Entsprechung als Wicket-Komponente. Das Formular wird trotzdem abgeschickt.</p>
<p><strong>Komplexes Beispiel</strong></p>
<p>Kommen wir nun zu einem etwas komplexeren Beispiel, dass eine Ergebnisseite verwendet. <strong>Dabei an dieser Stelle nocheinmal der Hinweis: die Ergebnisseite wird verwendet, weil wir das in diesem Beispiel so wollten. </strong>Alles was auf der Ergebnisseite dargestellt werden kann, könnte man auch ganz einfach auf der Seite darstellen, auf der auch das Formular eingebunden ist.</p>
<p>Als erstes erstellen wir die Ergebnisseite:<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.migration.forms</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.PageParameters</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.basic.Label</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> ResultPage <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> ResultPage<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;init<span style="color: #009900;">&#40;</span>name<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> ResultPage<span style="color: #009900;">&#40;</span>PageParameters pageParameters<span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;init<span style="color: #009900;">&#40;</span>pageParameters.<span style="color: #006633;">getString</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;&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> init<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;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;name&quot;</span>,name<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></ol></div></pre><!--END_DEVFMTCODE--></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>ResultPage<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;Name <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;name&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>Die Seite besitzt zwei Konstruktoren. Der erste erwartet einen String als Parameter, der zweite wertet die Seitenparameter aus (wenn die Seite z.B. mit ?Name=klaus aufgerufen wird). Der Wert wird durch das Label zur Anzeige gebracht.</p>
<p>Jetzt die Formularseite:<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.migration.forms</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><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.HashMap</span><span style="color: #339933;">;</span></li><li><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.Map</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.PageParameters</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.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> KomplexFormPage <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> KomplexFormPage<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;add<span style="color: #009900;">&#40;</span><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: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</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>,<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: #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;<span style="color: #666666; font-style: italic;">// Variante 1</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;setResponsePage<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> ResultPage<span style="color: #009900;">&#40;</span>getModelObject<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</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: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #666666; font-style: italic;">// Variante 2</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #003399; font-weight: bold;">Map</span><span style="color: #339933;">&lt;</span><span style="color: #003399; font-weight: bold;">String</span>,<span style="color: #003399; font-weight: bold;">String</span><span style="color: #339933;">&gt;</span> map=<span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399; font-weight: bold;">HashMap</span><span style="color: #339933;">&lt;</span><span style="color: #003399; font-weight: bold;">String</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><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;map.<span style="color: #006633;">put</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Name&quot;</span>, getModelObject<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;setResponsePage<span style="color: #009900;">&#40;</span>ResultPage.<span style="color: #000000; font-weight: bold;">class</span>, <span style="color: #000000; font-weight: bold;">new</span> PageParameters<span style="color: #009900;">&#40;</span>map<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;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #666666; font-style: italic;">// Variante ?</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: #006633;">setRequired</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: #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><span style="color: #009900;">&#125;</span></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>Wir haben in diesem Beispiel ein FeedbackPanel hinzugefügt, da wir auch das Textfeld zum Pflichtfeld gemacht haben. Ohne FeedbackPanel kommt sonst der Hinweis, dass man etwas eingeben muss, nicht zur Anzeige. Ansonsten haben wir die onSubmit-Methode überschrieben, die die Ergebnisseite aufruft. Dabei können wir zum einen eine Instanz der Seite erstellen, in dem wir (vorrausgesetzt es gibt einen passenden Konstruktor) den/die gewünschten Parameter direkt übergeben. Das wir in diesem Beispiel nur ein String übergeben, soll nicht darüber hinwegtäuschen, dass jedes beliebige (also auch weit komplexere) Objekte übergeben werden können.</p>
<p>Die zweite Variante verpackt den Parameter in einen Seitenparameter und springt die Seite dann über eine passende Url an. In diesem Fall werden natürlich die übergebenen Parameter für den Nutzer sichtbar. Das entspricht auch eher dem klassischen Verständnis einer Formularbehandlung in anderen Frameworks. Der Unterschied besteht allerdings schon darin, dass an dieser Stelle die Formularbehandlung bereits abgeschlossen ist und wir nur noch einmal absichtlich auf eine andere Seite springen.</p>
<p>Daher ist die letzte Variante auch nur mit einem Fragezeichen versehen. Wenn nichts dafür spricht, dass man eine wie auch immer geartete Ergebnisseite benötigt, kann man diese auch weglassen. Man sollte vielmehr darauf zurückgreifen, dass man Komponenten ein und ausblendet, wenn man das Formular nach erfolgreichem Ausfüllen nicht mehr anzeigen möchte.</p>
<p><strong>Zusammenfassung</strong></p>
<p>Ich hoffe, ich konnte zeigen, dass man sich vom dem klassischen Konzept einer Formularseite trennen muss und die Formularverarbeitung in Wicket ihre Entsprechung vermutlich eher in Swing findet.</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%2Fmigration-zu-wicket-formulare%2F&amp;title=Migration%20zu%20Wicket%20%3A%20Formulare&amp;bodytext=Formulare%20sind%20wesentlicher%20Bestandteil%20einer%20Webanwendung.%20Doch%20gerade%20beim%20Umstieg%20von%20einem%20anderen%20Framework%20kommt%20es%20in%20diesem%20Bereich%20zu%20Irritationen.%20Warum%3F%20Ein%20wesentlicher%20Unterschied%20besteht%20darin%2C%20dass%20es%20in%20Wicket%20nicht%20zwingend%20eine%20Erge" 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%2Fmigration-zu-wicket-formulare%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%2Fmigration-zu-wicket-formulare%2F&amp;title=Migration%20zu%20Wicket%20%3A%20Formulare&amp;notes=Formulare%20sind%20wesentlicher%20Bestandteil%20einer%20Webanwendung.%20Doch%20gerade%20beim%20Umstieg%20von%20einem%20anderen%20Framework%20kommt%20es%20in%20diesem%20Bereich%20zu%20Irritationen.%20Warum%3F%20Ein%20wesentlicher%20Unterschied%20besteht%20darin%2C%20dass%20es%20in%20Wicket%20nicht%20zwingend%20eine%20Erge" 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%2Fmigration-zu-wicket-formulare%2F&amp;t=Migration%20zu%20Wicket%20%3A%20Formulare" 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%2Fmigration-zu-wicket-formulare%2F&amp;title=Migration%20zu%20Wicket%20%3A%20Formulare" 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%2Fmigration-zu-wicket-formulare%2F&amp;title=Migration%20zu%20Wicket%20%3A%20Formulare&amp;annotation=Formulare%20sind%20wesentlicher%20Bestandteil%20einer%20Webanwendung.%20Doch%20gerade%20beim%20Umstieg%20von%20einem%20anderen%20Framework%20kommt%20es%20in%20diesem%20Bereich%20zu%20Irritationen.%20Warum%3F%20Ein%20wesentlicher%20Unterschied%20besteht%20darin%2C%20dass%20es%20in%20Wicket%20nicht%20zwingend%20eine%20Erge" 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. Dezember 2009 -- <a href="http://www.wicket-praxis.de/blog/2009/12/11/wicket-form-submit-mit-und-ohne-ajax/" title="Wicket Form Submit &#8211; mit und ohne Ajax">Wicket Form Submit &#8211; mit und ohne Ajax</a></li><li>5. Februar 2010 -- <a href="http://www.wicket-praxis.de/blog/2010/02/05/wicket-combined-autocomplete-behavoir/" title="Wicket &#8211; kombiniertes AutoCompleteBehavoir ">Wicket &#8211; kombiniertes AutoCompleteBehavoir </a></li><li>2. September 2009 -- <a href="http://www.wicket-praxis.de/blog/2009/09/02/form-checkgroup-database/" title="Datenbankeinträge auswählen mit der CheckGroup">Datenbankeinträge auswählen mit der CheckGroup</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wicket-praxis.de/blog/2009/09/09/migration-zu-wicket-formulare/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Migration zu Wicket</title>
		<link>http://www.wicket-praxis.de/blog/2009/09/06/migration-zu-wicket/</link>
		<comments>http://www.wicket-praxis.de/blog/2009/09/06/migration-zu-wicket/#comments</comments>
		<pubDate>Sun, 06 Sep 2009 14:15:53 +0000</pubDate>
		<dc:creator>michael</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Migration]]></category>
		<category><![CDATA[Wicket]]></category>
		<category><![CDATA[jsf]]></category>
		<category><![CDATA[JSP]]></category>

		<guid isPermaLink="false">http://www.wicket-praxis.de/blog/?p=114</guid>
		<description><![CDATA[Als ich mit Wicket angefangen habe, hatte ich schon mit verschiedenen anderen Technologien gearbeitet. Ich war also keine Neueinsteiger sondern hatte bereits einige Erfahrungen hinter mir. In dieser Situation entstehen automatisch Fragestellungen, die sich damit beschäftigen, wie man bekannte Probleme neu mit Wicket lösen würde und wie diese Lösungen im Vergleich zu den bestehenden Altlösungen [...]]]></description>
			<content:encoded><![CDATA[<p>Als ich mit Wicket angefangen habe, hatte ich schon mit verschiedenen anderen Technologien gearbeitet. Ich war also keine Neueinsteiger sondern hatte bereits einige Erfahrungen hinter mir. In dieser Situation entstehen automatisch Fragestellungen, die sich damit beschäftigen, wie man bekannte Probleme neu mit Wicket lösen würde und wie diese Lösungen im Vergleich zu den bestehenden Altlösungen zu bewerten sind.</p>
<p>Er größte Fehler, den man bei einem Wechsel zu Wicket (und vermutlich bei jedem Wechsel einer Technologie) macht, besteht darin, das man versucht ein altes Problem mit neuer Technik auf alte Weise zu lösen. Das kann nicht funktionieren.</p>
<p><strong>Beispiel</strong></p>
<p>Wenn man Webanwendungen mit JSF, JSP, Struts oder anderen Frameworks entwickelt, tendiert man dazu, dass der Anwendungszustand zu einem wesentlichen Teil über Seitenparameter transportiert wird. Das hat verschiedene Ursachen (z.B. Suchmaschinenoptimierung, Seitenpufferung). Seiten, die besonders häufig abgerufen wurden, sollten gepuffert werden können. Das heißt, für eine bestimmte Url erhielt man immer den selben Inhalt. Es wurde teilweise ohne jede Nutzersession gearbeitet.</p>
<p>Diese Anforderung ist mit Wicket lösbar, aber der falsche Weg. Zu behaupten, es ginge mit Wicket spontan ganz einfach, ist aber ebenso falsch. Doch der Weg zu einer guten Lösung ist nicht weit. Als aller erstes musste ich mich davon verabschieden, dass eine Wicketseite (die auch Ajax verwendet) gepuffert werden kann. Wenn das Erstellen von Teilen der Seite zu zeitaufwendig ist, muss man durch das Puffern von Ergebnissen dem ganzen entgegenwirken. Aber im Unterschied zur alten Lösung wird nicht mehr die ganze Seite, sondern nur noch die Daten der nötigen Teilergebnisse gepuffert. Das ist auch sehr viele Arten sehr viel geschickter.</p>
<p><strong>Ausblick</strong></p>
<p>Dieses erste Beispiel veranschaulicht sehr gut, warum es gut ist, sich gerade auch mit den Grundlagen von Wicket zu beschäftigen. Ich den nächsten Artikeln werde ich weitere Beispiele erläutern und aufzeigen, wie man von der alten Lösung für ein Problem zu einer neuen Lösung mit Wicket kommt. </p>
<p>Wer möchte, kann mir seine Fragestellung zukommen lassen. Ich kann diese Fragestellungen dann in die Artikel einfließen lassen.</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%2F06%2Fmigration-zu-wicket%2F&amp;title=Migration%20zu%20Wicket&amp;bodytext=Als%20ich%20mit%20Wicket%20angefangen%20habe%2C%20hatte%20ich%20schon%20mit%20verschiedenen%20anderen%20Technologien%20gearbeitet.%20Ich%20war%20also%20keine%20Neueinsteiger%20sondern%20hatte%20bereits%20einige%20Erfahrungen%20hinter%20mir.%20In%20dieser%20Situation%20entstehen%20automatisch%20Fragestellungen%2C%20di" 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%2F06%2Fmigration-zu-wicket%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%2F06%2Fmigration-zu-wicket%2F&amp;title=Migration%20zu%20Wicket&amp;notes=Als%20ich%20mit%20Wicket%20angefangen%20habe%2C%20hatte%20ich%20schon%20mit%20verschiedenen%20anderen%20Technologien%20gearbeitet.%20Ich%20war%20also%20keine%20Neueinsteiger%20sondern%20hatte%20bereits%20einige%20Erfahrungen%20hinter%20mir.%20In%20dieser%20Situation%20entstehen%20automatisch%20Fragestellungen%2C%20di" 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%2F06%2Fmigration-zu-wicket%2F&amp;t=Migration%20zu%20Wicket" 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%2F06%2Fmigration-zu-wicket%2F&amp;title=Migration%20zu%20Wicket" 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%2F06%2Fmigration-zu-wicket%2F&amp;title=Migration%20zu%20Wicket&amp;annotation=Als%20ich%20mit%20Wicket%20angefangen%20habe%2C%20hatte%20ich%20schon%20mit%20verschiedenen%20anderen%20Technologien%20gearbeitet.%20Ich%20war%20also%20keine%20Neueinsteiger%20sondern%20hatte%20bereits%20einige%20Erfahrungen%20hinter%20mir.%20In%20dieser%20Situation%20entstehen%20automatisch%20Fragestellungen%2C%20di" 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>12. September 2009 -- <a href="http://www.wicket-praxis.de/blog/2009/09/12/entscheidungshilfe-webframework/" title="Entscheidungshilfe Webframework">Entscheidungshilfe Webframework</a></li><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>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></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wicket-praxis.de/blog/2009/09/06/migration-zu-wicket/feed/</wfw:commentRss>
		<slash:comments>0</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 53/132 queries in 0.153 seconds using disk: basic
Object Caching 2236/2321 objects using disk: basic

Served from: www.wicket-praxis.de @ 2012-02-06 18:33:03 -->
