[jira] [Updated] (WICKET-6201) PropertyResolver#setValue failing with setter only and no corresponding field
[ https://issues.apache.org/jira/browse/WICKET-6201?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sven Meier updated WICKET-6201: --- Priority: Minor (was: Major) > PropertyResolver#setValue failing with setter only and no corresponding field > - > > Key: WICKET-6201 > URL: https://issues.apache.org/jira/browse/WICKET-6201 > Project: Wicket > Issue Type: Bug > Components: wicket >Affects Versions: 7.3.0 >Reporter: Ilia Naryzhny >Assignee: Sven Meier >Priority: Minor > > If there is a bean like that: > {code} > public class Bean { > private Object innerValue; > public void setValue(Object value) { > this.innerValue = value; > } > } > {code} > PropertyResolver#setValue() fails with expression "value", because it cannot > find a getter nor a field with that name. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (WICKET-5623) Custom Getters and Setters for PropertyResolver
[ https://issues.apache.org/jira/browse/WICKET-5623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15384988#comment-15384988 ] ASF subversion and git services commented on WICKET-5623: - Commit ec685cbf68d753def65b8cba442549089c3ba82e in wicket's branch refs/heads/wicket-7.x from [~svenmeier] [ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=ec685cb ] WICKET-5623 let IPropertyLocator return null; added test for custom properties > Custom Getters and Setters for PropertyResolver > --- > > Key: WICKET-5623 > URL: https://issues.apache.org/jira/browse/WICKET-5623 > Project: Wicket > Issue Type: New Feature > Components: wicket >Affects Versions: 6.15.0 >Reporter: Ilia Naryzhny >Assignee: Sven Meier > Labels: properties, property-expression > > There is no way to customize getting of properties from the object. All > possible ways to gain properties are hardcoded in PropertyResolver. > But, for example, there is set of NoSQL document DBs which have some class > "Document" to work with DB. And to get some property of that document you > should call something like this: 'doc.getProperty("myPropertyName")'. > Please add ability to customize obtaining properties from different kind of > objects. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (WICKET-5623) Custom Getters and Setters for PropertyResolver
[ https://issues.apache.org/jira/browse/WICKET-5623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15384982#comment-15384982 ] ASF subversion and git services commented on WICKET-5623: - Commit 50975a2054fd588eab8c2f6a7aa66d18ca088f33 in wicket's branch refs/heads/master from [~svenmeier] [ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=50975a2 ] WICKET-5623 extensible PropertyResolver > Custom Getters and Setters for PropertyResolver > --- > > Key: WICKET-5623 > URL: https://issues.apache.org/jira/browse/WICKET-5623 > Project: Wicket > Issue Type: New Feature > Components: wicket >Affects Versions: 6.15.0 >Reporter: Ilia Naryzhny >Assignee: Sven Meier > Labels: properties, property-expression > > There is no way to customize getting of properties from the object. All > possible ways to gain properties are hardcoded in PropertyResolver. > But, for example, there is set of NoSQL document DBs which have some class > "Document" to work with DB. And to get some property of that document you > should call something like this: 'doc.getProperty("myPropertyName")'. > Please add ability to customize obtaining properties from different kind of > objects. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (WICKET-5623) Custom Getters and Setters for PropertyResolver
[ https://issues.apache.org/jira/browse/WICKET-5623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15384985#comment-15384985 ] ASF subversion and git services commented on WICKET-5623: - Commit 3001b87000ba670a204504c1bfb07254aabe718d in wicket's branch refs/heads/master from [~svenmeier] [ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=3001b87 ] WICKET-5623 remove deprecated IClassCache > Custom Getters and Setters for PropertyResolver > --- > > Key: WICKET-5623 > URL: https://issues.apache.org/jira/browse/WICKET-5623 > Project: Wicket > Issue Type: New Feature > Components: wicket >Affects Versions: 6.15.0 >Reporter: Ilia Naryzhny >Assignee: Sven Meier > Labels: properties, property-expression > > There is no way to customize getting of properties from the object. All > possible ways to gain properties are hardcoded in PropertyResolver. > But, for example, there is set of NoSQL document DBs which have some class > "Document" to work with DB. And to get some property of that document you > should call something like this: 'doc.getProperty("myPropertyName")'. > Please add ability to customize obtaining properties from different kind of > objects. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[1/3] wicket git commit: WICKET-5623 javadoc explain null
Repository: wicket Updated Branches: refs/heads/wicket-7.x 383016060 -> 9abdbbdd1 WICKET-5623 javadoc explain null Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/9abdbbdd Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/9abdbbdd Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/9abdbbdd Branch: refs/heads/wicket-7.x Commit: 9abdbbdd1f13814f2387b7140d8eb09c52eafc4a Parents: ec685cb Author: Sven Meier Authored: Thu Jul 14 20:04:26 2016 +0200 Committer: Sven Meier Committed: Wed Jul 20 00:25:47 2016 +0200 -- .../apache/wicket/core/util/lang/PropertyResolver.java | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/9abdbbdd/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyResolver.java -- diff --git a/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyResolver.java b/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyResolver.java index 28023e1..ad51533 100644 --- a/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyResolver.java +++ b/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyResolver.java @@ -263,13 +263,13 @@ public final class PropertyResolver /** * Receives the class parameter also, since this method can resolve the type for some -* expression, only knowing the target class +* expression, only knowing the target class. * -* @param expression -* @param object -* @param tryToCreateNull -* @param clz -* @return {@link ObjectWithGetAndSet} +* @param expression property expression +* @param object root object +* @param tryToCreateNull how should null values be handled +* @param clz owning clazz +* @return final getAndSet and the target to apply it on, or {@code null} if expression results in an intermediate null */ private static ObjectWithGetAndSet getObjectWithGetAndSet(final String expression, final Object object, final int tryToCreateNull, Class clz) {
[jira] [Commented] (WICKET-5623) Custom Getters and Setters for PropertyResolver
[ https://issues.apache.org/jira/browse/WICKET-5623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15384989#comment-15384989 ] ASF subversion and git services commented on WICKET-5623: - Commit 9abdbbdd1f13814f2387b7140d8eb09c52eafc4a in wicket's branch refs/heads/wicket-7.x from [~svenmeier] [ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=9abdbbd ] WICKET-5623 javadoc explain null > Custom Getters and Setters for PropertyResolver > --- > > Key: WICKET-5623 > URL: https://issues.apache.org/jira/browse/WICKET-5623 > Project: Wicket > Issue Type: New Feature > Components: wicket >Affects Versions: 6.15.0 >Reporter: Ilia Naryzhny >Assignee: Sven Meier > Labels: properties, property-expression > > There is no way to customize getting of properties from the object. All > possible ways to gain properties are hardcoded in PropertyResolver. > But, for example, there is set of NoSQL document DBs which have some class > "Document" to work with DB. And to get some property of that document you > should call something like this: 'doc.getProperty("myPropertyName")'. > Please add ability to customize obtaining properties from different kind of > objects. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[3/3] wicket git commit: WICKET-5623 extensible PropertyResolver
WICKET-5623 extensible PropertyResolver Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/4f3ec335 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/4f3ec335 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/4f3ec335 Branch: refs/heads/wicket-7.x Commit: 4f3ec33568b74c87b3700930bdcf1c9ba4f5e101 Parents: 3830160 Author: Sven Meier Authored: Thu Jul 14 00:16:48 2016 +0200 Committer: Sven Meier Committed: Wed Jul 20 00:25:47 2016 +0200 -- .../wicket/core/util/lang/PropertyResolver.java | 813 ++- 1 file changed, 440 insertions(+), 373 deletions(-) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/4f3ec335/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyResolver.java -- diff --git a/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyResolver.java b/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyResolver.java index 37d5edb..c3e3025 100644 --- a/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyResolver.java +++ b/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyResolver.java @@ -27,6 +27,7 @@ import java.util.concurrent.ConcurrentHashMap; import org.apache.wicket.Application; import org.apache.wicket.Session; import org.apache.wicket.WicketRuntimeException; +import org.apache.wicket.core.util.lang.PropertyResolverConverter; import org.apache.wicket.util.convert.ConversionException; import org.apache.wicket.util.lang.Generics; import org.apache.wicket.util.string.Strings; @@ -39,36 +40,45 @@ import org.slf4j.LoggerFactory; * * This class parses expressions to lookup or set a value on the object that is given. * The supported expressions are: - * - * "property": This could be a bean property with get and set method. Or if a map is given as - * an object it will be lookup with the property as a key when there is not get method for that + * + * "property" + * + * This could be a bean property with getter and setter. Or if a map is given as + * an object it will be lookup with the expression as a key when there is not getter for that * property. - * - * - * "property1.property2": Both properties are looked up as described above. If property1 evaluates to - * null then if there is a setMethod (or if it is a map) and the Class of the property has a default + * + * "property1.property2" + * + * Both properties are looked up as described above. If property1 evaluates to + * null then if there is a setter (or if it is a map) and the Class of the property has a default * constructor then the object will be constructed and set on the object. - * - * - * "property.index": If the property is a List or Array then the second property can be a index on - * that list like: 'mylist.0' this expression will also map on a getProperty(index) or - * setProperty(index,value) methods. If the object is a List then the list will grow automatically - * if the index is greater than the size - * - * - * Index or map properties can also be written as: "property[index]" or "property[key]" - * + * + * "method()" + * + * The corresponding method is invoked. + * + * "property.index" or "property[index]" + * + * If the property is a List or Array then the following expression can be a index on + * that list like: 'mylist.0'. The list will grow automatically if the index is greater than the size. + * This expression will also map on indexed properties, i.e. {@code getProperty(index)} and {@code setProperty(index,value)} + * methods. + * + * "property.key" or "property[key]" + * + * If the property is a Map then the following expression can be a key in that map like: 'myMap.key'. + * + * + * Note that the {@link DefaultGetAndSetLocator} by default provides access to private members + * and methods. If guaranteeing encapsulation of the target objects is a big concern, you should consider + * using an alternative implementation. * - * Note that the property resolver by default provides access to private members and methods. If - * guaranteeing encapsulation of the target objects is a big concern, you should consider using an - * alternative implementation. - * - * Note: If a property evaluates to an instance of {@link org.apache.wicket.model.IModel} then - * the expression should use '.object' to work with its value. + * Note: If a property evaluates to an instance of {@link org.apache.wicket.model.IModel} then + * the expression should use '.object' to work with its value. * * @author jcompagner + * @author svenmeier */ -@SuppressWarnings("unused") public final class PropertyResolver { /** Log. */ @@ -78,7 +88,7 @@ public final class PropertyResolver private
[jira] [Commented] (WICKET-5623) Custom Getters and Setters for PropertyResolver
[ https://issues.apache.org/jira/browse/WICKET-5623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15384983#comment-15384983 ] ASF subversion and git services commented on WICKET-5623: - Commit 9deacffc2a6cecd07c73e596d2b7ec0549d7f8a2 in wicket's branch refs/heads/master from [~svenmeier] [ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=9deacff ] WICKET-5623 let IPropertyLocator return null; added test for custom properties > Custom Getters and Setters for PropertyResolver > --- > > Key: WICKET-5623 > URL: https://issues.apache.org/jira/browse/WICKET-5623 > Project: Wicket > Issue Type: New Feature > Components: wicket >Affects Versions: 6.15.0 >Reporter: Ilia Naryzhny >Assignee: Sven Meier > Labels: properties, property-expression > > There is no way to customize getting of properties from the object. All > possible ways to gain properties are hardcoded in PropertyResolver. > But, for example, there is set of NoSQL document DBs which have some class > "Document" to work with DB. And to get some property of that document you > should call something like this: 'doc.getProperty("myPropertyName")'. > Please add ability to customize obtaining properties from different kind of > objects. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (WICKET-5623) Custom Getters and Setters for PropertyResolver
[ https://issues.apache.org/jira/browse/WICKET-5623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15384987#comment-15384987 ] ASF subversion and git services commented on WICKET-5623: - Commit 4f3ec33568b74c87b3700930bdcf1c9ba4f5e101 in wicket's branch refs/heads/wicket-7.x from [~svenmeier] [ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=4f3ec33 ] WICKET-5623 extensible PropertyResolver > Custom Getters and Setters for PropertyResolver > --- > > Key: WICKET-5623 > URL: https://issues.apache.org/jira/browse/WICKET-5623 > Project: Wicket > Issue Type: New Feature > Components: wicket >Affects Versions: 6.15.0 >Reporter: Ilia Naryzhny >Assignee: Sven Meier > Labels: properties, property-expression > > There is no way to customize getting of properties from the object. All > possible ways to gain properties are hardcoded in PropertyResolver. > But, for example, there is set of NoSQL document DBs which have some class > "Document" to work with DB. And to get some property of that document you > should call something like this: 'doc.getProperty("myPropertyName")'. > Please add ability to customize obtaining properties from different kind of > objects. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[2/3] wicket git commit: WICKET-5623 let IPropertyLocator return null; added test for custom properties
WICKET-5623 let IPropertyLocator return null; added test for custom properties Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/ec685cbf Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/ec685cbf Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/ec685cbf Branch: refs/heads/wicket-7.x Commit: ec685cbf68d753def65b8cba442549089c3ba82e Parents: 4f3ec33 Author: Sven Meier Authored: Thu Jul 14 19:18:25 2016 +0200 Committer: Sven Meier Committed: Wed Jul 20 00:25:47 2016 +0200 -- .../wicket/core/util/lang/PropertyResolver.java | 116 +++ .../org/apache/wicket/util/lang/Document.java | 44 +++ .../wicket/util/lang/PropertyResolverTest.java | 71 +++- 3 files changed, 180 insertions(+), 51 deletions(-) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/ec685cbf/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyResolver.java -- diff --git a/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyResolver.java b/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyResolver.java index c3e3025..28023e1 100644 --- a/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyResolver.java +++ b/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyResolver.java @@ -35,9 +35,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * NOTE: THIS CLASS IS NOT PART OF THE WICKET PUBLIC API, DO NOT USE IT UNLESS YOU KNOW WHAT YOU ARE - * DOING. - * * This class parses expressions to lookup or set a value on the object that is given. * The supported expressions are: * @@ -88,7 +85,7 @@ public final class PropertyResolver private final static int CREATE_NEW_VALUE = 1; private final static int RESOLVE_CLASS = 2; - private final static ConcurrentHashMap applicationToLocators = Generics.newConcurrentHashMap(2); + private final static ConcurrentHashMap applicationToLocators = Generics.newConcurrentHashMap(2); private static final String GET = "get"; private static final String IS = "is"; @@ -389,9 +386,15 @@ public final class PropertyResolver private static IGetAndSet getGetAndSet(String exp, final Class clz) { - IGetAndSetLocator locator = getLocator(); + IPropertyLocator locator = getLocator(); + + IGetAndSet getAndSet = locator.get(clz, exp); + if (getAndSet == null) { + throw new WicketRuntimeException( + "Property could not be resolved for class: " + clz + " expression: " + exp); + } - return locator.getAndSet(clz, exp); + return getAndSet; } /** @@ -473,7 +476,7 @@ public final class PropertyResolver /** * @author jcompagner */ - public static interface IGetAndSet + public interface IGetAndSet { /** * @param object @@ -520,7 +523,7 @@ public final class PropertyResolver public Method getSetter(); } - private static abstract class AbstractGetAndSet implements IGetAndSet + public static abstract class AbstractGetAndSet implements IGetAndSet { /** * {@inheritDoc} @@ -1238,10 +1241,10 @@ public final class PropertyResolver } /** -* Sets the {@link IGetAndSetLocator} for the given application. +* Sets the {@link IPropertyLocator} for the given application. * * If the Application is null then it will be the default if no application is found. So if you -* want to be sure that your {@link IGetAndSetLocator} is handled in all situations then call this +* want to be sure that your {@link IPropertyLocator} is handled in all situations then call this * method twice with your implementations. One time for the application and the second time with * null. * @@ -1252,12 +1255,12 @@ public final class PropertyResolver @Deprecated public static void setClassCache(final Application application, final IClassCache classCache) { - setLocator(application, new IGetAndSetLocator() { + setLocator(application, new IPropertyLocator() { private DefaultGetAndSetLocator locator = new DefaultGetAndSetLocator(); @Override - public IGetAndSet getAndSet(Class clz, String name) { + public IGetAndSet get(Class clz, String na
[jira] [Commented] (WICKET-5623) Custom Getters and Setters for PropertyResolver
[ https://issues.apache.org/jira/browse/WICKET-5623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15384984#comment-15384984 ] ASF subversion and git services commented on WICKET-5623: - Commit eff3254990bd31cceee90f1a4ca5afb29cbd9e80 in wicket's branch refs/heads/master from [~svenmeier] [ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=eff3254 ] WICKET-5623 javadoc explain null > Custom Getters and Setters for PropertyResolver > --- > > Key: WICKET-5623 > URL: https://issues.apache.org/jira/browse/WICKET-5623 > Project: Wicket > Issue Type: New Feature > Components: wicket >Affects Versions: 6.15.0 >Reporter: Ilia Naryzhny >Assignee: Sven Meier > Labels: properties, property-expression > > There is no way to customize getting of properties from the object. All > possible ways to gain properties are hardcoded in PropertyResolver. > But, for example, there is set of NoSQL document DBs which have some class > "Document" to work with DB. And to get some property of that document you > should call something like this: 'doc.getProperty("myPropertyName")'. > Please add ability to customize obtaining properties from different kind of > objects. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[3/4] wicket git commit: WICKET-5623 javadoc explain null
WICKET-5623 javadoc explain null Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/eff32549 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/eff32549 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/eff32549 Branch: refs/heads/master Commit: eff3254990bd31cceee90f1a4ca5afb29cbd9e80 Parents: 9deacff Author: Sven Meier Authored: Thu Jul 14 20:04:26 2016 +0200 Committer: Sven Meier Committed: Wed Jul 20 00:24:01 2016 +0200 -- .../apache/wicket/core/util/lang/PropertyResolver.java | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/eff32549/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyResolver.java -- diff --git a/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyResolver.java b/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyResolver.java index 28023e1..ad51533 100644 --- a/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyResolver.java +++ b/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyResolver.java @@ -263,13 +263,13 @@ public final class PropertyResolver /** * Receives the class parameter also, since this method can resolve the type for some -* expression, only knowing the target class +* expression, only knowing the target class. * -* @param expression -* @param object -* @param tryToCreateNull -* @param clz -* @return {@link ObjectWithGetAndSet} +* @param expression property expression +* @param object root object +* @param tryToCreateNull how should null values be handled +* @param clz owning clazz +* @return final getAndSet and the target to apply it on, or {@code null} if expression results in an intermediate null */ private static ObjectWithGetAndSet getObjectWithGetAndSet(final String expression, final Object object, final int tryToCreateNull, Class clz) {
[4/4] wicket git commit: WICKET-5623 extensible PropertyResolver
WICKET-5623 extensible PropertyResolver Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/50975a20 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/50975a20 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/50975a20 Branch: refs/heads/master Commit: 50975a2054fd588eab8c2f6a7aa66d18ca088f33 Parents: dae680c Author: Sven Meier Authored: Thu Jul 14 00:16:48 2016 +0200 Committer: Sven Meier Committed: Wed Jul 20 00:24:01 2016 +0200 -- .../wicket/core/util/lang/PropertyResolver.java | 813 ++- 1 file changed, 440 insertions(+), 373 deletions(-) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/50975a20/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyResolver.java -- diff --git a/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyResolver.java b/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyResolver.java index 37d5edb..c3e3025 100644 --- a/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyResolver.java +++ b/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyResolver.java @@ -27,6 +27,7 @@ import java.util.concurrent.ConcurrentHashMap; import org.apache.wicket.Application; import org.apache.wicket.Session; import org.apache.wicket.WicketRuntimeException; +import org.apache.wicket.core.util.lang.PropertyResolverConverter; import org.apache.wicket.util.convert.ConversionException; import org.apache.wicket.util.lang.Generics; import org.apache.wicket.util.string.Strings; @@ -39,36 +40,45 @@ import org.slf4j.LoggerFactory; * * This class parses expressions to lookup or set a value on the object that is given. * The supported expressions are: - * - * "property": This could be a bean property with get and set method. Or if a map is given as - * an object it will be lookup with the property as a key when there is not get method for that + * + * "property" + * + * This could be a bean property with getter and setter. Or if a map is given as + * an object it will be lookup with the expression as a key when there is not getter for that * property. - * - * - * "property1.property2": Both properties are looked up as described above. If property1 evaluates to - * null then if there is a setMethod (or if it is a map) and the Class of the property has a default + * + * "property1.property2" + * + * Both properties are looked up as described above. If property1 evaluates to + * null then if there is a setter (or if it is a map) and the Class of the property has a default * constructor then the object will be constructed and set on the object. - * - * - * "property.index": If the property is a List or Array then the second property can be a index on - * that list like: 'mylist.0' this expression will also map on a getProperty(index) or - * setProperty(index,value) methods. If the object is a List then the list will grow automatically - * if the index is greater than the size - * - * - * Index or map properties can also be written as: "property[index]" or "property[key]" - * + * + * "method()" + * + * The corresponding method is invoked. + * + * "property.index" or "property[index]" + * + * If the property is a List or Array then the following expression can be a index on + * that list like: 'mylist.0'. The list will grow automatically if the index is greater than the size. + * This expression will also map on indexed properties, i.e. {@code getProperty(index)} and {@code setProperty(index,value)} + * methods. + * + * "property.key" or "property[key]" + * + * If the property is a Map then the following expression can be a key in that map like: 'myMap.key'. + * + * + * Note that the {@link DefaultGetAndSetLocator} by default provides access to private members + * and methods. If guaranteeing encapsulation of the target objects is a big concern, you should consider + * using an alternative implementation. * - * Note that the property resolver by default provides access to private members and methods. If - * guaranteeing encapsulation of the target objects is a big concern, you should consider using an - * alternative implementation. - * - * Note: If a property evaluates to an instance of {@link org.apache.wicket.model.IModel} then - * the expression should use '.object' to work with its value. + * Note: If a property evaluates to an instance of {@link org.apache.wicket.model.IModel} then + * the expression should use '.object' to work with its value. * * @author jcompagner + * @author svenmeier */ -@SuppressWarnings("unused") public final class PropertyResolver { /** Log. */ @@ -78,7 +88,7 @@ public final class PropertyResolver private fina
[1/4] wicket git commit: WICKET-5623 remove deprecated IClassCache
Repository: wicket Updated Branches: refs/heads/master dae680cf9 -> 3001b8700 WICKET-5623 remove deprecated IClassCache Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/3001b870 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/3001b870 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/3001b870 Branch: refs/heads/master Commit: 3001b87000ba670a204504c1bfb07254aabe718d Parents: eff3254 Author: Sven Meier Authored: Wed Jul 20 00:23:31 2016 +0200 Committer: Sven Meier Committed: Wed Jul 20 00:24:01 2016 +0200 -- .../wicket/core/util/lang/PropertyResolver.java | 61 1 file changed, 61 deletions(-) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/3001b870/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyResolver.java -- diff --git a/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyResolver.java b/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyResolver.java index ad51533..f0781e1 100644 --- a/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyResolver.java +++ b/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyResolver.java @@ -1241,44 +1241,6 @@ public final class PropertyResolver } /** -* Sets the {@link IPropertyLocator} for the given application. -* -* If the Application is null then it will be the default if no application is found. So if you -* want to be sure that your {@link IPropertyLocator} is handled in all situations then call this -* method twice with your implementations. One time for the application and the second time with -* null. -* -* @param application -*to use or null if the default must be set. -* @param classCache -*/ - @Deprecated - public static void setClassCache(final Application application, final IClassCache classCache) - { - setLocator(application, new IPropertyLocator() { - - private DefaultGetAndSetLocator locator = new DefaultGetAndSetLocator(); - - @Override - public IGetAndSet get(Class clz, String name) { - Map map = classCache.get(clz); - if (map == null) { - map = new ConcurrentHashMap(8); - classCache.put(clz, map); - } - - IGetAndSet getAndSetter = map.get(name); - if (getAndSetter == null) { - getAndSetter = locator.get(clz, name); - map.put(name, getAndSetter); - } - - return getAndSetter; - } - }); - } - - /** * Get the current {@link IPropertyLocator}. * * @return locator for the current {@link Application} or a general one if no current application is present @@ -1326,29 +1288,6 @@ public final class PropertyResolver } /** -* Specify an {@link IPropertyLocator} instead. -*/ - @Deprecated - public static interface IClassCache - { - /** -* Put the class into the cache, or if that class shouldn't be cached do nothing. -* -* @param clz -* @param values -*/ - void put(Class clz, Map values); - - /** -* Returns the class map from the cache. -* -* @param clz -* @return the map of the given class -*/ - Map get(Class clz); - } - - /** * A locator of properties. * * @see https://issues.apache.org/jira/browse/WICKET-5623
[2/4] wicket git commit: WICKET-5623 let IPropertyLocator return null; added test for custom properties
WICKET-5623 let IPropertyLocator return null; added test for custom properties Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/9deacffc Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/9deacffc Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/9deacffc Branch: refs/heads/master Commit: 9deacffc2a6cecd07c73e596d2b7ec0549d7f8a2 Parents: 50975a2 Author: Sven Meier Authored: Thu Jul 14 19:18:25 2016 +0200 Committer: Sven Meier Committed: Wed Jul 20 00:24:01 2016 +0200 -- .../wicket/core/util/lang/PropertyResolver.java | 116 +++ .../org/apache/wicket/util/lang/Document.java | 44 +++ .../wicket/util/lang/PropertyResolverTest.java | 71 +++- 3 files changed, 180 insertions(+), 51 deletions(-) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/9deacffc/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyResolver.java -- diff --git a/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyResolver.java b/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyResolver.java index c3e3025..28023e1 100644 --- a/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyResolver.java +++ b/wicket-core/src/main/java/org/apache/wicket/core/util/lang/PropertyResolver.java @@ -35,9 +35,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * NOTE: THIS CLASS IS NOT PART OF THE WICKET PUBLIC API, DO NOT USE IT UNLESS YOU KNOW WHAT YOU ARE - * DOING. - * * This class parses expressions to lookup or set a value on the object that is given. * The supported expressions are: * @@ -88,7 +85,7 @@ public final class PropertyResolver private final static int CREATE_NEW_VALUE = 1; private final static int RESOLVE_CLASS = 2; - private final static ConcurrentHashMap applicationToLocators = Generics.newConcurrentHashMap(2); + private final static ConcurrentHashMap applicationToLocators = Generics.newConcurrentHashMap(2); private static final String GET = "get"; private static final String IS = "is"; @@ -389,9 +386,15 @@ public final class PropertyResolver private static IGetAndSet getGetAndSet(String exp, final Class clz) { - IGetAndSetLocator locator = getLocator(); + IPropertyLocator locator = getLocator(); + + IGetAndSet getAndSet = locator.get(clz, exp); + if (getAndSet == null) { + throw new WicketRuntimeException( + "Property could not be resolved for class: " + clz + " expression: " + exp); + } - return locator.getAndSet(clz, exp); + return getAndSet; } /** @@ -473,7 +476,7 @@ public final class PropertyResolver /** * @author jcompagner */ - public static interface IGetAndSet + public interface IGetAndSet { /** * @param object @@ -520,7 +523,7 @@ public final class PropertyResolver public Method getSetter(); } - private static abstract class AbstractGetAndSet implements IGetAndSet + public static abstract class AbstractGetAndSet implements IGetAndSet { /** * {@inheritDoc} @@ -1238,10 +1241,10 @@ public final class PropertyResolver } /** -* Sets the {@link IGetAndSetLocator} for the given application. +* Sets the {@link IPropertyLocator} for the given application. * * If the Application is null then it will be the default if no application is found. So if you -* want to be sure that your {@link IGetAndSetLocator} is handled in all situations then call this +* want to be sure that your {@link IPropertyLocator} is handled in all situations then call this * method twice with your implementations. One time for the application and the second time with * null. * @@ -1252,12 +1255,12 @@ public final class PropertyResolver @Deprecated public static void setClassCache(final Application application, final IClassCache classCache) { - setLocator(application, new IGetAndSetLocator() { + setLocator(application, new IPropertyLocator() { private DefaultGetAndSetLocator locator = new DefaultGetAndSetLocator(); @Override - public IGetAndSet getAndSet(Class clz, String name) { + public IGetAndSet get(Class clz, String name)
[jira] [Updated] (WICKET-6206) Allow to use custom anticache parameter value for Image component
[ https://issues.apache.org/jira/browse/WICKET-6206?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Martin Grigorov updated WICKET-6206: Summary: Allow to use custom anticache parameter value for Image component (was: Image's anticache triggers multiple downloads of a single resource for a single page) > Allow to use custom anticache parameter value for Image component > - > > Key: WICKET-6206 > URL: https://issues.apache.org/jira/browse/WICKET-6206 > Project: Wicket > Issue Type: Improvement > Components: wicket >Affects Versions: 7.3.0, 6.23.0 >Reporter: Yoann Rodière >Assignee: Martin Grigorov >Priority: Minor > Fix For: 8.0.0-M2, 6.25.0, 7.5.0 > > > When rendering a single page with multiple references to the same image > resource (for instance a repeated icon in a table), each of these images gets > a different {{antiCache}} query parameter. Thus the browser rendering this > single page will perform a download for each occurrence of this image in the > page, not using its cache even in the scope of this single page rendering. > I understand the need of preventing cache, but it may be a bit extreme to > prevent caching in the scope of a single page rendering. > The reason for this extreme behavior is that {{Image}}'s anticache feature is > implemented as follows (Wicket 7.3): > {code:java} > protected final void addAntiCacheParameter(final ComponentTag tag) > { > String url = tag.getAttributes().getString("src"); > url = url + (url.contains("?") ? "&" : "?"); > url = url + "antiCache=" + System.currentTimeMillis(); > tag.put("src", url); > } > {code} > As each {{Image}}'s rendering may be done at a different time (a millisecond > later), the {{antiCache}} parameter may be different for each {{Image}}. > Replacing {{System.currentTimeMillis()}} by > {{RequestCycle.get().getStartTime()}} should probably solve the problem... ? > If impossible, maybe we could just remove the {{final}} keyword on > {{addAntiCacheParameter}} so that extending classes may override it? -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Resolved] (WICKET-6206) Image's anticache triggers multiple downloads of a single resource for a single page
[ https://issues.apache.org/jira/browse/WICKET-6206?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Martin Grigorov resolved WICKET-6206. - Resolution: Fixed Fix Version/s: 7.5.0 6.25.0 8.0.0-M2 Thank you! > Image's anticache triggers multiple downloads of a single resource for a > single page > > > Key: WICKET-6206 > URL: https://issues.apache.org/jira/browse/WICKET-6206 > Project: Wicket > Issue Type: Improvement > Components: wicket >Affects Versions: 7.3.0, 6.23.0 >Reporter: Yoann Rodière >Assignee: Martin Grigorov >Priority: Minor > Fix For: 8.0.0-M2, 6.25.0, 7.5.0 > > > When rendering a single page with multiple references to the same image > resource (for instance a repeated icon in a table), each of these images gets > a different {{antiCache}} query parameter. Thus the browser rendering this > single page will perform a download for each occurrence of this image in the > page, not using its cache even in the scope of this single page rendering. > I understand the need of preventing cache, but it may be a bit extreme to > prevent caching in the scope of a single page rendering. > The reason for this extreme behavior is that {{Image}}'s anticache feature is > implemented as follows (Wicket 7.3): > {code:java} > protected final void addAntiCacheParameter(final ComponentTag tag) > { > String url = tag.getAttributes().getString("src"); > url = url + (url.contains("?") ? "&" : "?"); > url = url + "antiCache=" + System.currentTimeMillis(); > tag.put("src", url); > } > {code} > As each {{Image}}'s rendering may be done at a different time (a millisecond > later), the {{antiCache}} parameter may be different for each {{Image}}. > Replacing {{System.currentTimeMillis()}} by > {{RequestCycle.get().getStartTime()}} should probably solve the problem... ? > If impossible, maybe we could just remove the {{final}} keyword on > {{addAntiCacheParameter}} so that extending classes may override it? -- This message was sent by Atlassian JIRA (v6.3.4#6332)
wicket git commit: WICKET-6206 Allow overriding of addAntiCacheParameter
Repository: wicket Updated Branches: refs/heads/wicket-6.x 4d10d11a7 -> 268570967 WICKET-6206 Allow overriding of addAntiCacheParameter ...in class Image, so that one can define precisely how to generate the anticache parameter value. Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/26857096 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/26857096 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/26857096 Branch: refs/heads/wicket-6.x Commit: 26857096777b4f9f8a8dc52e1195a72adf862df8 Parents: 4d10d11 Author: Yoann Rodière Authored: Mon Jul 18 12:43:55 2016 +0200 Committer: Martin Tzvetanov Grigorov Committed: Wed Jul 20 00:16:08 2016 +0200 -- .../src/main/java/org/apache/wicket/markup/html/image/Image.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/26857096/wicket-core/src/main/java/org/apache/wicket/markup/html/image/Image.java -- diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/image/Image.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/image/Image.java index c024985..fd152fd 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/image/Image.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/image/Image.java @@ -267,7 +267,7 @@ public class Image extends WebComponent implements IResourceListener * * @param tag */ - protected final void addAntiCacheParameter(final ComponentTag tag) + protected void addAntiCacheParameter(final ComponentTag tag) { String url = tag.getAttributes().getString("src"); url = url + (url.contains("?") ? "&" : "?");
wicket git commit: WICKET-6206 Allow overriding of addAntiCacheParameter
Repository: wicket Updated Branches: refs/heads/wicket-7.x 280f7f0d0 -> 383016060 WICKET-6206 Allow overriding of addAntiCacheParameter ...in class Image, so that one can define precisely how to generate the anticache parameter value. Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/38301606 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/38301606 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/38301606 Branch: refs/heads/wicket-7.x Commit: 383016060b458019029c2d1f5818e0dc0c91d345 Parents: 280f7f0 Author: Yoann Rodière Authored: Mon Jul 18 12:43:55 2016 +0200 Committer: Martin Tzvetanov Grigorov Committed: Wed Jul 20 00:15:42 2016 +0200 -- .../src/main/java/org/apache/wicket/markup/html/image/Image.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/38301606/wicket-core/src/main/java/org/apache/wicket/markup/html/image/Image.java -- diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/image/Image.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/image/Image.java index 19f4f7a..a13180e 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/image/Image.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/image/Image.java @@ -543,7 +543,7 @@ public class Image extends WebComponent implements IResourceListener * * @param tag */ - protected final void addAntiCacheParameter(final ComponentTag tag) + protected void addAntiCacheParameter(final ComponentTag tag) { String url = tag.getAttributes().getString("src"); url = url + (url.contains("?") ? "&" : "?");
[jira] [Commented] (WICKET-5858) AjaxRequestTarget.focusComponent does not work in modal window
[ https://issues.apache.org/jira/browse/WICKET-5858?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15384971#comment-15384971 ] ASF subversion and git services commented on WICKET-5858: - Commit b93e1ba557f85cdbf77fd44a14721918feb23910 in wicket's branch refs/heads/master from [~svenmeier] [ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=b93e1ba ] WICKET-6209 move try-catch into function which is invoked via #setTimeout(), so IE errors get caught ;removed workaround for WicketWICKET-5755, i.e. directly call #requestFocus() since it now always uses #setTimeout() to request focus (see WICKET-5858) > AjaxRequestTarget.focusComponent does not work in modal window > -- > > Key: WICKET-5858 > URL: https://issues.apache.org/jira/browse/WICKET-5858 > Project: Wicket > Issue Type: Bug > Components: wicket >Affects Versions: 6.19.0 >Reporter: Mikk Lauringson >Assignee: Tobias Soloschenko > Fix For: 6.20.0, 7.0.0-M6 > > Attachments: WICKET-5858.zip > > > Opening modal window and focusing a field in it does not work anymore. > This worked in Wicket 6.16.0 and older versions, but does not work in 6.17.0, > 6.18.0 and 6.19.0. > This is basically same issue as WICKET-5781 but it was wrongly marked as > duplicate of WICKET-5755 and resolved in 6.19.0. They are actually different > problems and this problem is still not fixed in 6.19.0. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (WICKET-6206) Image's anticache triggers multiple downloads of a single resource for a single page
[ https://issues.apache.org/jira/browse/WICKET-6206?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15384974#comment-15384974 ] ASF GitHub Bot commented on WICKET-6206: Github user asfgit closed the pull request at: https://github.com/apache/wicket/pull/175 > Image's anticache triggers multiple downloads of a single resource for a > single page > > > Key: WICKET-6206 > URL: https://issues.apache.org/jira/browse/WICKET-6206 > Project: Wicket > Issue Type: Improvement > Components: wicket >Affects Versions: 7.3.0, 6.23.0 >Reporter: Yoann Rodière >Assignee: Martin Grigorov >Priority: Minor > > When rendering a single page with multiple references to the same image > resource (for instance a repeated icon in a table), each of these images gets > a different {{antiCache}} query parameter. Thus the browser rendering this > single page will perform a download for each occurrence of this image in the > page, not using its cache even in the scope of this single page rendering. > I understand the need of preventing cache, but it may be a bit extreme to > prevent caching in the scope of a single page rendering. > The reason for this extreme behavior is that {{Image}}'s anticache feature is > implemented as follows (Wicket 7.3): > {code:java} > protected final void addAntiCacheParameter(final ComponentTag tag) > { > String url = tag.getAttributes().getString("src"); > url = url + (url.contains("?") ? "&" : "?"); > url = url + "antiCache=" + System.currentTimeMillis(); > tag.put("src", url); > } > {code} > As each {{Image}}'s rendering may be done at a different time (a millisecond > later), the {{antiCache}} parameter may be different for each {{Image}}. > Replacing {{System.currentTimeMillis()}} by > {{RequestCycle.get().getStartTime()}} should probably solve the problem... ? > If impossible, maybe we could just remove the {{final}} keyword on > {{addAntiCacheParameter}} so that extending classes may override it? -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (WICKET-6211) PasswordTextField should clear password by default
[ https://issues.apache.org/jira/browse/WICKET-6211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15384972#comment-15384972 ] ASF subversion and git services commented on WICKET-6211: - Commit 4054dbc7f8839a9b6dfee1fcdfc9afe4370724ce in wicket's branch refs/heads/master from [~svenmeier] [ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=4054dbc ] WICKET-6211 clear password on detach > PasswordTextField should clear password by default > -- > > Key: WICKET-6211 > URL: https://issues.apache.org/jira/browse/WICKET-6211 > Project: Wicket > Issue Type: Improvement > Components: wicket >Affects Versions: 7.3.0, 8.0.0-M1 >Reporter: Sven Meier >Assignee: Sven Meier >Priority: Minor > Fix For: 8.0.0-M2, 7.5.0 > > > If the application developer does not take extra care, the password entered > via PasswordTextField is stored along with the containing page in the page > store. > This should be prevented by default by clearing the model object after each > request. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (WICKET-5755) Restoring focus after Ajax replace no longer works in IE8
[ https://issues.apache.org/jira/browse/WICKET-5755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15384970#comment-15384970 ] ASF subversion and git services commented on WICKET-5755: - Commit b93e1ba557f85cdbf77fd44a14721918feb23910 in wicket's branch refs/heads/master from [~svenmeier] [ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=b93e1ba ] WICKET-6209 move try-catch into function which is invoked via #setTimeout(), so IE errors get caught ;removed workaround for WicketWICKET-5755, i.e. directly call #requestFocus() since it now always uses #setTimeout() to request focus (see WICKET-5858) > Restoring focus after Ajax replace no longer works in IE8 > - > > Key: WICKET-5755 > URL: https://issues.apache.org/jira/browse/WICKET-5755 > Project: Wicket > Issue Type: Bug > Components: wicket >Affects Versions: 6.17.0 >Reporter: Sven Meier >Assignee: Sven Meier > Fix For: 7.0.0-M4, 6.19.0 > > > In IE8 focus is no longer reliably restored to the former focus owner after > Ajax request. > This regression is caused by WICKET-5564. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (WICKET-6209) requesting focus on disabled field fails with error in IE8
[ https://issues.apache.org/jira/browse/WICKET-6209?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15384969#comment-15384969 ] ASF subversion and git services commented on WICKET-6209: - Commit b93e1ba557f85cdbf77fd44a14721918feb23910 in wicket's branch refs/heads/master from [~svenmeier] [ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=b93e1ba ] WICKET-6209 move try-catch into function which is invoked via #setTimeout(), so IE errors get caught ;removed workaround for WicketWICKET-5755, i.e. directly call #requestFocus() since it now always uses #setTimeout() to request focus (see WICKET-5858) > requesting focus on disabled field fails with error in IE8 > -- > > Key: WICKET-6209 > URL: https://issues.apache.org/jira/browse/WICKET-6209 > Project: Wicket > Issue Type: Bug > Components: wicket >Affects Versions: 7.3.0, 6.23.0, 8.0.0-M2 >Reporter: Sven Meier >Assignee: Sven Meier >Priority: Minor > Fix For: 8.0.0-M2, 6.25.0, 7.5.0 > > > IE8 reports an error when focus is set on a *then* disabled component: > - user clicks AjaxCheckBox > - server disables checkbox and updates it via ART > - wicket-ajax-jquery.js tries to restore focus > This problem occurs since WIcket 6.20, presumably caused by WICKET-5858. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (WICKET-6206) Image's anticache triggers multiple downloads of a single resource for a single page
[ https://issues.apache.org/jira/browse/WICKET-6206?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15384973#comment-15384973 ] ASF subversion and git services commented on WICKET-6206: - Commit dae680cf94cd0d820bcc32029f7ba24f205d010f in wicket's branch refs/heads/master from [~mgrigorov] [ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=dae680c ] Merge branch 'pr-175-WICKET-6206' > Image's anticache triggers multiple downloads of a single resource for a > single page > > > Key: WICKET-6206 > URL: https://issues.apache.org/jira/browse/WICKET-6206 > Project: Wicket > Issue Type: Improvement > Components: wicket >Affects Versions: 7.3.0, 6.23.0 >Reporter: Yoann Rodière >Assignee: Martin Grigorov >Priority: Minor > > When rendering a single page with multiple references to the same image > resource (for instance a repeated icon in a table), each of these images gets > a different {{antiCache}} query parameter. Thus the browser rendering this > single page will perform a download for each occurrence of this image in the > page, not using its cache even in the scope of this single page rendering. > I understand the need of preventing cache, but it may be a bit extreme to > prevent caching in the scope of a single page rendering. > The reason for this extreme behavior is that {{Image}}'s anticache feature is > implemented as follows (Wicket 7.3): > {code:java} > protected final void addAntiCacheParameter(final ComponentTag tag) > { > String url = tag.getAttributes().getString("src"); > url = url + (url.contains("?") ? "&" : "?"); > url = url + "antiCache=" + System.currentTimeMillis(); > tag.put("src", url); > } > {code} > As each {{Image}}'s rendering may be done at a different time (a millisecond > later), the {{antiCache}} parameter may be different for each {{Image}}. > Replacing {{System.currentTimeMillis()}} by > {{RequestCycle.get().getStartTime()}} should probably solve the problem... ? > If impossible, maybe we could just remove the {{final}} keyword on > {{addAntiCacheParameter}} so that extending classes may override it? -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[5/6] wicket git commit: Update maven-bundle-plugin to 3.2.0
Update maven-bundle-plugin to 3.2.0 Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/0d8ab849 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/0d8ab849 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/0d8ab849 Branch: refs/heads/master Commit: 0d8ab849b4b9dd08337dc4a9b818b741fa7a63e4 Parents: ed69f1d Author: Martin Tzvetanov Grigorov Authored: Mon Jul 18 22:52:20 2016 +0200 Committer: Martin Tzvetanov Grigorov Committed: Wed Jul 20 00:10:32 2016 +0200 -- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/0d8ab849/pom.xml -- diff --git a/pom.xml b/pom.xml index bf21120..f2a92fe 100644 --- a/pom.xml +++ b/pom.xml @@ -733,7 +733,7 @@ org.apache.felix maven-bundle-plugin - 3.0.0 + 3.2.0 bundle-manifest
[4/6] wicket git commit: category SlowTests for all tests needing a network connection
category SlowTests for all tests needing a network connection Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/ed69f1df Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/ed69f1df Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/ed69f1df Branch: refs/heads/master Commit: ed69f1dfdfb2a9f2b3eb46bedbca842f6c8a64ee Parents: b29d261 Author: Sven Meier Authored: Mon Jul 18 21:46:13 2016 +0200 Committer: Martin Tzvetanov Grigorov Committed: Wed Jul 20 00:10:32 2016 +0200 -- .../java/org/apache/wicket/protocol/http/WicketFilterTest.java | 4 .../src/test/java/org/apache/wicket/util/io/ConnectionsTest.java | 3 +++ 2 files changed, 7 insertions(+) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/ed69f1df/wicket-core/src/test/java/org/apache/wicket/protocol/http/WicketFilterTest.java -- diff --git a/wicket-core/src/test/java/org/apache/wicket/protocol/http/WicketFilterTest.java b/wicket-core/src/test/java/org/apache/wicket/protocol/http/WicketFilterTest.java index 7fc36a7..f0560b0 100644 --- a/wicket-core/src/test/java/org/apache/wicket/protocol/http/WicketFilterTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/protocol/http/WicketFilterTest.java @@ -55,12 +55,14 @@ import org.apache.wicket.request.http.WebRequest; import org.apache.wicket.request.resource.AbstractResource; import org.apache.wicket.request.resource.DynamicImageResource; import org.apache.wicket.request.resource.IResource; +import org.apache.wicket.util.SlowTests; import org.apache.wicket.util.file.WebXmlFile; import org.apache.wicket.util.string.Strings; import org.apache.wicket.util.tester.DummyHomePage; import org.junit.After; import org.junit.Assert; import org.junit.Test; +import org.junit.experimental.categories.Category; import org.mockito.Matchers; import org.mockito.Mockito; import org.mockito.invocation.InvocationOnMock; @@ -126,6 +128,7 @@ public class WicketFilterTest extends Assert * testFilterPath1() */ @Test + @Category(SlowTests.class) public void filterPath1() { InputStream in = WicketFilterTest.class.getResourceAsStream("web1.xml"); @@ -137,6 +140,7 @@ public class WicketFilterTest extends Assert * testFilterPath2() */ @Test + @Category(SlowTests.class) public void filterPath2() { InputStream in = WicketFilterTest.class.getResourceAsStream("web2.xml"); http://git-wip-us.apache.org/repos/asf/wicket/blob/ed69f1df/wicket-util/src/test/java/org/apache/wicket/util/io/ConnectionsTest.java -- diff --git a/wicket-util/src/test/java/org/apache/wicket/util/io/ConnectionsTest.java b/wicket-util/src/test/java/org/apache/wicket/util/io/ConnectionsTest.java index b5e994f..ef95539 100644 --- a/wicket-util/src/test/java/org/apache/wicket/util/io/ConnectionsTest.java +++ b/wicket-util/src/test/java/org/apache/wicket/util/io/ConnectionsTest.java @@ -23,10 +23,13 @@ import static org.hamcrest.CoreMatchers.notNullValue; import java.net.URL; +import org.apache.wicket.util.SlowTests; import org.apache.wicket.util.time.Time; import org.junit.Test; +import org.junit.experimental.categories.Category; @SuppressWarnings("javadoc") +@Category(SlowTests.class) public class ConnectionsTest { /**
[6/6] wicket git commit: Merge branch 'pr-175-WICKET-6206'
Merge branch 'pr-175-WICKET-6206' Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/dae680cf Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/dae680cf Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/dae680cf Branch: refs/heads/master Commit: dae680cf94cd0d820bcc32029f7ba24f205d010f Parents: 403db75 4054dbc Author: Martin Tzvetanov Grigorov Authored: Wed Jul 20 00:14:02 2016 +0200 Committer: Martin Tzvetanov Grigorov Committed: Wed Jul 20 00:14:02 2016 +0200 -- .../src/main/java/org/apache/wicket/markup/html/image/Image.java | 2 +- .../org/apache/wicket/markup/html/form/PasswordTextFieldTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) --
[1/6] wicket git commit: WICKET-6206 Allow overriding of addAntiCacheParameter
Repository: wicket Updated Branches: refs/heads/master 403db7550 -> dae680cf9 WICKET-6206 Allow overriding of addAntiCacheParameter ...in class Image, so that one can define precisely how to generate the anticache parameter value. Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/b29d2617 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/b29d2617 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/b29d2617 Branch: refs/heads/master Commit: b29d2617e2bc996b74e1b959e7c8fb73caaba6ee Parents: 0ff4617 Author: Yoann Rodière Authored: Mon Jul 18 12:43:55 2016 +0200 Committer: Yoann Rodière Committed: Mon Jul 18 12:43:55 2016 +0200 -- .../src/main/java/org/apache/wicket/markup/html/image/Image.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/b29d2617/wicket-core/src/main/java/org/apache/wicket/markup/html/image/Image.java -- diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/image/Image.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/image/Image.java index 7aa9b85..5bcfdef 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/image/Image.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/image/Image.java @@ -548,7 +548,7 @@ public class Image extends WebComponent implements IRequestListener * * @param tag */ - protected final void addAntiCacheParameter(final ComponentTag tag) + protected void addAntiCacheParameter(final ComponentTag tag) { String url = tag.getAttributes().getString("src"); url = url + (url.contains("?") ? "&" : "?");
[3/6] wicket git commit: WICKET-6209 move try-catch into function which is invoked via #setTimeout(), so IE errors get caught
WICKET-6209 move try-catch into function which is invoked via #setTimeout(), so IE errors get caught ;removed workaround for WicketWICKET-5755, i.e. directly call #requestFocus() since it now always uses #setTimeout() to request focus (see WICKET-5858) Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/b93e1ba5 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/b93e1ba5 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/b93e1ba5 Branch: refs/heads/master Commit: b93e1ba557f85cdbf77fd44a14721918feb23910 Parents: 0d8ab84 Author: Sven Meier Authored: Tue Jul 19 22:47:15 2016 +0200 Committer: Martin Tzvetanov Grigorov Committed: Wed Jul 20 00:10:32 2016 +0200 -- .../wicket/ajax/res/js/wicket-ajax-jquery.js| 47 +--- 1 file changed, 22 insertions(+), 25 deletions(-) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/b93e1ba5/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js -- diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js index a7aa0d9..f0c5c12 100644 --- a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js +++ b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js @@ -1098,13 +1098,7 @@ this._executeHandlers(attrs.sh, attrs, null, null, 'success'); Wicket.Event.publish(Wicket.Event.Topic.AJAX_CALL_SUCCESS, attrs, null, null, 'success'); - // set the focus to the last component - if (Wicket.Browser.isIELessThan9()) { - // WICKET-5755 - window.setTimeout("Wicket.Focus.requestFocus();", 0); - } else { - Wicket.Focus.requestFocus(); - } + Wicket.Focus.requestFocus(); // continue to next step (which should make the processing stop, as success should be the final step) return FunctionsExecuter.DONE; @@ -2702,30 +2696,33 @@ if (toFocus) { Wicket.Log.info("Calling focus on " + WF.lastFocusId); - try { - if (WF.focusSetFromServer) { - // WICKET-5858 - window.setTimeout(function () { toFocus.focus(); }, 0); - } else { - // avoid loops like - onfocus triggering an event the modifies the tag => refocus => the event is triggered again - var temp = toFocus.onfocus; - toFocus.onfocus = null; - - // IE needs setTimeout (it seems not to call onfocus sync. when focus() is called - window.setTimeout(function () {toFocus.focus(); toFocus.onfocus = temp; }, 0); + + var safeFocus = function() { + try { + toFocus.focus(); + } catch (ignore) { + // WICKET-6209 IE fails if toFocus is disabled } - } catch (ignore) { + }; + + if (WF.focusSetFromServer) { + // WICKET-5858 + window.setTimeout(safeFocus, 0); + } else { + // avoid loops like - onfocus triggering an event the modifies the tag => refocus => the event is triggered again + var temp = toFocus.onfocus; +
[2/6] wicket git commit: WICKET-6211 clear password on detach
WICKET-6211 clear password on detach Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/4054dbc7 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/4054dbc7 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/4054dbc7 Branch: refs/heads/master Commit: 4054dbc7f8839a9b6dfee1fcdfc9afe4370724ce Parents: b93e1ba Author: Sven Meier Authored: Tue Jul 19 23:50:17 2016 +0200 Committer: Martin Tzvetanov Grigorov Committed: Wed Jul 20 00:10:32 2016 +0200 -- .../markup/html/form/PasswordTextField.java | 50 ++ .../markup/html/form/PasswordTextFieldTest.java | 97 2 files changed, 129 insertions(+), 18 deletions(-) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/4054dbc7/wicket-core/src/main/java/org/apache/wicket/markup/html/form/PasswordTextField.java -- diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/PasswordTextField.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/PasswordTextField.java index cbb5010..334248c 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/PasswordTextField.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/PasswordTextField.java @@ -18,8 +18,6 @@ package org.apache.wicket.markup.html.form; import org.apache.wicket.markup.ComponentTag; import org.apache.wicket.model.IModel; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; /** @@ -28,6 +26,10 @@ import org.slf4j.LoggerFactory; * * By default this text field is required. If it is not, call {@link #setRequired(boolean)} with * value of false. + * + * Note that by default the model object is nullified after each request to prevent the entered + * password to be serialized along with the containing page, see {@link #setResetPassword(boolean)} + * for details. * * @author Jonathan Locke */ @@ -35,14 +37,8 @@ public class PasswordTextField extends TextField { private static final long serialVersionUID = 1L; - /** Log. */ - private static final Logger log = LoggerFactory.getLogger(PasswordTextField.class); - /** -* Flag indicating whether the contents of the field should be reset each time it is rendered. -* If true, the contents are emptied when the field is rendered. This is useful for -* login forms. If false, the contents of the model are put into the field. This is -* useful for entry forms where the contents of the model should be editable, or resubmitted. +* Should password be reset, see {@link #setResetPassword(boolean)}. */ private boolean resetPassword = true; @@ -67,12 +63,9 @@ public class PasswordTextField extends TextField } /** -* Flag indicating whether the contents of the field should be reset each time it is rendered. -* If true, the contents are emptied when the field is rendered. This is useful for -* login forms. If false, the contents of the model are put into the field. This is -* useful for entry forms where the contents of the model should be editable, or resubmitted. +* Should password be reset, see {@link #setResetPassword(boolean)}. * -* @return Returns the resetPassword. +* @return should password be resetted */ public final boolean getResetPassword() { @@ -80,10 +73,14 @@ public class PasswordTextField extends TextField } /** -* Flag indicating whether the contents of the field should be reset each time it is rendered. -* If true, the contents are emptied when the field is rendered. This is useful for -* login forms. If false, the contents of the model are put into the field. This is -* useful for entry forms where the contents of the model should be editable, or resubmitted. +* Flag indicating whether the password should be reset after each request. +* Additionally any present value is not rendered into the markup. +* +* If true, the model object is set to null after each request to prevent it +* being serialized along with the containing page. This is default and highly recommended +* for login forms. If false the model value is handled as in a standard +* {@link TextField}, this is useful for entry forms where the contents of the model should +* be editable, or resubmitted. * * @param resetPassword *The resetPassword to set. @@ -117,4 +114,21 @@ public class PasswordTextField extends TextField { return new String[] {"password"}; } + + /** +* Overriden to
[jira] [Assigned] (WICKET-6206) Image's anticache triggers multiple downloads of a single resource for a single page
[ https://issues.apache.org/jira/browse/WICKET-6206?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Martin Grigorov reassigned WICKET-6206: --- Assignee: Martin Grigorov > Image's anticache triggers multiple downloads of a single resource for a > single page > > > Key: WICKET-6206 > URL: https://issues.apache.org/jira/browse/WICKET-6206 > Project: Wicket > Issue Type: Improvement > Components: wicket >Affects Versions: 7.3.0, 6.23.0 >Reporter: Yoann Rodière >Assignee: Martin Grigorov >Priority: Minor > > When rendering a single page with multiple references to the same image > resource (for instance a repeated icon in a table), each of these images gets > a different {{antiCache}} query parameter. Thus the browser rendering this > single page will perform a download for each occurrence of this image in the > page, not using its cache even in the scope of this single page rendering. > I understand the need of preventing cache, but it may be a bit extreme to > prevent caching in the scope of a single page rendering. > The reason for this extreme behavior is that {{Image}}'s anticache feature is > implemented as follows (Wicket 7.3): > {code:java} > protected final void addAntiCacheParameter(final ComponentTag tag) > { > String url = tag.getAttributes().getString("src"); > url = url + (url.contains("?") ? "&" : "?"); > url = url + "antiCache=" + System.currentTimeMillis(); > tag.put("src", url); > } > {code} > As each {{Image}}'s rendering may be done at a different time (a millisecond > later), the {{antiCache}} parameter may be different for each {{Image}}. > Replacing {{System.currentTimeMillis()}} by > {{RequestCycle.get().getStartTime()}} should probably solve the problem... ? > If impossible, maybe we could just remove the {{final}} keyword on > {{addAntiCacheParameter}} so that extending classes may override it? -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Resolved] (WICKET-6211) PasswordTextField should clear password by default
[ https://issues.apache.org/jira/browse/WICKET-6211?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sven Meier resolved WICKET-6211. Resolution: Fixed Fix Version/s: 7.5.0 8.0.0-M2 By default PasswordTextField nullifies its model object now, #setResetPassword() can be used to change this. > PasswordTextField should clear password by default > -- > > Key: WICKET-6211 > URL: https://issues.apache.org/jira/browse/WICKET-6211 > Project: Wicket > Issue Type: Improvement > Components: wicket >Affects Versions: 7.3.0, 8.0.0-M1 >Reporter: Sven Meier >Assignee: Sven Meier >Priority: Minor > Fix For: 8.0.0-M2, 7.5.0 > > > If the application developer does not take extra care, the password entered > via PasswordTextField is stored along with the containing page in the page > store. > This should be prevented by default by clearing the model object after each > request. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (WICKET-6211) PasswordTextField should clear password by default
[ https://issues.apache.org/jira/browse/WICKET-6211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15384954#comment-15384954 ] ASF subversion and git services commented on WICKET-6211: - Commit 403db75509d386242c3ee91fb0b8ef16bedf8920 in wicket's branch refs/heads/master from [~svenmeier] [ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=403db75 ] WICKET-6211 clear password on detach > PasswordTextField should clear password by default > -- > > Key: WICKET-6211 > URL: https://issues.apache.org/jira/browse/WICKET-6211 > Project: Wicket > Issue Type: Improvement > Components: wicket >Affects Versions: 7.3.0, 8.0.0-M1 >Reporter: Sven Meier >Assignee: Sven Meier >Priority: Minor > > If the application developer does not take extra care, the password entered > via PasswordTextField is stored along with the containing page in the page > store. > This should be prevented by default by clearing the model object after each > request. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (WICKET-6211) PasswordTextField should clear password by default
[ https://issues.apache.org/jira/browse/WICKET-6211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15384953#comment-15384953 ] ASF subversion and git services commented on WICKET-6211: - Commit 280f7f0d023eab50fe224ea4b39d7b2aa512a467 in wicket's branch refs/heads/wicket-7.x from [~svenmeier] [ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=280f7f0 ] WICKET-6211 clear password on detach > PasswordTextField should clear password by default > -- > > Key: WICKET-6211 > URL: https://issues.apache.org/jira/browse/WICKET-6211 > Project: Wicket > Issue Type: Improvement > Components: wicket >Affects Versions: 7.3.0, 8.0.0-M1 >Reporter: Sven Meier >Assignee: Sven Meier >Priority: Minor > > If the application developer does not take extra care, the password entered > via PasswordTextField is stored along with the containing page in the page > store. > This should be prevented by default by clearing the model object after each > request. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
wicket git commit: WICKET-6211 clear password on detach
Repository: wicket Updated Branches: refs/heads/master 7fe591fa3 -> 403db7550 WICKET-6211 clear password on detach Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/403db755 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/403db755 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/403db755 Branch: refs/heads/master Commit: 403db75509d386242c3ee91fb0b8ef16bedf8920 Parents: 7fe591f Author: Sven Meier Authored: Tue Jul 19 23:50:17 2016 +0200 Committer: Sven Meier Committed: Tue Jul 19 23:59:58 2016 +0200 -- .../markup/html/form/PasswordTextField.java | 50 ++ .../markup/html/form/PasswordTextFieldTest.java | 97 2 files changed, 129 insertions(+), 18 deletions(-) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/403db755/wicket-core/src/main/java/org/apache/wicket/markup/html/form/PasswordTextField.java -- diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/PasswordTextField.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/PasswordTextField.java index cbb5010..334248c 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/PasswordTextField.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/PasswordTextField.java @@ -18,8 +18,6 @@ package org.apache.wicket.markup.html.form; import org.apache.wicket.markup.ComponentTag; import org.apache.wicket.model.IModel; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; /** @@ -28,6 +26,10 @@ import org.slf4j.LoggerFactory; * * By default this text field is required. If it is not, call {@link #setRequired(boolean)} with * value of false. + * + * Note that by default the model object is nullified after each request to prevent the entered + * password to be serialized along with the containing page, see {@link #setResetPassword(boolean)} + * for details. * * @author Jonathan Locke */ @@ -35,14 +37,8 @@ public class PasswordTextField extends TextField { private static final long serialVersionUID = 1L; - /** Log. */ - private static final Logger log = LoggerFactory.getLogger(PasswordTextField.class); - /** -* Flag indicating whether the contents of the field should be reset each time it is rendered. -* If true, the contents are emptied when the field is rendered. This is useful for -* login forms. If false, the contents of the model are put into the field. This is -* useful for entry forms where the contents of the model should be editable, or resubmitted. +* Should password be reset, see {@link #setResetPassword(boolean)}. */ private boolean resetPassword = true; @@ -67,12 +63,9 @@ public class PasswordTextField extends TextField } /** -* Flag indicating whether the contents of the field should be reset each time it is rendered. -* If true, the contents are emptied when the field is rendered. This is useful for -* login forms. If false, the contents of the model are put into the field. This is -* useful for entry forms where the contents of the model should be editable, or resubmitted. +* Should password be reset, see {@link #setResetPassword(boolean)}. * -* @return Returns the resetPassword. +* @return should password be resetted */ public final boolean getResetPassword() { @@ -80,10 +73,14 @@ public class PasswordTextField extends TextField } /** -* Flag indicating whether the contents of the field should be reset each time it is rendered. -* If true, the contents are emptied when the field is rendered. This is useful for -* login forms. If false, the contents of the model are put into the field. This is -* useful for entry forms where the contents of the model should be editable, or resubmitted. +* Flag indicating whether the password should be reset after each request. +* Additionally any present value is not rendered into the markup. +* +* If true, the model object is set to null after each request to prevent it +* being serialized along with the containing page. This is default and highly recommended +* for login forms. If false the model value is handled as in a standard +* {@link TextField}, this is useful for entry forms where the contents of the model should +* be editable, or resubmitted. * * @param resetPassword *The resetPassword to set. @@ -117,4 +114,21 @@ public class PasswordTextField extends TextField { return new Str
wicket git commit: WICKET-6211 clear password on detach
Repository: wicket Updated Branches: refs/heads/wicket-7.x 294de6944 -> 280f7f0d0 WICKET-6211 clear password on detach Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/280f7f0d Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/280f7f0d Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/280f7f0d Branch: refs/heads/wicket-7.x Commit: 280f7f0d023eab50fe224ea4b39d7b2aa512a467 Parents: 294de69 Author: Sven Meier Authored: Tue Jul 19 23:50:17 2016 +0200 Committer: Sven Meier Committed: Tue Jul 19 23:50:17 2016 +0200 -- .../markup/html/form/PasswordTextField.java | 50 ++ .../markup/html/form/PasswordTextFieldTest.java | 97 2 files changed, 129 insertions(+), 18 deletions(-) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/280f7f0d/wicket-core/src/main/java/org/apache/wicket/markup/html/form/PasswordTextField.java -- diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/PasswordTextField.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/PasswordTextField.java index da631a0..18b923c 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/PasswordTextField.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/PasswordTextField.java @@ -18,8 +18,6 @@ package org.apache.wicket.markup.html.form; import org.apache.wicket.markup.ComponentTag; import org.apache.wicket.model.IModel; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; /** @@ -28,6 +26,10 @@ import org.slf4j.LoggerFactory; * * By default this text field is required. If it is not, call {@link #setRequired(boolean)} with * value of false. + * + * Note that by default the model object is nullified after each request to prevent the entered + * password to be serialized along with the containing page, see {@link #setResetPassword(boolean)} + * for details. * * @author Jonathan Locke */ @@ -35,14 +37,8 @@ public class PasswordTextField extends TextField { private static final long serialVersionUID = 1L; - /** Log. */ - private static final Logger log = LoggerFactory.getLogger(PasswordTextField.class); - /** -* Flag indicating whether the contents of the field should be reset each time it is rendered. -* If true, the contents are emptied when the field is rendered. This is useful for -* login forms. If false, the contents of the model are put into the field. This is -* useful for entry forms where the contents of the model should be editable, or resubmitted. +* Should password be reset, see {@link #setResetPassword(boolean)}. */ private boolean resetPassword = true; @@ -67,12 +63,9 @@ public class PasswordTextField extends TextField } /** -* Flag indicating whether the contents of the field should be reset each time it is rendered. -* If true, the contents are emptied when the field is rendered. This is useful for -* login forms. If false, the contents of the model are put into the field. This is -* useful for entry forms where the contents of the model should be editable, or resubmitted. +* Should password be reset, see {@link #setResetPassword(boolean)}. * -* @return Returns the resetPassword. +* @return should password be resetted */ public final boolean getResetPassword() { @@ -80,10 +73,14 @@ public class PasswordTextField extends TextField } /** -* Flag indicating whether the contents of the field should be reset each time it is rendered. -* If true, the contents are emptied when the field is rendered. This is useful for -* login forms. If false, the contents of the model are put into the field. This is -* useful for entry forms where the contents of the model should be editable, or resubmitted. +* Flag indicating whether the password should be reset after each request. +* Additionally any present value is not rendered into the markup. +* +* If true, the model object is set to null after each request to prevent it +* being serialized along with the containing page. This is default and highly recommended +* for login forms. If false the model value is handled as in a standard +* {@link TextField}, this is useful for entry forms where the contents of the model should +* be editable, or resubmitted. * * @param resetPassword *The resetPassword to set. @@ -120,4 +117,21 @@ public class PasswordTextField extends TextField { return
[jira] [Commented] (WICKET-6210) FileUpload does not support files of zero size
[ https://issues.apache.org/jira/browse/WICKET-6210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15384927#comment-15384927 ] Martin Grigorov commented on WICKET-6210: - This sounds like an issue with the web server. Please provide more information about your environment. A quickstart would be good too! > FileUpload does not support files of zero size > -- > > Key: WICKET-6210 > URL: https://issues.apache.org/jira/browse/WICKET-6210 > Project: Wicket > Issue Type: Bug > Components: wicket >Affects Versions: 6.22.0 >Reporter: Matt Pavlovich > > When attempting to use the wicket fileupload component, if the user selects a > file of size zero, the operation fails. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Created] (WICKET-6211) PasswordTextField should clear password by default
Sven Meier created WICKET-6211: -- Summary: PasswordTextField should clear password by default Key: WICKET-6211 URL: https://issues.apache.org/jira/browse/WICKET-6211 Project: Wicket Issue Type: Improvement Components: wicket Affects Versions: 8.0.0-M1, 7.3.0 Reporter: Sven Meier Assignee: Sven Meier Priority: Minor If the application developer does not take extra care, the password entered via PasswordTextField is stored along with the containing page in the page store. This should be prevented by default by clearing the model object after each request. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Resolved] (WICKET-6209) requesting focus on disabled field fails with error in IE8
[ https://issues.apache.org/jira/browse/WICKET-6209?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sven Meier resolved WICKET-6209. Resolution: Fixed Fix Version/s: 8.0.0-M2 7.5.0 6.25.0 try-catch wraps #focus() again > requesting focus on disabled field fails with error in IE8 > -- > > Key: WICKET-6209 > URL: https://issues.apache.org/jira/browse/WICKET-6209 > Project: Wicket > Issue Type: Bug > Components: wicket >Affects Versions: 7.3.0, 6.23.0, 8.0.0-M2 >Reporter: Sven Meier >Assignee: Sven Meier >Priority: Minor > Fix For: 6.25.0, 7.5.0, 8.0.0-M2 > > > IE8 reports an error when focus is set on a *then* disabled component: > - user clicks AjaxCheckBox > - server disables checkbox and updates it via ART > - wicket-ajax-jquery.js tries to restore focus > This problem occurs since WIcket 6.20, presumably caused by WICKET-5858. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (WICKET-5755) Restoring focus after Ajax replace no longer works in IE8
[ https://issues.apache.org/jira/browse/WICKET-5755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15384901#comment-15384901 ] ASF subversion and git services commented on WICKET-5755: - Commit 294de69449850b761f647a57fd13a46265aa4cb9 in wicket's branch refs/heads/wicket-7.x from [~svenmeier] [ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=294de69 ] WICKET-6209 move try-catch into function which is invoked via #setTimeout(), so IE errors get caught ;removed workaround for WicketWICKET-5755, i.e. directly call #requestFocus() since it now always uses #setTimeout() to request focus (see WICKET-5858) > Restoring focus after Ajax replace no longer works in IE8 > - > > Key: WICKET-5755 > URL: https://issues.apache.org/jira/browse/WICKET-5755 > Project: Wicket > Issue Type: Bug > Components: wicket >Affects Versions: 6.17.0 >Reporter: Sven Meier >Assignee: Sven Meier > Fix For: 7.0.0-M4, 6.19.0 > > > In IE8 focus is no longer reliably restored to the former focus owner after > Ajax request. > This regression is caused by WICKET-5564. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (WICKET-6209) requesting focus on disabled field fails with error in IE8
[ https://issues.apache.org/jira/browse/WICKET-6209?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15384897#comment-15384897 ] ASF subversion and git services commented on WICKET-6209: - Commit 7fe591fa301f4e7da65141643c428ea9a3f01aa6 in wicket's branch refs/heads/master from [~svenmeier] [ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=7fe591f ] WICKET-6209 move try-catch into function which is invoked via #setTimeout(), so IE errors get caught ;removed workaround for WicketWICKET-5755, i.e. directly call #requestFocus() since it now always uses #setTimeout() to request focus (see WICKET-5858) > requesting focus on disabled field fails with error in IE8 > -- > > Key: WICKET-6209 > URL: https://issues.apache.org/jira/browse/WICKET-6209 > Project: Wicket > Issue Type: Bug > Components: wicket >Affects Versions: 7.3.0, 6.23.0, 8.0.0-M2 >Reporter: Sven Meier >Assignee: Sven Meier >Priority: Minor > > IE8 reports an error when focus is set on a *then* disabled component: > - user clicks AjaxCheckBox > - server disables checkbox and updates it via ART > - wicket-ajax-jquery.js tries to restore focus > This problem occurs since WIcket 6.20, presumably caused by WICKET-5858. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (WICKET-5858) AjaxRequestTarget.focusComponent does not work in modal window
[ https://issues.apache.org/jira/browse/WICKET-5858?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15384899#comment-15384899 ] ASF subversion and git services commented on WICKET-5858: - Commit 7fe591fa301f4e7da65141643c428ea9a3f01aa6 in wicket's branch refs/heads/master from [~svenmeier] [ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=7fe591f ] WICKET-6209 move try-catch into function which is invoked via #setTimeout(), so IE errors get caught ;removed workaround for WicketWICKET-5755, i.e. directly call #requestFocus() since it now always uses #setTimeout() to request focus (see WICKET-5858) > AjaxRequestTarget.focusComponent does not work in modal window > -- > > Key: WICKET-5858 > URL: https://issues.apache.org/jira/browse/WICKET-5858 > Project: Wicket > Issue Type: Bug > Components: wicket >Affects Versions: 6.19.0 >Reporter: Mikk Lauringson >Assignee: Tobias Soloschenko > Fix For: 6.20.0, 7.0.0-M6 > > Attachments: WICKET-5858.zip > > > Opening modal window and focusing a field in it does not work anymore. > This worked in Wicket 6.16.0 and older versions, but does not work in 6.17.0, > 6.18.0 and 6.19.0. > This is basically same issue as WICKET-5781 but it was wrongly marked as > duplicate of WICKET-5755 and resolved in 6.19.0. They are actually different > problems and this problem is still not fixed in 6.19.0. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (WICKET-5755) Restoring focus after Ajax replace no longer works in IE8
[ https://issues.apache.org/jira/browse/WICKET-5755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15384904#comment-15384904 ] ASF subversion and git services commented on WICKET-5755: - Commit 4d10d11a7894617364d23ac3a4f3068a60f7ec62 in wicket's branch refs/heads/wicket-6.x from [~svenmeier] [ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=4d10d11 ] WICKET-6209 move try-catch into function which is invoked via #setTimeout(), so IE errors get caught ;removed workaround for WicketWICKET-5755, i.e. directly call #requestFocus() since it now always uses #setTimeout() to request focus (see WICKET-5858) > Restoring focus after Ajax replace no longer works in IE8 > - > > Key: WICKET-5755 > URL: https://issues.apache.org/jira/browse/WICKET-5755 > Project: Wicket > Issue Type: Bug > Components: wicket >Affects Versions: 6.17.0 >Reporter: Sven Meier >Assignee: Sven Meier > Fix For: 7.0.0-M4, 6.19.0 > > > In IE8 focus is no longer reliably restored to the former focus owner after > Ajax request. > This regression is caused by WICKET-5564. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (WICKET-6209) requesting focus on disabled field fails with error in IE8
[ https://issues.apache.org/jira/browse/WICKET-6209?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15384903#comment-15384903 ] ASF subversion and git services commented on WICKET-6209: - Commit 4d10d11a7894617364d23ac3a4f3068a60f7ec62 in wicket's branch refs/heads/wicket-6.x from [~svenmeier] [ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=4d10d11 ] WICKET-6209 move try-catch into function which is invoked via #setTimeout(), so IE errors get caught ;removed workaround for WicketWICKET-5755, i.e. directly call #requestFocus() since it now always uses #setTimeout() to request focus (see WICKET-5858) > requesting focus on disabled field fails with error in IE8 > -- > > Key: WICKET-6209 > URL: https://issues.apache.org/jira/browse/WICKET-6209 > Project: Wicket > Issue Type: Bug > Components: wicket >Affects Versions: 7.3.0, 6.23.0, 8.0.0-M2 >Reporter: Sven Meier >Assignee: Sven Meier >Priority: Minor > > IE8 reports an error when focus is set on a *then* disabled component: > - user clicks AjaxCheckBox > - server disables checkbox and updates it via ART > - wicket-ajax-jquery.js tries to restore focus > This problem occurs since WIcket 6.20, presumably caused by WICKET-5858. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (WICKET-5858) AjaxRequestTarget.focusComponent does not work in modal window
[ https://issues.apache.org/jira/browse/WICKET-5858?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15384902#comment-15384902 ] ASF subversion and git services commented on WICKET-5858: - Commit 294de69449850b761f647a57fd13a46265aa4cb9 in wicket's branch refs/heads/wicket-7.x from [~svenmeier] [ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=294de69 ] WICKET-6209 move try-catch into function which is invoked via #setTimeout(), so IE errors get caught ;removed workaround for WicketWICKET-5755, i.e. directly call #requestFocus() since it now always uses #setTimeout() to request focus (see WICKET-5858) > AjaxRequestTarget.focusComponent does not work in modal window > -- > > Key: WICKET-5858 > URL: https://issues.apache.org/jira/browse/WICKET-5858 > Project: Wicket > Issue Type: Bug > Components: wicket >Affects Versions: 6.19.0 >Reporter: Mikk Lauringson >Assignee: Tobias Soloschenko > Fix For: 6.20.0, 7.0.0-M6 > > Attachments: WICKET-5858.zip > > > Opening modal window and focusing a field in it does not work anymore. > This worked in Wicket 6.16.0 and older versions, but does not work in 6.17.0, > 6.18.0 and 6.19.0. > This is basically same issue as WICKET-5781 but it was wrongly marked as > duplicate of WICKET-5755 and resolved in 6.19.0. They are actually different > problems and this problem is still not fixed in 6.19.0. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (WICKET-5755) Restoring focus after Ajax replace no longer works in IE8
[ https://issues.apache.org/jira/browse/WICKET-5755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15384898#comment-15384898 ] ASF subversion and git services commented on WICKET-5755: - Commit 7fe591fa301f4e7da65141643c428ea9a3f01aa6 in wicket's branch refs/heads/master from [~svenmeier] [ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=7fe591f ] WICKET-6209 move try-catch into function which is invoked via #setTimeout(), so IE errors get caught ;removed workaround for WicketWICKET-5755, i.e. directly call #requestFocus() since it now always uses #setTimeout() to request focus (see WICKET-5858) > Restoring focus after Ajax replace no longer works in IE8 > - > > Key: WICKET-5755 > URL: https://issues.apache.org/jira/browse/WICKET-5755 > Project: Wicket > Issue Type: Bug > Components: wicket >Affects Versions: 6.17.0 >Reporter: Sven Meier >Assignee: Sven Meier > Fix For: 7.0.0-M4, 6.19.0 > > > In IE8 focus is no longer reliably restored to the former focus owner after > Ajax request. > This regression is caused by WICKET-5564. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
wicket git commit: WICKET-6209 move try-catch into function which is invoked via #setTimeout(), so IE errors get caught
Repository: wicket Updated Branches: refs/heads/wicket-6.x 573e278f1 -> 4d10d11a7 WICKET-6209 move try-catch into function which is invoked via #setTimeout(), so IE errors get caught ;removed workaround for WicketWICKET-5755, i.e. directly call #requestFocus() since it now always uses #setTimeout() to request focus (see WICKET-5858) Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/4d10d11a Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/4d10d11a Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/4d10d11a Branch: refs/heads/wicket-6.x Commit: 4d10d11a7894617364d23ac3a4f3068a60f7ec62 Parents: 573e278 Author: Sven Meier Authored: Tue Jul 19 22:47:15 2016 +0200 Committer: Sven Meier Committed: Tue Jul 19 22:47:41 2016 +0200 -- .../wicket/ajax/res/js/wicket-ajax-jquery.js| 47 +--- 1 file changed, 22 insertions(+), 25 deletions(-) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/4d10d11a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js -- diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js index a4f623d..b2265a8 100644 --- a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js +++ b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js @@ -1103,13 +1103,7 @@ // IE this will cause double events for everything.. (mostly because of the jQuery.proxy(element)) Wicket.Focus.attachFocusEvent(); - // set the focus to the last component - if (Wicket.Browser.isIELessThan9()) { - // WICKET-5755 - window.setTimeout("Wicket.Focus.requestFocus();", 0); - } else { - Wicket.Focus.requestFocus(); - } + Wicket.Focus.requestFocus(); // continue to next step (which should make the processing stop, as success should be the final step) return FunctionsExecuter.DONE; @@ -2714,30 +2708,33 @@ if (toFocus) { Wicket.Log.info("Calling focus on " + WF.lastFocusId); - try { - if (WF.focusSetFromServer) { - // WICKET-5858 - window.setTimeout(function () { toFocus.focus(); }, 0); - } else { - // avoid loops like - onfocus triggering an event the modifies the tag => refocus => the event is triggered again - var temp = toFocus.onfocus; - toFocus.onfocus = null; - - // IE needs setTimeout (it seems not to call onfocus sync. when focus() is called - window.setTimeout(function () {toFocus.focus(); toFocus.onfocus = temp; }, 0); + + var safeFocus = function() { + try { + toFocus.focus(); + } catch (ignore) { + // WICKET-6209 IE fails if toFocus is disabled } - } catch (ignore) { + }; + + if (WF.focusSetFromServer) { + // WICKET-5858 + window.setTimeout(safeFocus, 0); + } else { + // avoid loops like - onfocus triggering an event the modifies the tag => refocus => the event is triggered again +
[jira] [Commented] (WICKET-6209) requesting focus on disabled field fails with error in IE8
[ https://issues.apache.org/jira/browse/WICKET-6209?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15384900#comment-15384900 ] ASF subversion and git services commented on WICKET-6209: - Commit 294de69449850b761f647a57fd13a46265aa4cb9 in wicket's branch refs/heads/wicket-7.x from [~svenmeier] [ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=294de69 ] WICKET-6209 move try-catch into function which is invoked via #setTimeout(), so IE errors get caught ;removed workaround for WicketWICKET-5755, i.e. directly call #requestFocus() since it now always uses #setTimeout() to request focus (see WICKET-5858) > requesting focus on disabled field fails with error in IE8 > -- > > Key: WICKET-6209 > URL: https://issues.apache.org/jira/browse/WICKET-6209 > Project: Wicket > Issue Type: Bug > Components: wicket >Affects Versions: 7.3.0, 6.23.0, 8.0.0-M2 >Reporter: Sven Meier >Assignee: Sven Meier >Priority: Minor > > IE8 reports an error when focus is set on a *then* disabled component: > - user clicks AjaxCheckBox > - server disables checkbox and updates it via ART > - wicket-ajax-jquery.js tries to restore focus > This problem occurs since WIcket 6.20, presumably caused by WICKET-5858. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (WICKET-5858) AjaxRequestTarget.focusComponent does not work in modal window
[ https://issues.apache.org/jira/browse/WICKET-5858?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15384905#comment-15384905 ] ASF subversion and git services commented on WICKET-5858: - Commit 4d10d11a7894617364d23ac3a4f3068a60f7ec62 in wicket's branch refs/heads/wicket-6.x from [~svenmeier] [ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=4d10d11 ] WICKET-6209 move try-catch into function which is invoked via #setTimeout(), so IE errors get caught ;removed workaround for WicketWICKET-5755, i.e. directly call #requestFocus() since it now always uses #setTimeout() to request focus (see WICKET-5858) > AjaxRequestTarget.focusComponent does not work in modal window > -- > > Key: WICKET-5858 > URL: https://issues.apache.org/jira/browse/WICKET-5858 > Project: Wicket > Issue Type: Bug > Components: wicket >Affects Versions: 6.19.0 >Reporter: Mikk Lauringson >Assignee: Tobias Soloschenko > Fix For: 6.20.0, 7.0.0-M6 > > Attachments: WICKET-5858.zip > > > Opening modal window and focusing a field in it does not work anymore. > This worked in Wicket 6.16.0 and older versions, but does not work in 6.17.0, > 6.18.0 and 6.19.0. > This is basically same issue as WICKET-5781 but it was wrongly marked as > duplicate of WICKET-5755 and resolved in 6.19.0. They are actually different > problems and this problem is still not fixed in 6.19.0. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
wicket git commit: WICKET-6209 move try-catch into function which is invoked via #setTimeout(), so IE errors get caught
Repository: wicket Updated Branches: refs/heads/master 7401712f8 -> 7fe591fa3 WICKET-6209 move try-catch into function which is invoked via #setTimeout(), so IE errors get caught ;removed workaround for WicketWICKET-5755, i.e. directly call #requestFocus() since it now always uses #setTimeout() to request focus (see WICKET-5858) Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/7fe591fa Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/7fe591fa Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/7fe591fa Branch: refs/heads/master Commit: 7fe591fa301f4e7da65141643c428ea9a3f01aa6 Parents: 7401712 Author: Sven Meier Authored: Tue Jul 19 22:47:15 2016 +0200 Committer: Sven Meier Committed: Tue Jul 19 23:04:42 2016 +0200 -- .../wicket/ajax/res/js/wicket-ajax-jquery.js| 47 +--- 1 file changed, 22 insertions(+), 25 deletions(-) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/7fe591fa/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js -- diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js index a7aa0d9..f0c5c12 100644 --- a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js +++ b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js @@ -1098,13 +1098,7 @@ this._executeHandlers(attrs.sh, attrs, null, null, 'success'); Wicket.Event.publish(Wicket.Event.Topic.AJAX_CALL_SUCCESS, attrs, null, null, 'success'); - // set the focus to the last component - if (Wicket.Browser.isIELessThan9()) { - // WICKET-5755 - window.setTimeout("Wicket.Focus.requestFocus();", 0); - } else { - Wicket.Focus.requestFocus(); - } + Wicket.Focus.requestFocus(); // continue to next step (which should make the processing stop, as success should be the final step) return FunctionsExecuter.DONE; @@ -2702,30 +2696,33 @@ if (toFocus) { Wicket.Log.info("Calling focus on " + WF.lastFocusId); - try { - if (WF.focusSetFromServer) { - // WICKET-5858 - window.setTimeout(function () { toFocus.focus(); }, 0); - } else { - // avoid loops like - onfocus triggering an event the modifies the tag => refocus => the event is triggered again - var temp = toFocus.onfocus; - toFocus.onfocus = null; - - // IE needs setTimeout (it seems not to call onfocus sync. when focus() is called - window.setTimeout(function () {toFocus.focus(); toFocus.onfocus = temp; }, 0); + + var safeFocus = function() { + try { + toFocus.focus(); + } catch (ignore) { + // WICKET-6209 IE fails if toFocus is disabled } - } catch (ignore) { + }; + + if (WF.focusSetFromServer) { + // WICKET-5858 + window.setTimeout(safeFocus, 0); + } else { + // avoid loops like - onfocus triggering an event the modifies the tag => refocus => the event is triggered again +
wicket git commit: WICKET-6209 move try-catch into function which is invoked via #setTimeout(), so IE errors get caught
Repository: wicket Updated Branches: refs/heads/wicket-7.x 6bb5a20f9 -> 294de6944 WICKET-6209 move try-catch into function which is invoked via #setTimeout(), so IE errors get caught ;removed workaround for WicketWICKET-5755, i.e. directly call #requestFocus() since it now always uses #setTimeout() to request focus (see WICKET-5858) Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/294de694 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/294de694 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/294de694 Branch: refs/heads/wicket-7.x Commit: 294de69449850b761f647a57fd13a46265aa4cb9 Parents: 6bb5a20 Author: Sven Meier Authored: Tue Jul 19 22:47:15 2016 +0200 Committer: Sven Meier Committed: Tue Jul 19 23:02:52 2016 +0200 -- .../wicket/ajax/res/js/wicket-ajax-jquery.js| 47 +--- 1 file changed, 22 insertions(+), 25 deletions(-) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/294de694/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js -- diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js index a7aa0d9..f0c5c12 100644 --- a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js +++ b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js @@ -1098,13 +1098,7 @@ this._executeHandlers(attrs.sh, attrs, null, null, 'success'); Wicket.Event.publish(Wicket.Event.Topic.AJAX_CALL_SUCCESS, attrs, null, null, 'success'); - // set the focus to the last component - if (Wicket.Browser.isIELessThan9()) { - // WICKET-5755 - window.setTimeout("Wicket.Focus.requestFocus();", 0); - } else { - Wicket.Focus.requestFocus(); - } + Wicket.Focus.requestFocus(); // continue to next step (which should make the processing stop, as success should be the final step) return FunctionsExecuter.DONE; @@ -2702,30 +2696,33 @@ if (toFocus) { Wicket.Log.info("Calling focus on " + WF.lastFocusId); - try { - if (WF.focusSetFromServer) { - // WICKET-5858 - window.setTimeout(function () { toFocus.focus(); }, 0); - } else { - // avoid loops like - onfocus triggering an event the modifies the tag => refocus => the event is triggered again - var temp = toFocus.onfocus; - toFocus.onfocus = null; - - // IE needs setTimeout (it seems not to call onfocus sync. when focus() is called - window.setTimeout(function () {toFocus.focus(); toFocus.onfocus = temp; }, 0); + + var safeFocus = function() { + try { + toFocus.focus(); + } catch (ignore) { + // WICKET-6209 IE fails if toFocus is disabled } - } catch (ignore) { + }; + + if (WF.focusSetFromServer) { + // WICKET-5858 + window.setTimeout(safeFocus, 0); + } else { + // avoid loops like - onfocus triggering an event the modifies the tag => refocus => the event is triggered again +
[jira] [Created] (WICKET-6210) FileUpload does not support files of zero size
Matt Pavlovich created WICKET-6210: -- Summary: FileUpload does not support files of zero size Key: WICKET-6210 URL: https://issues.apache.org/jira/browse/WICKET-6210 Project: Wicket Issue Type: Bug Components: wicket Affects Versions: 6.22.0 Reporter: Matt Pavlovich When attempting to use the wicket fileupload component, if the user selects a file of size zero, the operation fails. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (WICKET-6209) requesting focus on disabled field fails with error in IE8
[ https://issues.apache.org/jira/browse/WICKET-6209?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15384785#comment-15384785 ] Sven Meier commented on WICKET-6209: the try-catch has no effect any more because of the #setTimeout() call > requesting focus on disabled field fails with error in IE8 > -- > > Key: WICKET-6209 > URL: https://issues.apache.org/jira/browse/WICKET-6209 > Project: Wicket > Issue Type: Bug > Components: wicket >Affects Versions: 7.3.0, 6.23.0, 8.0.0-M2 >Reporter: Sven Meier >Assignee: Sven Meier >Priority: Minor > > IE8 reports an error when focus is set on a *then* disabled component: > - user clicks AjaxCheckBox > - server disables checkbox and updates it via ART > - wicket-ajax-jquery.js tries to restore focus > This problem occurs since WIcket 6.20, presumably caused by WICKET-5858. -- This message was sent by Atlassian JIRA (v6.3.4#6332)