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:11:46 UTC
svn commit: r791371 -
/myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java
Author: bommel
Date: Mon Jul 6 04:11:46 2009
New Revision: 791371
URL: http://svn.apache.org/viewvc?rev=791371&view=rev
Log:
(TOBAGO-748) <tc:command> with <facet name="change"> inside of selectOneChoice lost focus after action
Modified:
myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java
Modified: myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java?rev=791371&r1=791370&r2=791371&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java (original)
+++ myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java Mon Jul 6 04:11:46 2009
@@ -97,16 +97,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";
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);
+ }
updatePageState(facesContext, component);
}
@@ -442,11 +449,10 @@
UIComponent hidden = component.getFacet("backButtonDetector");
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);