From 9542de73aad798295e1d042b562bc21edbbd2ea3 Mon Sep 17 00:00:00 2001 From: Musachy Barroso Date: Mon, 28 May 2007 21:38:46 +0000 Subject: [PATCH] Fix hangman example to use Dojo plugin tags git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@542323 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/webapp/hangman/hangmanAjax.ftl | 25 ++++++++----------- .../showcase/src/main/webapp/hangman/test.ftl | 2 +- .../hangman/updateCharacterAvailable.ftl | 8 +++--- 3 files changed, 15 insertions(+), 20 deletions(-) diff --git a/apps/showcase/src/main/webapp/hangman/hangmanAjax.ftl b/apps/showcase/src/main/webapp/hangman/hangmanAjax.ftl index 379a2babf..ab84cf9ad 100644 --- a/apps/showcase/src/main/webapp/hangman/hangmanAjax.ftl +++ b/apps/showcase/src/main/webapp/hangman/hangmanAjax.ftl @@ -2,7 +2,7 @@ Showcase - Hangman - <@s.head theme="ajax" debug="false" /> + <@sx.head /> @@ -17,14 +17,13 @@ } var _listeners = { - guessMade: function(sourceId, type) { - if(type == "before") { - this.guessMadeFunc(sourceId); - this.updateCharacterAvailable(sourceId); - this.updateVocab(sourceId); - this.updateScaffold(sourceId); - this.updateGuessLeft(sourceId); - } + guessMade: function(request, widget) { + var sourceId = widget.widgetId; + this.guessMadeFunc(sourceId); + this.updateCharacterAvailable(sourceId); + this.updateVocab(sourceId); + this.updateScaffold(sourceId); + this.updateGuessLeft(sourceId); }, guessMadeFunc: function(sourceId) { var requestAttr = { character: sourceId }; @@ -216,13 +215,11 @@ <@s.url id="spacerUrl" value="/hangman/images/letter-spacer.png" /> <@s.url id="blankUrl" value="ajax/blank.action" includeContext="false" /> - <@s.a theme="ajax" - href="%{blankUrl}" - id="%{#currentCharacter}" - notifyTopics="topicGuessMade" + <@sx.a id="%{#currentCharacter}" + beforeNotifyTopics="topicGuessMade" showErrorTransportText="true"> " width="36" border="0" /> - + diff --git a/apps/showcase/src/main/webapp/hangman/test.ftl b/apps/showcase/src/main/webapp/hangman/test.ftl index 0c90ec3d2..80dc5e61b 100644 --- a/apps/showcase/src/main/webapp/hangman/test.ftl +++ b/apps/showcase/src/main/webapp/hangman/test.ftl @@ -1,7 +1,7 @@ - <@s.head theme="ajax" debug="true" /> + <@sx.head /> diff --git a/apps/showcase/src/main/webapp/hangman/updateCharacterAvailable.ftl b/apps/showcase/src/main/webapp/hangman/updateCharacterAvailable.ftl index a51909d12..84281d0fe 100644 --- a/apps/showcase/src/main/webapp/hangman/updateCharacterAvailable.ftl +++ b/apps/showcase/src/main/webapp/hangman/updateCharacterAvailable.ftl @@ -22,13 +22,11 @@ <@s.url id="spacerUrl" value="/hangman/images/letter-spacer.png" /> <@s.url id="blankUrl" value="ajax/blank.action" includeContext="false" /> - <@s.a theme="ajax" - id="%{#currentCharacter}" - href="%{blankUrl}" - notifyTopics="topicGuessMade" + <@sx.a id="%{#currentCharacter}" + afterNotifyTopics="topicGuessMade" showErrorTransportText="true"> " width="36" border="0" /> - + <#-- " >