You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by jd...@apache.org on 2008/12/20 23:19:38 UTC

svn commit: r728360 - in /wicket/trunk/wicket/src/main/java/org/apache/wicket/markup: html/form/AbstractSingleSelectChoice.java html/form/FormComponent.java resolver/WicketMessageResolver.java

Author: jdonnerstag
Date: Sat Dec 20 14:19:38 2008
New Revision: 728360

URL: http://svn.apache.org/viewvc?rev=728360&view=rev
Log:
wicket-1851: Default lookup keys don't work when UseDefaultOnMissingResource is false

Modified:
    wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/form/AbstractSingleSelectChoice.java
    wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java
    wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/resolver/WicketMessageResolver.java

Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/form/AbstractSingleSelectChoice.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/form/AbstractSingleSelectChoice.java?rev=728360&r1=728359&r2=728360&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/form/AbstractSingleSelectChoice.java (original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/form/AbstractSingleSelectChoice.java Sat Dec 20 14:19:38 2008
@@ -232,7 +232,8 @@
 		if (isNullValid())
 		{
 			// Null is valid, so look up the value for it
-			String option = getLocalizer().getString(getId() + ".nullValid", this, "");
+			String option = getLocalizer().getStringIgnoreSettings(getId() + ".nullValid", this,
+				null, null);
 			if (Strings.isEmpty(option))
 			{
 				option = getLocalizer().getString("nullValid", this, "");
@@ -241,7 +242,6 @@
 			// The <option> tag buffer
 			final AppendingStringBuffer buffer = new AppendingStringBuffer(32 + option.length());
 
-
 			// Add option tag
 			buffer.append("\n<option");
 
@@ -262,7 +262,8 @@
 				selected.equals(EMPTY_STRING))
 			{
 				// Force the user to pick a non-null value
-				String option = getLocalizer().getString(getId() + ".null", this, "");
+				String option = getLocalizer().getStringIgnoreSettings(getId() + ".null", this,
+					null, null);
 				if (Strings.isEmpty(option))
 				{
 					option = getLocalizer().getString("null", this, CHOOSE_ONE);

Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java?rev=728360&r1=728359&r2=728360&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java (original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java Sat Dec 20 14:19:38 2008
@@ -162,16 +162,12 @@
 			// First use the parent for resolving so that
 			// form1.textfield1.Required can be used.
 
-			// Note: It is important that the default value of "" is provided
-			// to getString() not to throw a MissingResourceException or to
-			// return a default string like "[Warning: String ..."
 			String message = getString(localizer, resource, formComponent.getParent());
 
 			// If not found, than ...
 			if (Strings.isEmpty(message))
 			{
 				// Try a variation of the resource key
-
 				resource = prefix + key;
 
 				message = getString(localizer, resource, formComponent.getParent());
@@ -208,6 +204,13 @@
 			return message;
 		}
 
+		/**
+		 * 
+		 * @param localizer
+		 * @param key
+		 * @param component
+		 * @return string
+		 */
 		private String getString(Localizer localizer, String key, Component component)
 		{
 			triedKeys.add(key);
@@ -1267,7 +1270,7 @@
 	 * Usually the user should do custom conversions by specifying an {@link IConverter} by
 	 * registering it with the application by overriding {@link Application#getConverterLocator()},
 	 * or at the component level by overriding {@link #getConverter()}.
-     * </p>
+	 * </p>
 	 * 
 	 * @see IConverterLocator
 	 * @see Application#newConverterLocator()

Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/resolver/WicketMessageResolver.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/resolver/WicketMessageResolver.java?rev=728360&r1=728359&r2=728360&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/resolver/WicketMessageResolver.java (original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/resolver/WicketMessageResolver.java Sat Dec 20 14:19:38 2008
@@ -211,6 +211,7 @@
 			}
 			else
 			{
+				// TODO Doesn't localizer already throw an exception?!?!
 				if (isThrowExceptionIfPropertyNotFound() == true)
 				{
 					throw new WicketRuntimeException("Property '" + key +