Return-Path: Delivered-To: apmail-myfaces-users-archive@www.apache.org Received: (qmail 94524 invoked from network); 16 Sep 2007 19:52:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Sep 2007 19:52:44 -0000 Received: (qmail 87125 invoked by uid 500); 16 Sep 2007 19:52:33 -0000 Delivered-To: apmail-myfaces-users-archive@myfaces.apache.org Received: (qmail 87095 invoked by uid 500); 16 Sep 2007 19:52:32 -0000 Mailing-List: contact users-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Discussion" Delivered-To: mailing list users@myfaces.apache.org Received: (qmail 87084 invoked by uid 99); 16 Sep 2007 19:52:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 16 Sep 2007 12:52:32 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of martin.marinschek@gmail.com designates 209.85.134.190 as permitted sender) Received: from [209.85.134.190] (HELO mu-out-0910.google.com) (209.85.134.190) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 16 Sep 2007 19:52:30 +0000 Received: by mu-out-0910.google.com with SMTP id i10so2347557mue for ; Sun, 16 Sep 2007 12:52:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=/BDGdiOUYOKWPYM9h0B1J997iSysXOIf8yBoAFZsO2o=; b=JT4+FpvcIrVxhKyb3zNn95gYij9YUHCLEz6O19seeO75GbOJPqXdgGqyu0soukPgbC9XQdgS3+2Ekcax4krWPe5nHe/05ERL3ezziEFM3gnbx4spRn6kDoSshsnzE3ZPm1Ay30qr1oAfk9SBVPdxlEmoTV2LukjwQofU7Q2gyHc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=AcFwg470ARoo/Po1hznifKym6xc7BIEfCRiFtQTucA1m98nsIeQqXszXsFxH048qpZOj0H6BFBEyKmRTL7MNNnuszWCfTYSvyeMtQiZFfcC9yuim2r42vrp2pDF1HblyI/vWF6PWYUxBAtn1eJZ1CuBa7tNU3prmhX6VlEkeW+c= Received: by 10.86.65.11 with SMTP id n11mr3111020fga.1189972327980; Sun, 16 Sep 2007 12:52:07 -0700 (PDT) Received: by 10.86.27.13 with HTTP; Sun, 16 Sep 2007 12:52:07 -0700 (PDT) Message-ID: <5a99335f0709161252o638fa11bn40d16656d3dfccab@mail.gmail.com> Date: Sun, 16 Sep 2007 21:52:07 +0200 From: "Martin Marinschek" To: "MyFaces Discussion" Subject: Re: [JSF1.2] JspViewHandlerImpl flushing issue (was Re: [Trinidad] tr:table PPR failing) In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <6dac79b90709141353n4462d811nc658495d88e8cfb9@mail.gmail.com> <5a99335f0709142047g1a115a77h5c65636986fe8a38@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org Please create an issue on our issue tracker and attach this patch! regards, Martin On 9/15/07, Timothy M. Braun wrote: > Not sure if this will work for you. Tried using eclipse to create the > patch, but with the way I changed the source it didn't seem to like it > very much. > > Basically I moved lines 321 and 322 so they were after line 336. This > way the flush is called after the endDocument method is called. > > Hope this helps, > Tim > > > Index: JspViewHandlerImpl.java > =================================================================== > RCS file: > /var/cvsroot/org.fv.vbm/src/org/apache/myfaces/application/jsp/JspViewHa > ndlerImpl.java,v > retrieving revision 1.1 > diff -r1.1 JspViewHandlerImpl.java > 321,323d320 > < // > response.getWriter().write(stateAwareWriter.parseResponse()); > < stateAwareWriter.flushToWriter(response.getWriter()); > < > 336a334,337 > > > > // > response.getWriter().write(stateAwareWriter.parseResponse()); > > // Timothy M. Braun: Moved here to fix writer flush errors > > stateAwareWriter.flushToWriter(response.getWriter()); > > > > -----Original Message----- > From: Martin Marinschek [mailto:martin.marinschek@gmail.com] > Sent: Friday, September 14, 2007 11:48 PM > To: MyFaces Discussion > Subject: Re: [JSF1.2] JspViewHandlerImpl flushing issue (was Re: > [Trinidad] tr:table PPR failing) > > Hi Tim, > > could you supply a patch versus the new source-code - or somehow else > highlight the differences you did? > > regards, > > Martin > > On 9/14/07, Adam Winer wrote: > > (Changing subject to bring this to the attention of non-Trinidad > folks) > > Tim, could you file a MYFACES JIRA issue? This looks like an > important > > issue. It also explains why I haven't really seen this - I've done > 95% of > > my testing with the RI, not the MyFaces 1.2 impl. > > > > -- Adam > > > > > > > > On 9/14/07, Timothy M. Braun < TBraun@fellowshipvillage.org> wrote: > > > This seems to fix the problem. > > > > > > I moved the flush so it was after the call to the ppr writer > endDocument > > > method. Everything works beautifully now. > > > > > > Here is the source for the new JspViewHandlerImpl > > > > > > /* > > > * Copyright 2004 The Apache Software Foundation. > > > * > > > * Licensed under the Apache License, Version 2.0 (the "License"); > > > * you may not use this file except in compliance with the License. > > > * You may obtain a copy of the License at > > > * > > > * http://www.apache.org/licenses/LICENSE-2.0 > > > * > > > * Unless required by applicable law or agreed to in writing, > software > > > * distributed under the License is distributed on an "AS IS" BASIS, > > > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or > > > implied. > > > * See the License for the specific language governing permissions > and > > > * limitations under the License. > > > */ > > > package org.apache.myfaces.application.jsp; > > > > > > import org.apache.commons.logging.Log ; > > > import org.apache.commons.logging.LogFactory; > > > import > > org.apache.myfaces.application.DefaultViewHandlerSupport; > > > import > > org.apache.myfaces.application.InvalidViewIdException; > > > import org.apache.myfaces.application.ViewHandlerSupport > > ; > > > > > > import javax.faces.FacesException; > > > import javax.faces.FactoryFinder; > > > import javax.faces.application.Application; > > > import javax.faces.application.StateManager; > > > import javax.faces.application.ViewHandler ; > > > import javax.faces.component.UIViewRoot; > > > import javax.faces.context.ExternalContext; > > > import javax.faces.context.FacesContext; > > > import javax.faces.context.ResponseWriter; > > > import javax.faces.render.RenderKit ; > > > import javax.faces.render.RenderKitFactory; > > > import javax.faces.render.ResponseStateManager; > > > import javax.servlet.ServletRequest; > > > import javax.servlet.ServletResponse; > > > import javax.servlet.http.HttpServletRequest ; > > > import javax.servlet.http.HttpServletResponse; > > > import javax.servlet.http.HttpSession; > > > import javax.servlet.jsp.jstl.core.Config; > > > import java.io.IOException; > > > import java.io.StringWriter; > > > import java.io.Writer ; > > > import java.util.Iterator; > > > import java.util.Locale; > > > > > > /** > > > * @author Thomas Spiegl (latest modification by $Author: baranda $) > > > * @author Bruno Aranda > > > * @version $Revision: 542008 $ $Date: 2007-05-27 19:45:19 +0200 (So, > 27 > > > Mai 2007) $ > > > */ > > > public class JspViewHandlerImpl extends ViewHandler > > > { > > > private static final Log log = > > > LogFactory.getLog(JspViewHandlerImpl.class); > > > public static final String FORM_STATE_MARKER = > > > ""; > > > public static final int FORM_STATE_MARKER_LEN = > > > FORM_STATE_MARKER.length(); > > > > > > private static final String AFTER_VIEW_TAG_CONTENT_PARAM = > > > JspViewHandlerImpl.class + ".AFTER_VIEW_TAG_CONTENT"; > > > > > > private ViewHandlerSupport _viewHandlerSupport; > > > > > > public JspViewHandlerImpl() > > > { > > > if (log.isTraceEnabled()) > > > log.trace("New ViewHandler instance created"); > > > } > > > > > > /** > > > * @param viewHandlerSupport > > > * the viewHandlerSupport to set > > > */ > > > public void setViewHandlerSupport(ViewHandlerSupport > > > viewHandlerSupport) > > > { > > > _viewHandlerSupport = viewHandlerSupport; > > > } > > > > > > /** > > > * @return the viewHandlerSupport > > > */ > > > protected ViewHandlerSupport getViewHandlerSupport() > > > { > > > if (_viewHandlerSupport == null) > > > { > > > _viewHandlerSupport = new DefaultViewHandlerSupport(); > > > } > > > return _viewHandlerSupport; > > > } > > > > > > public Locale calculateLocale(FacesContext facesContext) > > > { > > > Application application = facesContext.getApplication(); > > > for (Iterator requestLocales = > > > facesContext.getExternalContext().getRequestLocales(); > requestLocales > > > .hasNext();) > > > { > > > Locale requestLocale = requestLocales.next(); > > > for (Iterator supportedLocales = > > > application.getSupportedLocales(); supportedLocales.hasNext();) > > > { > > > Locale supportedLocale = supportedLocales.next(); > > > // higher priority to a language match over an exact > > > match > > > // that occures further down (see Jstl Reference 1.0 > > > 8.3.1) > > > if > > > (requestLocale.getLanguage().equals(supportedLocale.getLanguage()) > > > && ( supportedLocale.getCountry() == null || > > > supportedLocale.getCountry().length() == 0)) > > > { > > > return supportedLocale; > > > } > > > else if (supportedLocale.equals (requestLocale)) > > > { > > > return supportedLocale; > > > } > > > } > > > } > > > > > > Locale defaultLocale = application.getDefaultLocale(); > > > return defaultLocale != null ? defaultLocale : > > > Locale.getDefault(); > > > } > > > > > > public String calculateRenderKitId(FacesContext > > facesContext) > > > { > > > Object renderKitId = > > > facesContext.getExternalContext().getRequestMap().get( > > > > > ResponseStateManager.RENDER_KIT_ID_PARAM); > > > if (renderKitId == null) > > > { > > > renderKitId = > > > facesContext.getApplication().getDefaultRenderKitId(); > > > } > > > if (renderKitId == null) > > > { > > > renderKitId = > > RenderKitFactory.HTML_BASIC_RENDER_KIT; > > > } > > > return renderKitId.toString(); > > > } > > > > > > /** > > > */ > > > public UIViewRoot createView(FacesContext facesContext, String > > > viewId) > > > { > > > String calculatedViewId = viewId; > > > try > > > { > > > calculatedViewId = > > > getViewHandlerSupport().calculateViewId(facesContext, > > viewId); > > > } > > > catch (InvalidViewIdException e) > > > { > > > sendSourceNotFound(facesContext, > > e.getMessage()); > > > } > > > > > > Application application = facesContext.getApplication(); > > > ViewHandler applicationViewHandler = > > > application.getViewHandler (); > > > > > > Locale currentLocale = null; > > > String currentRenderKitId = null; > > > UIViewRoot uiViewRoot = facesContext.getViewRoot(); > > > if (uiViewRoot != null) > > > { > > > // Remember current locale and renderKitId > > > currentLocale = uiViewRoot.getLocale(); > > > currentRenderKitId = uiViewRoot.getRenderKitId(); > > > } > > > > > > uiViewRoot = (UIViewRoot) > > > application.createComponent(UIViewRoot.COMPONENT_TYPE ); > > > > > > uiViewRoot.setViewId(calculatedViewId); > > > > > > if (currentLocale != null) > > > { > > > // set old locale > > > uiViewRoot.setLocale(currentLocale); > > > } > > > else > > > { > > > // calculate locale > > > > > > > > > uiViewRoot.setLocale(applicationViewHandler.calculateLocale(facesContext > > > )); > > > } > > > > > > if (currentRenderKitId != null) > > > { > > > // set old renderKit > > > uiViewRoot.setRenderKitId(currentRenderKitId); > > > } > > > else > > > { > > > // calculate renderKit > > > > > > > > > uiViewRoot.setRenderKitId(applicationViewHandler.calculateRenderKitId(fa > > > cesContext)); > > > } > > > > > > if (log.isTraceEnabled()) > > > log.trace("Created view " + viewId); > > > return uiViewRoot; > > > } > > > > > > private void sendSourceNotFound(FacesContext context, String > > > message) > > > { > > > HttpServletResponse response = (HttpServletResponse) > > > context.getExternalContext().getResponse(); > > > try > > > { > > > context.responseComplete(); > > > response.sendError > > (HttpServletResponse.SC_NOT_FOUND, > > > message); > > > } > > > catch (IOException ioe) > > > { > > > throw new FacesException(ioe); > > > } > > > } > > > > > > public String getActionURL(FacesContext facesContext, String > viewId) > > > { > > > return > > getViewHandlerSupport().calculateActionURL(facesContext, > > > viewId); > > > } > > > > > > public String getResourceURL(FacesContext facesContext, String > path) > > > { > > > if (path.length () > 0 && path.charAt(0) == '/') > > > { > > > return > > > facesContext.getExternalContext().getRequestContextPath() + path; > > > } > > > > > > return path; > > > > > > } > > > > > > public void renderView(FacesContext facesContext, UIViewRoot > > > viewToRender) throws IOException, FacesException > > > { > > > if (viewToRender == null) > > > { > > > log.fatal("viewToRender must not be null"); > > > throw new NullPointerException("viewToRender > > must not be > > > null"); > > > } > > > > > > // do not render the view if the rendered attribute for the > view > > > is false > > > if (!viewToRender.isRendered()) > > > { > > > if (log.isTraceEnabled()) > > > log.trace("View is not rendered"); > > > return; > > > } > > > > > > ExternalContext externalContext = > > > facesContext.getExternalContext(); > > > > > > String viewId = facesContext.getViewRoot ().getViewId(); > > > > > > if (log.isTraceEnabled()) > > > log.trace("Rendering JSP view: " + viewId); > > > > > > ServletResponse response = (ServletResponse) > > > externalContext.getResponse(); > > > ServletRequest request = (ServletRequest) > > > externalContext.getRequest(); > > > > > > Locale locale = viewToRender.getLocale(); > > > response.setLocale(locale); > > > Config.set(request, Config.FMT_LOCALE , > > > facesContext.getViewRoot().getLocale()); > > > > > > ViewResponseWrapper wrappedResponse = new > > > ViewResponseWrapper((HttpServletResponse) response); > > > > > > externalContext.setResponse(wrappedResponse); > > > externalContext.dispatch(viewId); > > > externalContext.setResponse(response); > > > > > > boolean errorResponse = wrappedResponse.getStatus() < 200 || > > > wrappedResponse.getStatus() > 299; > > > if (errorResponse) > > > { > > > wrappedResponse.flushToWrappedResponse(); > > > } > > > > > > // store the wrapped response in the request, so it is > > > thread-safe > > > > > > > > externalContext.getRequestMap().put(AFTER_VIEW_TAG_CONTENT_PARAM, > > > wrappedResponse); > > > > > > // handle character encoding as of section 2.5.2.2 of JSF > 1.1 > > > if (externalContext.getRequest() instanceof > HttpServletRequest) > > > { > > > HttpServletRequest httpServletRequest = > (HttpServletRequest) > > > externalContext.getRequest(); > > > HttpSession session = > httpServletRequest.getSession(false); > > > > > > if (session != null) > > > { > > > > > session.setAttribute(ViewHandler.CHARACTER_ENCODING_KEY , > > > response.getCharacterEncoding()); > > > } > > > } > > > > > > // render the view in this method (since JSF 1.2) > > > RenderKitFactory renderFactory = (RenderKitFactory) > > > FactoryFinder.getFactory > > (FactoryFinder.RENDER_KIT_FACTORY); > > > RenderKit renderKit = > renderFactory.getRenderKit(facesContext, > > > viewToRender.getRenderKitId()); > > > > > > ResponseWriter newResponseWriter; > > > StateMarkerAwareWriter stateAwareWriter = new > > > StateMarkerAwareWriter(); > > > > > > // If the FacesContext has a non-null ResponseWriter create > a > > > new writer using its > > > // cloneWithWriter() method, passing the response's Writer > as > > > the argument. > > > // Otherwise, use the current RenderKit to create a new > > > ResponseWriter. > > > ResponseWriter oldResponseWriter = > > > facesContext.getResponseWriter(); > > > if (oldResponseWriter != null) > > > { > > > newResponseWriter = > > > oldResponseWriter.cloneWithWriter(stateAwareWriter); > > > } > > > else > > > { > > > if (log.isTraceEnabled()) > > > log.trace("Creating new ResponseWriter"); > > > newResponseWriter = > > > renderKit.createResponseWriter(stateAwareWriter, null, > > > ((HttpServletRequest) > > > externalContext.getRequest()).getCharacterEncoding()); > > > } > > > > > > // Set the new ResponseWriter into the FacesContext, saving > the > > > old one aside. > > > facesContext.setResponseWriter(newResponseWriter); > > > > > > // Call startDocument() on the ResponseWriter. > > > newResponseWriter.startDocument(); > > > > > > // Call encodeAll() on the UIViewRoot > > > viewToRender.encodeAll(facesContext); > > > > > > ResponseWriter responseWriter; > > > if (oldResponseWriter != null) > > > { > > > responseWriter = > > > oldResponseWriter.cloneWithWriter(response.getWriter ()); > > > } > > > else > > > { > > > responseWriter = > > > newResponseWriter.cloneWithWriter(response.getWriter()); > > > } > > > facesContext.setResponseWriter(responseWriter); > > > > > > // Output any content in the wrappedResponse response from > above > > > to the response, removing the > > > // wrappedResponse response from the thread-safe storage. > > > ViewResponseWrapper afterViewTagResponse = > (ViewResponseWrapper) > > > externalContext.getRequestMap().get( > > > AFTER_VIEW_TAG_CONTENT_PARAM); > > > > > > > > externalContext.getRequestMap().remove(AFTER_VIEW_TAG_CONTENT_PARAM); > > > > > > if (afterViewTagResponse != null) > > > { > > > afterViewTagResponse.flushToWriter > > (response.getWriter()); > > > } > > > > > > // Call endDocument() on the ResponseWriter > > > newResponseWriter.endDocument(); > > > > > > // Timothy M. Braun: Moved to after endDocument call to > ensure > > > // all content is flushed to the real writer > > > // > response.getWriter().write(stateAwareWriter.parseResponse()); > > > stateAwareWriter.flushToWriter(response.getWriter()); > > > > > > // If the old ResponseWriter was not null, place the old > > > ResponseWriter back > > > // into the FacesContext. > > > if (oldResponseWriter != null) > > > { > > > facesContext.setResponseWriter(oldResponseWriter); > > > } > > > > > > response.flushBuffer (); > > > } > > > > > > public UIViewRoot restoreView(FacesContext facesContext, String > > > viewId) > > > { > > > Application application = facesContext.getApplication(); > > > ViewHandler applicationViewHandler = > > > application.getViewHandler(); > > > String renderKitId = > > > > > applicationViewHandler.calculateRenderKitId(facesContext); > > > String calculatedViewId = > > > getViewHandlerSupport().calculateViewId(facesContext, > > viewId); > > > UIViewRoot viewRoot = > > > application.getStateManager().restoreView(facesContext, > > > calculatedViewId, renderKitId); > > > return viewRoot; > > > } > > > > > > /** > > > * Writes a state marker that is replaced later by one or more > > > hidden form inputs. > > > * > > > * @param facesContext > > > * @throws IOException > > > */ > > > public void writeState(FacesContext facesContext) throws > IOException > > > { > > > facesContext.getResponseWriter ().write(FORM_STATE_MARKER); > > > } > > > > > > /** > > > * Writes the response and replaces the state marker tags with > the > > > state information for the current context > > > */ > > > private static class StateMarkerAwareWriter extends StringWriter > > > { > > > public StateMarkerAwareWriter() > > > { > > > } > > > > > > public void flushToWriter(Writer writer) throws IOException > > > { > > > FacesContext facesContext = > > > FacesContext.getCurrentInstance (); > > > StateManager stateManager = > > > facesContext.getApplication().getStateManager(); > > > > > > StringWriter stateWriter = new StringWriter(); > > > ResponseWriter realWriter = > > > facesContext.getResponseWriter (); > > > > > > > facesContext.setResponseWriter(realWriter.cloneWithWriter(stateWriter)); > > > > > > Object serializedView = > stateManager.saveView(facesContext); > > > > > > stateManager.writeState(facesContext, serializedView); > > > facesContext.setResponseWriter(realWriter); > > > > > > StringBuffer contentBuffer = getBuffer(); > > > StringBuffer state = stateWriter.getBuffer(); > > > > > > int form_marker; > > > while ((form_marker = > > > > > contentBuffer.indexOf(JspViewHandlerImpl.FORM_STATE_MARKER)) > > > -1 ) > > > { > > > //FORM_STATE_MARKER found, replace it > > > contentBuffer.replace (form_marker, form_marker + > > > FORM_STATE_MARKER_LEN, state.toString()); > > > } > > > > > > int bufferLength = contentBuffer.length(); > > > int index = 0; > > > int bufferSize = 512; > > > > > > while (index < bufferLength) > > > { > > > int maxSize = Math.min(bufferSize, bufferLength - > > > index); > > > char[] bufToWrite = new char[maxSize]; > > > > > > contentBuffer.getChars(index, index + maxSize, > > > bufToWrite, 0); > > > writer.write(bufToWrite); > > > > > > index += bufferSize; > > > } > > > > > > } > > > } > > > > > > } > > > > > > > > > > > > -----Original Message----- > > > From: Timothy M. Braun [mailto:TBraun@fellowshipvillage.org] > > > Sent: Friday, September 14, 2007 11:01 AM > > > To: MyFaces Discussion > > > Subject: RE: [Trinidad] tr:table PPR failing > > > > > > Ok... please bare with me as this is the first time I have really > dug > > > into the internals of trinidad and myfaces. The problem seems to be > > > coming from the JspViewHandlerImpl class inside the renderView > method. > > > I'm not really sure what is trying to be accomplished, but the > response > > > writer is getting replaced with an instance of > StateAwareResponseWriter > > > which wraps a StringBuffer. The StateAwareResponseWriter is then > > > wrapped by an XhtmlResponseWriter and an instance of > PPRResponseWriter. > > > Once this is done, the partial view is rendered to the writer. The > > > state aware writer then gets flushed to the real response writer and > > > then the ppr writer's endDocument method is called. Inside the > > > endDocument method of the ppr writer, the buffered script tags and > > > element are sent to the ppr's writer. The problem is, > this > > > writer never get's flushed to the real writer. Since the state > aware > > > writer wraps a string buffer, this information get lost forever. > > > > > > The whole thing starts on line 297 of > > > org.apache.myfaces.application.jsp.JspViewHandlerImpl > > > > > > Don't know if this helps... > > > > > > Tim > > > > > > -----Original Message----- > > > From: Timothy M. Braun [mailto:TBraun@fellowshipvillage.org] > > > Sent: Friday, September 14, 2007 9:56 AM > > > To: MyFaces Discussion > > > Subject: RE: [Trinidad] tr:table PPR failing > > > > > > So I did a little more investigating and something really > interesting is > > > going on. I set a breakpoint in PPRResponseWriter.endDocument(). > This > > > is where the element get appended to the response. If I > look > > > at the output buffer at this stage, I can see there is a lot of > > > information with seems to be missing from the response the browser > > > receives. I have included the buffer contents below. As you can > see, > > > the browser doesn't see anything past the last element > so > > > it's not receiving the script elements either. > > > > > > Any Ideas? > > > Tim > > > > > > > > > > > > > > > > > > > action="/vbm/faces/pages/secure/telephony/accountSearch.jspx"> > > > > > id="j_id_jsp_1566647018_3:acctTable"> > cellpadding="0" > > > cellspacing="0" border="0" width="90%" summary="">
> > cellpadding="0" cellspacing="0" border="0" width="100%" summary="" > > > class="x6m">
> > width="100%">
> cellpadding="0" > > > cellspacing="0" border="0" width="100%" summary="" > class="x6q">
> > nowrap="nowrap" valign="middle"> > > id="j_id_jsp_1566647018_3:acctTable__xc_sa" > > class="xi">Show All > > > Details |  > > id="j_id_jsp_1566647018_3:acctTable__xc_ha" > > class="xi">Hide All > > > Details
> class="x6k" > > > cellpadding="1" cellspacing="0" border="0" width="100%">
> > id="j_id0" width="1%" nowrap="nowrap" class="x75">Details > > > > id="j_id_jsp_1566647018_3:acctTable:j_id_jsp_1566647018_16" > > class="x75 > > > xaf">Name > > > > id="j_id_jsp_1566647018_3:acctTable:j_id_jsp_1566647018_18" > > class="x75 > > > xaf">Active > > > > id="j_id_jsp_1566647018_3:acctTable:j_id_jsp_1566647018_20" > > class="x75 > > > xaf">Actions
> > nowrap="nowrap"> > > > > headers="j_id_jsp_1566647018_3:acctTable:j_id_jsp_1566647018_16" > > > class="x6v xat">Name Removed > > > > headers="j_id_jsp_1566647018_3:acctTable:j_id_jsp_1566647018_18" > > > class="x6v xat">true > > > > headers="j_id_jsp_1566647018_3:acctTable:j_id_jsp_1566647018_20" > > > class="x6v xat"> > > > > > onclick="submitForm('acctForm',1,{source:'j_id_jsp_1566647018_3:acctTabl > > > e:0:j_id_jsp_1566647018_21'});return false;" class="xi" > > > href="#">Close
> colspan="4" > > > class="x79 xat">

