Hello everyone, I ran into an issue regarding the update, which is closely related to a behavior jsf2 exposes regarding component rendering
in the update cycle.
The main issue is following: If we have a component which we trigger with following code:
<myComp:javascriptTestComponent id="myTestComponent"></grv:javascriptTestComponent>
<a href="#" name="mego3"
onclick="jsf.ajax.request(this,event,{execute:'myTestComponent', render:'myTestComponent'}); return false;">submit
me</a>
and the component itself renders following in its renderer:
ResponseWriter writer = context.getResponseWriter();
writer.startElement(DIV, component);
writer.writeAttribute(ID,component.getClientId(context), null );
writer.write("hello world"+Math.random());
writer.endElement(DIV);
writer = context.getResponseWriter();
writer.startElement(DIV, component);
writer.writeAttribute(ID,component.getClientId(context)+":_second", null );
writer.write("hello world"+Math.random());
writer.endElement(DIV);
the resulting ppr response now looks like following:
Now the problem is, since the update part of the response is already opened the component author cannot really influence the response rendering in any meaningful way (the correct solution would be to issue two update commands here)<update id="myTestComponent">
<![CDATA[<div id="myTestComponent">hello world0.8619488403376933</div>
<div id="myTestComponent:_second">helloworld0.25176272071402683</div>]]>
</update>...
myTestComponent
with the update code and hence the result was a div wandering down (aka wrong update)