This content has been marked as final.
Show 4 replies
-
1. Re: ajax4jsf FastFilter issue
sergeysmirnov Mar 29, 2007 12:42 PM (in response to lle)Are you speaking about Ajax response or pre-ajax behavior ?
Why do you decide this is a parser convert<div></div>
into<div/>
-
2. Re: ajax4jsf FastFilter issue
lle Mar 29, 2007 12:55 PM (in response to lle)Hi,
It is the Ajax response. I didn't say it's a parser convert. It might be an issue with FacesServlet. However, in my facelets xhtml document, i did explicitly put<div></div>
But, after the ajax call, the ajax response contains<div/>
I am still debugging to see where the conversion happens. However, if I used Filter instead of FastFilter, the TidyParser gave me the output<div></div>
So I was wondering if there's somehow for me to set the NekoParser to expand empty elements.
Thanks. -
3. Re: ajax4jsf FastFilter issue
lle Mar 29, 2007 8:54 PM (in response to lle)Hi there,
I debugged and it is the NekkoParser that changed<div></div>
to<div/>
Can I somehow change this behavior?
Thanks. -
4. Re: ajax4jsf FastFilter issue
lle Mar 30, 2007 9:33 PM (in response to lle)Deeper debugging into ajax4jsf code and I found the code where the short div was generated.
It is the method endElement() of class org.ajax4jsf.xml.serializer.ToStream. Here is a code snippet of the method:public void endElement(String namespaceURI, String localName, String name) throws org.xml.sax.SAXException { ... if (m_elemContext.m_startTagOpen) { if (m_tracer != null) super.fireStartElem(m_elemContext.m_elementName); int nAttrs = m_attributes.getLength(); if (nAttrs > 0) { processAttributes(m_writer, nAttrs); // clear attributes object for re-use with next element m_attributes.clear(); } if (m_spaceBeforeClose) writer.write(" />"); else writer.write("/>"); /* don't need to pop cdataSectionState because * this element ended so quickly that we didn't get * to push the state. */ } else { if (m_cdataTagOpen) closeCDATA(); if (shouldIndent()) indent(m_elemContext.m_currentElemDepth - 1); writer.write('<'); writer.write('/'); writer.write(name); writer.write('>'); } ... }
As you see, when the element is empty, the element is written in the short form (e.g. ).
Can ajax4jsf be enhanced to take in a property to tell the serializer to expand empty elements?
This has caused serious layout issues with IE. Without a fix, I am forced to rerender the entire page instead of ajax when it comes to big response. It's a trade-off for using TidyParser instead of NekkoParser.
Thank you very much.