Author: ivaynberg Date: Thu Aug 30 22:07:20 2007 New Revision: 571380 URL: http://svn.apache.org/viewvc?rev=571380&view=rev Log: todo for the future
Modified: wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/AjaxEditableLabel.java Modified: wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/AjaxEditableLabel.java URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/AjaxEditableLabel.java?rev=571380&r1=571379&r2=571380&view=diff ============================================================================== --- wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/AjaxEditableLabel.java (original) +++ wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/AjaxEditableLabel.java Thu Aug 30 22:07:20 2007 @@ -69,6 +69,7 @@ * @author Igor Vaynberg (ivaynberg) * @author Eelco Hillenius */ +// TODO wonder if it makes sense to refactor this into a formcomponentpanel public class AjaxEditableLabel extends Panel { private static final long serialVersionUID = 1L; @@ -94,13 +95,16 @@ protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); - final String saveCall = "{" + generateCallbackScript("wicketAjaxGet('" + getCallbackUrl() - + "&save=true&'+this.name+'='+wicketEncode(this.value)") + "; return false;}"; + final String saveCall = "{" + + generateCallbackScript("wicketAjaxGet('" + getCallbackUrl() + + "&save=true&'+this.name+'='+wicketEncode(this.value)") + + "; return false;}"; - final String cancelCall = "{" + generateCallbackScript("wicketAjaxGet('" + getCallbackUrl() - + "&save=false'") + "; return false;}"; - + final String cancelCall = "{" + + generateCallbackScript("wicketAjaxGet('" + getCallbackUrl() + "&save=false'") + + "; return false;}"; + final String keypress = "var kc=wicketKeyCode(event); if (kc==27) " + cancelCall + " else if (kc!=13) { return true; } else " + saveCall;