Thanks Matthias.
To clarify further - from the perspective of some js inserted into some xhtml code - is that busy state meaning that we are in a PPR context ?
I ask since from the dev-guide it seems that busy/free refers to the status of getting the response from the server and js executes while modifying the DOM, e.g. when the response is achieved.
Which are the exact triggering events to define a state change - or in other words - is the busy time including DOM updating ?

-- Renzo

Matthias Wessendorf wrote:
ok,
there is a statusIndicator comp., but that is not JS.

so here is a "monitoring ppr" JS:


     var requestQueue = TrPage.getInstance().getRequestQueue();
     requestQueue.addStateChangeListener(myCallback);


function myCallback(state)
{
  var busy = state == TrRequestQueue.STATE_BUSY;
  var div = document.getElementById("load");
  div.style.display = busy ? "inline" : "none";
}


a div like this could be in the page:
<div id="load" style="display: none; background-color: red;..."> LOADING...
</div>


we also have a DOM replace notification, after PPR

TrPage.getInstance().addDomReplaceListener(myCallback);

function myCallback(oldDom, newDom)
{ ...}

I think more on that is in the dev-guide.

-Matthias
On Jan 22, 2008 11:56 PM, Renzo Tomaselli <[EMAIL PROTECTED]> wrote:
  
Hi, assume to have a component which might be rendered either in a full
page or in a PPR context.
It needs to distinguish these alternatives since it might run some js
chunck requiring full DOM completion.
For example, on IE we are not allowed to modify the DOM before page
completion, thus we must delay by means of onLoad handling.
How do we know "officially" from js that we are in a PPR ?
Suggestions are welcome.



    



  

Reply via email to