myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Werner Punz <>
Subject MyFaces 2.0 partial response writer again
Date Fri, 03 Jul 2009 12:31:13 GMT
Hello everyone, again another topic regarding the partial response writer.
The way I see it the spec is clearly here underspecified.
For now the behavior is like following:

The partial response writer must return a valid xml which is structured 
as such

... xml header ...
<update id="componentId"><![CDATA[ html code for the component ]]><update>
<eval id="componentId"><![CDATA[ javascript code block etc... ]]><eval>

All this is triggered by the PartialResponseWriter which has methods for 
startUpdate, insert etc....
and also end methods according to the xml parts!

Now however there are use cases which are not that easy and are not 
really resolvable in a proper jsf2 ppr manner.

Following usecase, a component author clearly tries to split his code
into html and eval sections. As for now the component itself already is 
in update mode when encoded hence start and endElement are written as is!

However it is better to shift the javascript code into the eval phase 
for ppr cases if you want to make sure if everything performs cross 
platform implementation wise.

The way I see it at the current state of the codebase this is not possible!
Update mode means that if you issue an eval it is rendered within the 
CDATA block!

This is btw. the same behavior in myfaces and the RI.
I would propose a deferring in our ResponseWriter so that subcommands
issued from component level are placed at their correct positions which 

If a component is in <update> mode and has code which checks for a ppr 
case and tries to issue an <eval> or attributes change, this code is 
until the update tag is closed and then appended automatically!

I assume we also have to bring this to the expert group, because from 
what I could gather in the spec there is nothing really there which 
exactly describes the behavior and how to apply the partial response 
writer correctly in such cases!

For now this is not a showstopper because we have client side javascript 
eval but my personal guess is we really have to cover that!

On the other hand shiftig everything down (opening the update tag 
etc...) would break the ppr for existing components, so this is not an 


View raw message