Account > > > Details

Bill Cycle: Independant
Created: > > > 12/15/2006
Last Modified: 12/15/2006
class="x9m">

> > class="x65">Plans

> > > > id="j_id_jsp_1566647018_3:acctTable:0:j_id_jsp_1566647018_32"> > > cellpadding="0" cellspacing="0" border="0" width="50%" > > > summary="">
cellspacing="0" > > > border="0" width="100%">
Type > > scope="col" class="x75 xaf">ExtensionDID NumberActive > > scope="col" class="x75 xaf">Actions
Basic 2505112(908) 604-0215true > > > > > onclick="submitForm('acctForm',1,{source:'j_id_jsp_1566647018_3:acctTabl > > > > > e:0:j_id_jsp_1566647018_32:0:j_id_jsp_1566647018_43'});return > > false;" > > > class="xi" > > href="#">View
> > type="hidden" > > > > > > name="j_id_jsp_1566647018_3:acctTable:0:j_id_jsp_1566647018_32:rangeStar > > > t" > > > > > > value="0">
> > > > name="j_id_jsp_1566647018_3:acctTable:rangeStart" > > > value="0">]]>
> > > > > id="_acctForm_Postscript"> > > name="javax.faces.ViewState" > > value="!3ca5b351"> > > type="hidden" name="event"> > > name="source"> name="partial"> > > type="hidden" name="value"> > > name="state">]]> > > > > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > -----Original Message----- > > > From: Timothy M. Braun [mailto:TBraun@fellowshipvillage.org ] > > > Sent: Friday, September 14, 2007 12:26 AM > > > To: MyFaces Discussion > > > Subject: RE: [Trinidad] tr:table PPR failing > > > > > > Adam-- > > > I used firebug and the problem arises from a parse error of > the > > > xml response. It seems as though the closing element is > > > missing from the response. I have included the text from the > response > > > below. > > > > > > > > > > action="/vbm/faces/pages/secure/telephony/accountSearch.jspx"> > > > > > id="j_id_jsp_1566647018_3:acctTable"> > cellpadding="0" > > > cellspacing="0" border="0" width="90%" summary="">
> > cellpadding="0" cellspacing="0" border="0" width="100%" summary="" > > > class="x6m">
> > width="100%">
> cellpadding="0" > > > cellspacing="0" border="0" width="100%" summary="" > class="x6q">
> > nowrap="nowrap" valign="middle"> > > id="j_id_jsp_1566647018_3:acctTable__xc_sa" > > class="xi">Show All > > > Details |  > > id="j_id_jsp_1566647018_3:acctTable__xc_ha" > > class="xi">Hide All > > > Details
> class="x6k" > > > cellpadding="1" cellspacing="0" border="0" width="100%">
> > id="j_id0" width="1%" nowrap="nowrap" class="x75">Details > > > > id="j_id_jsp_1566647018_3:acctTable:j_id_jsp_1566647018_16" > > class="x75 > > > xaf">Name > > > > id="j_id_jsp_1566647018_3:acctTable:j_id_jsp_1566647018_18" > > class="x75 > > > xaf">Active > > > > id="j_id_jsp_1566647018_3:acctTable:j_id_jsp_1566647018_20" > > class="x75 > > > xaf">Actions
> > nowrap="nowrap"> > > > > headers="j_id_jsp_1566647018_3:acctTable:j_id_jsp_1566647018_16" > > > class="x6v xat">Name removed for privacy > > > > headers="j_id_jsp_1566647018_3:acctTable:j_id_jsp_1566647018_18" > > > class="x6v xat">true > > > > headers="j_id_jsp_1566647018_3:acctTable:j_id_jsp_1566647018_20" > > > class="x6v xat"> > > > > > onclick="submitForm('acctForm',1,{source:'j_id_jsp_1566647018_3:acctTabl > > > e:0:j_id_jsp_1566647018_21'});return false;" class="xi" > > > href="#">Close
> colspan="4" > > > class="x79 xat">

