You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2024/04/22 06:15:24 UTC

(wicket) branch wicket-9.x updated: WICKET-7104: Use JavaScript dynamic resolution of the first function parameter

This is an automated email from the ASF dual-hosted git repository.

mgrigorov pushed a commit to branch wicket-9.x
in repository https://gitbox.apache.org/repos/asf/wicket.git


The following commit(s) were added to refs/heads/wicket-9.x by this push:
     new bd03775a3d WICKET-7104: Use JavaScript dynamic resolution of the first function parameter
bd03775a3d is described below

commit bd03775a3dc3678b63fce36ae8976311297a7114
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
AuthorDate: Mon Apr 22 09:12:54 2024 +0300

    WICKET-7104: Use JavaScript dynamic resolution of the first function parameter
    
    Using the parameter name (i.e. 'input') does not work after JS
    minification.
    Using `arguments[0]` does not depend on the parameter name and should
    work in both minified and non-minified JavaScript.
    
    Signed-off-by: Martin Tzvetanov Grigorov <mg...@apache.org>
    (cherry picked from commit 1c15e83c348d5001414a0aaa64da114ca1692007)
---
 .../markup/html/autocomplete/AbstractAutoCompleteRenderer.java    | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/AbstractAutoCompleteRenderer.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/AbstractAutoCompleteRenderer.java
index ea182f6804..51186a5460 100644
--- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/AbstractAutoCompleteRenderer.java
+++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/AbstractAutoCompleteRenderer.java
@@ -107,10 +107,10 @@ public abstract class AbstractAutoCompleteRenderer<T> implements IAutoCompleteRe
 	 * protected CharSequence getOnSelectJavaScript(Address address)
 	 * {
 	 * 	final StringBuilder js = new StringBuilder();
-	 * 	js.append(&quot;wicketGet('street').value ='&quot; + address.getStreet() + &quot;';&quot;);
-	 * 	js.append(&quot;wicketGet('zipcode').value ='&quot; + address.getZipCode() + &quot;';&quot;);
-	 * 	js.append(&quot;wicketGet('city').value ='&quot; + address.getCity() + &quot;';&quot;);
-	 * 	js.append(&quot;input&quot;); // &lt;-- do not use return statement here!
+	 * 	js.append(&quot;Wicket.DOM.get('street').value ='&quot; + address.getStreet() + &quot;';&quot;);
+	 * 	js.append(&quot;Wicket.DOM.get('zipcode').value ='&quot; + address.getZipCode() + &quot;';&quot;);
+	 * 	js.append(&quot;Wicket.DOM.get('city').value ='&quot; + address.getCity() + &quot;';&quot;);
+	 * 	js.append(&quot;arguments[0]&quot;); // &lt;-- do not use return statement here!
 	 * 	return js.toString();
 	 * }
 	 * </pre>