You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2014/10/11 01:30:30 UTC
git commit: Remove the FormInjector component
Repository: tapestry-5
Updated Branches:
refs/heads/master 3ed6c858c -> c501986cb
Remove the FormInjector component
Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/c501986c
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/c501986c
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/c501986c
Branch: refs/heads/master
Commit: c501986cb31a17259002a4507b2ce484f1860898
Parents: 3ed6c85
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Fri Oct 10 16:30:20 2014 -0700
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Fri Oct 10 16:30:20 2014 -0700
----------------------------------------------------------------------
54_RELEASE_NOTES.md | 8 +-
.../tapestry5/ComponentParameterConstants.java | 9 +-
.../corelib/components/AjaxFormLoop.java | 28 +++-
.../tapestry5/corelib/components/Form.java | 5 +-
.../corelib/components/FormInjector.java | 163 -------------------
.../corelib/internal/InternalFormSupport.java | 3 -
.../services/ClientBehaviorSupportImpl.java | 4 +-
.../internal/services/RequestConstants.java | 5 +-
.../apache/tapestry5/services/FormSupport.java | 6 +-
.../tapestry5/integration/app1/AjaxTests.java | 4 +-
.../integration/app1/data/DoubleItem.java | 5 +-
.../org/example/upload/pages/Ajaxified.java | 6 +-
tapestry-upload/src/test/webapp/Ajaxified.tml | 10 +-
13 files changed, 49 insertions(+), 207 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/c501986c/54_RELEASE_NOTES.md
----------------------------------------------------------------------
diff --git a/54_RELEASE_NOTES.md b/54_RELEASE_NOTES.md
index 3d864de..f218254 100644
--- a/54_RELEASE_NOTES.md
+++ b/54_RELEASE_NOTES.md
@@ -481,4 +481,10 @@ of that mutable field would not always be preserved in the serialized object dat
The ContentType objects, used to represent a content types such as "text/html" in a structured manner,
has been revised significantly in 5.4; it is now an immutable data type. In addition, a few scattered
-interfaces that used a String content type have been changed to use the ContentType class instead.
\ No newline at end of file
+interfaces that used a String content type have been changed to use the ContentType class instead.
+
+## FormInjector Removed
+
+The FormInjector component was removed; it was intended for use only inside the AjaxFormLoop component
+(which was rewritten in 5.4 and no longer uses FormInjector). FormInjector was not widely used elsewhere, if
+is was used at all.
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/c501986c/tapestry-core/src/main/java/org/apache/tapestry5/ComponentParameterConstants.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/ComponentParameterConstants.java b/tapestry-core/src/main/java/org/apache/tapestry5/ComponentParameterConstants.java
index 151f523..094befa 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/ComponentParameterConstants.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/ComponentParameterConstants.java
@@ -1,5 +1,3 @@
-// Copyright 2011, 2012 The Apache Software Foundation
-//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
@@ -73,13 +71,16 @@ public class ComponentParameterConstants
/**
* The default position where to insert content into {@link org.apache.tapestry5.corelib.components.Form}.
* Defaults to "above".
+ * @deprecated Deprecated in 5.4 with no replacement.
*/
public static final String FORMINJECTOR_INSERT_POSITION = "tapestry.components.forminjector_insert_position";
/**
- * The default name for a JS function to use to show the injected content by
- * {@link org.apache.tapestry5.corelib.components.FormInjector}.
+ * The default name for a JS function to use to show the injected content by the (removed in 5.4) FormInjector
+ * component.
+ *
* Defaults to "highlight".
+ * @deprecated Deprecated in 5.4 with no replacement.
*/
public static final String FORMINJECTOR_SHOW_FUNCTION = "tapestry.components.forminjector_show_function";
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/c501986c/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/AjaxFormLoop.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/AjaxFormLoop.java b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/AjaxFormLoop.java
index 1a58a91..3f394cf 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/AjaxFormLoop.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/AjaxFormLoop.java
@@ -22,6 +22,7 @@ import org.apache.tapestry5.ioc.services.TypeCoercer;
import org.apache.tapestry5.json.JSONObject;
import org.apache.tapestry5.services.*;
import org.apache.tapestry5.services.ajax.AjaxResponseRenderer;
+import org.apache.tapestry5.services.compatibility.DeprecationWarning;
import org.apache.tapestry5.services.javascript.JavaScriptSupport;
import java.util.Collections;
@@ -51,7 +52,6 @@ import java.util.Iterator;
* @see AddRowLink
* @see RemoveRowLink
* @see Loop
- * @see FormInjector
*/
@Events(
{EventConstants.ADD_ROW, EventConstants.REMOVE_ROW})
@@ -81,8 +81,10 @@ public class AjaxFormLoop
/**
* Name of a function on the client-side Tapestry.ElementEffect object that is invoked to make added content
- * visible. This is used with the {@link FormInjector} component, when adding a new row to the loop. Leaving as
+ * visible. This was used by the FormInjector component (remove in 5.4), when adding a new row to the loop. Leaving as
* null uses the default function, "highlight".
+ *
+ * @deprecated Deprecated in 5.4 with no replacement.
*/
@Parameter(defaultPrefix = BindingConstants.LITERAL)
private String show;
@@ -98,7 +100,7 @@ public class AjaxFormLoop
private Object[] context;
/**
- * A block to render after the loop as the body of the {@link org.apache.tapestry5.corelib.components.FormInjector}.
+ * A block to render after the loo
* This typically contains a {@link org.apache.tapestry5.corelib.components.AddRowLink}.
*/
@Parameter(value = "block:defaultAddRow", defaultPrefix = BindingConstants.LITERAL)
@@ -144,7 +146,7 @@ public class AjaxFormLoop
private JavaScriptSupport jsSupport;
private Iterator iterator;
-
+
private Element wrapper;
@Inject
@@ -156,6 +158,14 @@ public class AjaxFormLoop
@Inject
private AjaxResponseRenderer ajaxResponseRenderer;
+ @Inject
+ private DeprecationWarning deprecationWarning;
+
+ void pageLoaded()
+ {
+ deprecationWarning.ignoredComponentParameters(resources, "show");
+ }
+
ValueEncoder defaultEncoder()
{
return defaultProvider.defaultValueEncoder("value", resources);
@@ -321,12 +331,12 @@ public class AjaxFormLoop
// Fix for TAP5-227 - AjaxFormLoop dont work well inside a table tag
Element element = writer.getElement();
this.wrapper = element.getAttribute("data-container-type") != null
- || element.getAttribute("data-remove-row-url") != null
- || element.getAttribute("data-inject-row-url") != null ? writer.element("div") : null;
-
+ || element.getAttribute("data-remove-row-url") != null
+ || element.getAttribute("data-inject-row-url") != null ? writer.element("div") : null;
+
writer.attributes("data-container-type", "core/AjaxFormLoop",
- "data-remove-row-url", removeRowLink,
- "data-inject-row-url", injectRowLink);
+ "data-remove-row-url", removeRowLink,
+ "data-inject-row-url", injectRowLink);
}
private void pushContext()
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/c501986c/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Form.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Form.java b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Form.java
index 8625439..78d5615 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Form.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Form.java
@@ -408,8 +408,7 @@ public class Form implements ClientElement, FormValidationControl
/**
* Creates an {@link org.apache.tapestry5.corelib.internal.InternalFormSupport} for
- * this Form. This method is used
- * by {@link org.apache.tapestry5.corelib.components.FormInjector}.
+ * this Form.
* <p/>
* This method may also be invoked as the handler for the "internalCreateRenderTimeFormSupport" event.
*
@@ -701,7 +700,7 @@ public class Form implements ClientElement, FormValidationControl
if (!request.getMethod().equals("POST") || values == null)
throw new RuntimeException(messages.format("core-invalid-form-request", FORM_DATA));
- // Due to Ajax (FormInjector) there may be multiple values here, so
+ // Due to Ajax there may be multiple values here, so
// handle each one individually.
for (String clientEncodedActions : values)
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/c501986c/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/FormInjector.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/FormInjector.java b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/FormInjector.java
deleted file mode 100644
index 7e53d9d..0000000
--- a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/FormInjector.java
+++ /dev/null
@@ -1,163 +0,0 @@
-// Copyright 2008, 2009, 2010, 2011, 2012 The Apache Software Foundation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package org.apache.tapestry5.corelib.components;
-
-import org.apache.tapestry5.*;
-import org.apache.tapestry5.annotations.Environmental;
-import org.apache.tapestry5.annotations.Events;
-import org.apache.tapestry5.annotations.Parameter;
-import org.apache.tapestry5.annotations.SupportsInformalParameters;
-import org.apache.tapestry5.corelib.data.InsertPosition;
-import org.apache.tapestry5.dom.Element;
-import org.apache.tapestry5.internal.services.RequestConstants;
-import org.apache.tapestry5.ioc.annotations.Inject;
-import org.apache.tapestry5.json.JSONObject;
-import org.apache.tapestry5.services.ClientBehaviorSupport;
-import org.apache.tapestry5.services.FormSupport;
-import org.apache.tapestry5.services.ajax.AjaxResponseRenderer;
-import org.apache.tapestry5.services.ajax.JSONCallback;
-import org.apache.tapestry5.services.javascript.JavaScriptSupport;
-
-import java.io.IOException;
-
-/**
- * A way to add new content to an existing Form. The FormInjector emulates its tag from the template (or uses a
- * <div>). When triggered, new content is obtained from the application and is injected before or after the
- * element.
- * <p/>
- * On the client side, a new function, trigger(), is added to the element. Invoking this client-side function will
- * trigger the FormInjector; a request is sent to the server, new content is generated, and the new content is placed
- * before or after (per configuration) the existing FormInjector element.
- *
- * @tapestrydoc
- */
-@SupportsInformalParameters
-@Events(EventConstants.ACTION)
-public class FormInjector implements ClientElement
-{
- public static final String INJECT_EVENT = "inject";
-
- /**
- * The context for the link (optional parameter). This list of values will be converted into strings and included in
- * the URI. The strings will be coerced back to whatever their values are and made available to event handler
- * methods.
- */
- @Parameter
- private Object[] context;
-
- @Parameter(defaultPrefix = BindingConstants.LITERAL,
- value = BindingConstants.SYMBOL + ":" + ComponentParameterConstants.FORMINJECTOR_INSERT_POSITION)
- private InsertPosition position;
-
- /**
- * Name of a function on the client-side Tapestry.ElementEffect object that is invoked to make added content
- * visible. The default value is "highlight".
- */
- @Parameter(defaultPrefix = BindingConstants.LITERAL,
- value = BindingConstants.SYMBOL + ":" + ComponentParameterConstants.FORMINJECTOR_SHOW_FUNCTION)
- private String show;
-
- /**
- * The element name to render, which is normally the element name used to represent the FormInjector component in
- * the template, or "div".
- */
- @Parameter(defaultPrefix = BindingConstants.LITERAL)
- private String element;
-
- @Environmental
- private JavaScriptSupport javascriptSupport;
-
- @Environmental
- private FormSupport formSupport;
-
- @Environmental
- private ClientBehaviorSupport clientBehaviorSupport;
-
- @SuppressWarnings("unchecked")
- @Environmental
- private TrackableComponentEventCallback eventCallback;
-
- private String clientId;
-
- @Inject
- private ComponentResources resources;
-
- @Inject
- private AjaxResponseRenderer ajaxResponseRenderer;
-
- private Element clientElement;
-
- String defaultElement()
- {
- return resources.getElementName("div");
- }
-
- void beginRender(MarkupWriter writer)
- {
- clientId = javascriptSupport.allocateClientId(resources);
-
- clientElement = writer.element(element,
- "id", clientId,
- "data-container-type", "core/ajaxformloop/fragment");
-
- resources.renderInformalParameters(writer);
-
- // Now work on the JavaScript side of things.
-
- Link link = resources.createEventLink(INJECT_EVENT, context);
-
- link.addParameter(RequestConstants.FORM_CLIENTID_PARAMETER, formSupport.getClientId());
- link.addParameter(RequestConstants.FORM_COMPONENTID_PARAMETER, formSupport.getFormComponentId());
-
- clientBehaviorSupport.addFormInjector(clientId, link, position, show);
- }
-
- void afterRender(MarkupWriter writer)
- {
- writer.end();
-
- // Add the class name to the rendered client element. This allows nested elements to locate
- // the containing FormInjector element.
-
- clientElement.attribute("class", "t-forminjector");
- }
-
- /**
- * Returns the unique client-side id of the rendered element.
- */
- public String getClientId()
- {
- return clientId;
- }
-
- /**
- * Invoked via an Ajax request. Triggers an action event and captures the return value. The return value from the
- * event notification is what will ultimately render (typically, its a Block).
- */
- void onInject(EventContext context) throws IOException
- {
- ajaxResponseRenderer.addCallback(new JSONCallback()
- {
- public void run(JSONObject reply)
- {
- clientId = javascriptSupport.allocateClientId(resources);
-
- reply.put("elementId", clientId);
- }
- });
-
- resources.triggerContextEvent(EventConstants.ACTION, context, eventCallback);
- }
-}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/c501986c/tapestry-core/src/main/java/org/apache/tapestry5/corelib/internal/InternalFormSupport.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/internal/InternalFormSupport.java b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/internal/InternalFormSupport.java
index 53981bf..228dd04 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/internal/InternalFormSupport.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/internal/InternalFormSupport.java
@@ -1,5 +1,3 @@
-// Copyright 2008 The Apache Software Foundation
-//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
@@ -20,7 +18,6 @@ import org.apache.tapestry5.services.FormSupport;
* Additional methods for {@link org.apache.tapestry5.services.FormSupport} used internally by Tapestry.
*
* @see org.apache.tapestry5.corelib.components.Form
- * @see org.apache.tapestry5.corelib.components.FormInjector
*/
public interface InternalFormSupport extends FormSupport
{
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/c501986c/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ClientBehaviorSupportImpl.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ClientBehaviorSupportImpl.java b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ClientBehaviorSupportImpl.java
index 3141e88..a9d88b8 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ClientBehaviorSupportImpl.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ClientBehaviorSupportImpl.java
@@ -1,5 +1,3 @@
-// Copyright 2007, 2008, 2009, 2010, 2012 The Apache Software Foundation
-//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
@@ -54,7 +52,7 @@ public class ClientBehaviorSupportImpl implements ClientBehaviorSupport
public void addFormInjector(String clientId, Link link, InsertPosition insertPosition, String showFunctionName)
{
- unsupported("addFormInjector", "A replacement is forthcoming.");
+ unsupported("addFormInjector", "FormInjector compnent was removed in 5.4.");
}
public void addValidation(Field field, String validationName, String message, Object constraint)
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/c501986c/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/RequestConstants.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/RequestConstants.java b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/RequestConstants.java
index 8bac1df..2a79cc8 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/RequestConstants.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/RequestConstants.java
@@ -1,5 +1,3 @@
-// Copyright 2006, 2007, 2008, 2009, 2010, 2011 The Apache Software Foundation
-//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
@@ -15,7 +13,6 @@
package org.apache.tapestry5.internal.services;
import org.apache.tapestry5.corelib.components.Form;
-import org.apache.tapestry5.corelib.components.FormInjector;
import org.apache.tapestry5.corelib.components.Zone;
import org.apache.tapestry5.services.javascript.JavaScriptStack;
@@ -44,7 +41,7 @@ public final class RequestConstants
/**
* Name of parameter, in an Ajax update, that identifies the client-side id of the {@link Form} being extended. Used
- * with {@link Zone}, {@link FormInjector} and other similar components that may be contained within a form.
+ * with {@link Zone} and other similar components that may be contained within a form.
*
* @since 5.2.0
*/
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/c501986c/tapestry-core/src/main/java/org/apache/tapestry5/services/FormSupport.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/services/FormSupport.java b/tapestry-core/src/main/java/org/apache/tapestry5/services/FormSupport.java
index a18e48c..f34579b 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/services/FormSupport.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/services/FormSupport.java
@@ -1,5 +1,3 @@
-// Copyright 2006-2014 The Apache Software Foundation
-//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
@@ -108,8 +106,8 @@ public interface FormSupport extends ClientElement
boolean isClientValidationEnabled();
/**
- * Returns the complete id of the underlying Form component. This is needed by {@link
- * org.apache.tapestry5.corelib.components.FormInjector}.
+ * Returns the complete id of the underlying Form component.
+ *
*/
String getFormComponentId();
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/c501986c/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/AjaxTests.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/AjaxTests.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/AjaxTests.java
index 8293124..9a68365 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/AjaxTests.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/AjaxTests.java
@@ -1,5 +1,3 @@
-// Copyright 2009-2013 The Apache Software Foundation
-//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
@@ -180,7 +178,7 @@ public class AjaxTests extends App1TestCase
}
@Test
- public void form_injector()
+ public void ajax_form_loop()
{
openLinks("FormInjector Demo");
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/c501986c/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/data/DoubleItem.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/data/DoubleItem.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/data/DoubleItem.java
index 47a2846..c5b22ea 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/data/DoubleItem.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/data/DoubleItem.java
@@ -1,5 +1,3 @@
-// Copyright 2008 The Apache Software Foundation
-//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
@@ -15,8 +13,7 @@
package org.apache.tapestry5.integration.app1.data;
/**
- * Used for tests involving {@link org.apache.tapestry5.corelib.components.AjaxFormLoop} (and indirectly, {@link
- * org.apache.tapestry5.corelib.components.FormInjector}).
+ * Used for tests involving {@link org.apache.tapestry5.corelib.components.AjaxFormLoop}.
*/
public class DoubleItem
{
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/c501986c/tapestry-upload/src/test/java/org/example/upload/pages/Ajaxified.java
----------------------------------------------------------------------
diff --git a/tapestry-upload/src/test/java/org/example/upload/pages/Ajaxified.java b/tapestry-upload/src/test/java/org/example/upload/pages/Ajaxified.java
index 1c4b428..7b0a9c3 100644
--- a/tapestry-upload/src/test/java/org/example/upload/pages/Ajaxified.java
+++ b/tapestry-upload/src/test/java/org/example/upload/pages/Ajaxified.java
@@ -1,5 +1,3 @@
-// Copyright 2008 The Apache Software Foundation
-//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
@@ -15,9 +13,9 @@
package org.example.upload.pages;
import org.apache.tapestry5.Block;
+import org.apache.tapestry5.ClientElement;
import org.apache.tapestry5.annotations.Environmental;
import org.apache.tapestry5.annotations.InjectComponent;
-import org.apache.tapestry5.corelib.components.FormInjector;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.services.javascript.JavaScriptSupport;
import org.example.upload.base.UploadBasePage;
@@ -28,7 +26,7 @@ public class Ajaxified extends UploadBasePage
private Block content;
@InjectComponent
- private FormInjector injector;
+ private ClientElement injector;
@Environmental
private JavaScriptSupport javaScriptSupport;
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/c501986c/tapestry-upload/src/test/webapp/Ajaxified.tml
----------------------------------------------------------------------
diff --git a/tapestry-upload/src/test/webapp/Ajaxified.tml b/tapestry-upload/src/test/webapp/Ajaxified.tml
index 9383306..5f86c8f 100644
--- a/tapestry-upload/src/test/webapp/Ajaxified.tml
+++ b/tapestry-upload/src/test/webapp/Ajaxified.tml
@@ -6,11 +6,17 @@
<p>
This test of the upload component checks Ajax related behavior.
</p>
+
+ <div class="alert alert-warning">
+ This page was based on the Ajax FormInjector component, which was removed in 5.4.
+ It is no longer functional.
+ </div>
+
<t:form>
<t:errors/>
- <t:forminjector t:id="injector">
+ <div t:type="any" t:id="injector">
<a href="#" id="trigger">add row</a>
- </t:forminjector>
+ </div>
<br/>
<input type="submit" value="Upload"/>