You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2008/04/02 02:45:09 UTC
svn commit: r643668 - in /tapestry/tapestry5/trunk/tapestry-core/src:
main/resources/org/apache/tapestry/tapestry.js test/app1/FormInjectorDemo.tml
Author: hlship
Date: Tue Apr 1 17:45:08 2008
New Revision: 643668
URL: http://svn.apache.org/viewvc?rev=643668&view=rev
Log:
TAPESTRY-2322: FormInjector doesn't work properly if the content contains multiple elements
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/tapestry.js
tapestry/tapestry5/trunk/tapestry-core/src/test/app1/FormInjectorDemo.tml
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/tapestry.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/tapestry.js?rev=643668&r1=643667&r2=643668&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/tapestry.js (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/tapestry.js Tue Apr 1 17:45:08 2008
@@ -866,9 +866,7 @@
var newElement = new Element(this.element.tagName);
- newElement.innerHTML = reply.content;
-
- // Insert the new content before or after the existing element.
+ // Insert the new element before or after the existing element.
var param = { };
var key = this.below ? "after" : "before";
@@ -878,13 +876,18 @@
this.element.insert(param);
- // Add some animation
+ // Update the empty element with the content from the server
- this.showFunc(newElement);
+ newElement.update(reply.content);
// Handle any scripting issues.
Tapestry.processScriptInReply(reply);
+
+ // Add some animation to reveal it all.
+
+ this.showFunc(newElement);
+
}.bind(this);
new Ajax.Request(this.url, { onSuccess : successHandler });
Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/app1/FormInjectorDemo.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app1/FormInjectorDemo.tml?rev=643668&r1=643667&r2=643668&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/app1/FormInjectorDemo.tml (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/app1/FormInjectorDemo.tml Tue Apr 1 17:45:08 2008
@@ -13,9 +13,11 @@
</t:block>
- <div t:id="forminjector" class="t-beaneditor-row">
- <a href="#" id="addnewrow">Add a row</a>
- </div>
+ <ul>
+ <li t:id="forminjector" class="t-beaneditor-row">
+ <a href="#" id="addnewrow">Add a row</a>
+ </li>
+ </ul>
<div class="t-beaneditor-row">
<input type="submit" value="Sum up the values"/>