Account > > > Details

Bill Cycle: Independant
Created: > > > 12/15/2006
Last Modified: 12/15/2006
class="x9m">

> > class="x65">Plans

> > > > id="j_id_jsp_1566647018_3:acctTable:0:j_id_jsp_1566647018_32"> > > cellpadding="0" cellspacing="0" border="0" width="50%" > > > summary="">
cellspacing="0" > > > border="0" width="100%">
Type > > scope="col" class="x75 xaf">ExtensionDID NumberActive > > scope="col" class="x75 xaf">Actions
Basic 2505112(908) 604-0215true > > > > > onclick="submitForm('acctForm',1,{source:'j_id_jsp_1566647018_3:acctTabl > > > > > e:0:j_id_jsp_1566647018_32:0:j_id_jsp_1566647018_43'});return > > false;" > > > class="xi" > > href="#">View
> > type="hidden" > > > > > > name="j_id_jsp_1566647018_3:acctTable:0:j_id_jsp_1566647018_32:rangeStar > > > t" > > > > > > value="0">
> > > > name="j_id_jsp_1566647018_3:acctTable:rangeStart" > > > value="0">]]>
> > > > id="_acctForm_Postscript"> > > type="hidden" name="javax.faces.ViewState" > > > value="!-4bdfb93a"> > > name="event"> name="source"> > > type="hidden" name="partial"> > > name="value"> > > name="state">]]> > > > > > > Thanks, > > > Tim > > > > > > -----Original Message----- > > > From: Adam Winer [mailto:awiner@gmail.com] > > > Sent: Thursday, September 13, 2007 12:46 PM > > > To: MyFaces Discussion > > > Subject: Re: [Trinidad] tr:table PPR failing > > > > > > On 9/13/07, Adam Winer wrote: > > > > On 9/13/07, Andrew Robinson wrote: > > > > > Timothy, > > > > > > > > > > I stripped the page and the AJAX down to the ID attributes only > > > > > (FYI I used this set of commands with VIM to do this: > > > > > %s/>\r sort > > > > > ) > > > > > > > > Can I get you on permanent retainer for VIM-editing? :) > > > > > > > > > Here are the results: > > > > > > > > > > Page: > > > > > id="acctPage:acctTable" > > > > > id="acctPage:acctTable:j_id_jsp_1566647018_17" > > > > > id="acctPage:acctTable:j_id_jsp_1566647018_19" > > > > > id="acctPage:acctTable:j_id_jsp_1566647018_21" > > > > > id="acctPage:acctTable__xc_ha" > > > > > id="acctPage:acctTable__xc_sa" > > > > > id="acctPage:acctTabledd0" > > > > > id="j_id0" > > > > > > > > > > AJAX response: > > > > > id="_acctForm_Postscript" > > > > > id="acctPage:acctTable" > > > > > id="acctPage:acctTable:0:j_id_jsp_1566647018_33" > > > > > id="acctPage:acctTable:j_id_jsp_1566647018_17" > > > > > id="acctPage:acctTable:j_id_jsp_1566647018_19" > > > > > id="acctPage:acctTable:j_id_jsp_1566647018_21" > > > > > id="acctPage:acctTable__xc_ha" > > > > > id="acctPage:acctTabledd0" > > > > > id="j_id0" > > > > > > > > > > As you can see, the following items in the AJAX were not in the > > > page: > > > > > id="_acctForm_Postscript" > > > > > id="acctPage:acctTable:0:j_id_jsp_1566647018_33" > > > > > > > > > > Looking at your page source, there is no form element. The form > is > > > > > required AFAIK. This may be just because you didn't provide the > full > > > > > source though. > > > > > > > > I suspect so... the submission wouldn't have gotten far at all > > > > without a form element. The "postscript" in the PPR reply > > > > is in fact part of the form. > > > > > > > > It looks as though the issue is exactly related to trying to get > that > > > > expanded row to show up, since the one missing ID is ":0:" > > > > (that is, the first row of the table). Lemme try this locally. > > > > > > Ech, ignore that commentary. Diffing the full set of IDs isn't > > > really relevant here: PPR can, of course, introduce new IDs. > > > It just can't introduce new *top* IDs - each fragment has to > > > point to an existing ID. We've got two fragments in here: > > > > > >
> > > > > > > > > And these do seem to be in the page already. But even > > > if they weren't, it seems that the current JS code would simply > > > drop them and move on. > > > > > > Tim, could you by any chance use FireBug's JS debugger to > > > step through TrPage.prototype._handlePprResponse()? It's > > > not clear where this JS error is coming from. > > > > > > (FWIW, the basic table row-disclosure demo seems to be working > > > fine for me, at least on FF (haven't tested IE)). > > > > > > -- Adam > > > > > > > > > > > > > > > > > > > > > > -- > > http://www.irian.at > > Your JSF powerhouse - > JSF Consulting, Development and > Courses in English and German > > Professional Support for Apache MyFaces > > -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces