voyent
component not updating/rendering right away!  XML
Forum Index -> General Help
Author Message
stockb

Joined: 01/May/2012 10:39:41
Messages: 26
Offline


I have twopanelPopup componenets:
Code:
      <ice:panelPopup draggable="true"
                visible="#{popup.readMediaPopUpRendered}" modal="true" resizable="true" style="width: px; ">
           ...
      </ice:panelPopup>
      <ice:panelPopup draggable="true"
                visible="#{popup.consoleOutputPopUpRendered}" modal="true" resizable="true" style="width: px; ">
           ...
      </ice:panelPopup>
 


and some Java code:
Code:
      readMediaPopUpRendered = false;
      consoleOutputPopUpRendered = true;
      doSomeMethod();
 


What is expected:
- Read Media popup disappears
- Console Output popup appears
- doSomeMethod() is executed

What happens:
- doSomeMethod() is executed
- Read Media popup disappears
- Console Output popup appears

Why is there delay between the value changing, and the visibility changing?
stockb

Joined: 01/May/2012 10:39:41
Messages: 26
Offline


After stepping through my program, I've determined that the components do not update until after my Java code is idle and

Code:
 CoyoteAdapter.service(Request, Response) line: 409	
 


is executed in the debug stack.

I think it has something to do with how render cycles work with ICEfaces, but I've never experienced anything like this before. I'm currently looking at RenderManager to see if I can force it to render at a certain point.

Am I at least on the right track?

EDIT: I'm currently looking into Ajax Push, which seems to be what I want, althought I can't find it explicitly stated anywhere that it will suit my need. http://wiki.icesoft.org/display/ICE/Ajax+Push+-+Overview

EDIT 2: I tried to implement Ajax Push PushRenderer but it didn't seem to do anything. I have:

Code:
 		PushRenderer.addCurrentSession("fullForm");
 
 		readMediaPopup = false;
 		consoleOutputPopup = true;
 		
 		PushRenderer.render("fullForm");
 


yet, the panelPopup components to not adjust their visibility until the Java thread completes. Why is the Java thread blocking the ICEfaces component updates?

EDIT 3:
On using PushRenderer, I get the following JVM console output:
Code:
 Jun 1, 2012 4:15:47 PM org.icepush.servlet.EnvironmentAdaptingServlet <init>
 INFO: Adapting to Servlet 3.0 AsyncContext environment
 Jun 1, 2012 4:15:47 PM org.icepush.servlet.AsyncAdaptingServlet <init>
 INFO: Using Servlet 3.0 AsyncContext
 Jun 1, 2012 4:15:47 PM org.icepush.servlet.EnvironmentAdaptingServlet service
 INFO: Falling back to Thread Blocking environment
 


From the Ajax Push overview (http://wiki.icesoft.org/display/ICE/Ajax+Push+-+Overview):
Asynchronous Request Processing (ARP)

ICEpush relies on Servlet 3.0 standard ARP APIs. If they are not present in the deployment environment, normal thread blocking connections are used. 


What exactly is "Servlet 3.0 standarnd ARP API" and how do I make it present in my deployment environment?

EDIT 4: I found a Servlet 3.0 jar here (http://snapshots.repository.codehaus.org/org/mortbay/jetty/servlet-api/3.0-SNAPSHOT/) but I was surprised at how difficult it was to track down.

EDIT 5: Turns out adding that jar does nothing, and it must be already included in my projecte somewhere as I get the debug messages about "thread blocking connections" either way. Some observing in Firebug resulted in the conclusion that ICEfaces Direct-2-DOM does not execute until after the POST returns, but that seems like an opbscene limitation to AJAX programming practices. I have crossposted this topic in the Components forum: http://jforum.icesoft.org/JForum/posts/list/20923.page
 
Forum Index -> General Help
Go to:   
Powered by JForum 2.1.7ice © JForum Team