You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2009/07/06 06:12:45 UTC

svn commit: r791372 - /myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java

Author: bommel
Date: Mon Jul  6 04:12:44 2009
New Revision: 791372

URL: http://svn.apache.org/viewvc?rev=791372&view=rev
Log:
(TOBAGO-748) <tc:command> with <facet name="change"> inside of selectOneChoice lost focus after action

Modified:
    myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java?rev=791372&r1=791371&r2=791372&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java Mon Jul  6 04:12:44 2009
@@ -87,17 +87,23 @@
       "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Frameset//EN\""
           + " \"http://www.w3.org/TR/html4/frameset.dtd\">";
   private static final String CLIENT_DEBUG_SEVERITY = "clientDebugSeverity";
-
+  private static final String LAST_FOCUS_ID = "lastFocusId";  
 
   @Override
   public void decode(FacesContext facesContext, UIComponent component) {
     super.decode(facesContext, component);
-    String name = component.getClientId(facesContext) + SUBCOMPONENT_SEP + "clientSeverity";
+    String clientId = component.getClientId(facesContext);
     ExternalContext externalContext = facesContext.getExternalContext();
-    String severity = (String) externalContext.getRequestParameterMap().get(name);
+    String severity =
+        (String) externalContext.getRequestParameterMap().get(clientId + SUBCOMPONENT_SEP + "clientSeverity");
     if (severity != null) {
       externalContext.getRequestMap().put(CLIENT_DEBUG_SEVERITY, severity);
     }
+    String lastFocusId =
+        (String) externalContext.getRequestParameterMap().get(clientId + SUBCOMPONENT_SEP + LAST_FOCUS_ID);
+    if (lastFocusId != null) {
+      component.getAttributes().put(LAST_FOCUS_ID, lastFocusId);
+    }
   }
 
   @Override
@@ -409,10 +415,10 @@
       RenderUtil.encode(facesContext, hidden);
     }
 
-    String lastFocusIdParameter = component.getClientId(facesContext) + SUBCOMPONENT_SEP + "lastFocusId";
-    String lastFocusId = (String) facesContext.getExternalContext().getRequestParameterMap().get(lastFocusIdParameter);
+    String lastFocusId = (String) component.getAttributes().get(LAST_FOCUS_ID);
     if (lastFocusId != null) {
       writer.writeJavascript("Tobago.lastFocusId = '" + lastFocusId + "';");
+      component.getAttributes().remove(LAST_FOCUS_ID);
     }
 
     //checkForCommandFacet(component, facesContext, writer);