voyent
Form resets when push notification recieved by client  XML
Forum Index -> ICEpush General
Author Message
bfuller18

Joined: 06/May/2014 11:50:53
Messages: 47
Offline


I am using IE9 for a client and portable rendered scoped to the session id on the server:
Code:
PushRenderer.addCurrentSession(session.getId());


Everything appears to work when I send a push notice:
Code:
renderer.render(session.getId());


The problem I am having is that when the client receives the notice, the entire page is re-rendered. This causes a problem when I have form data that has been input by the user, but yet to be submitted. The submitted values are reset. (Partial submit for all of the form entries is tedious and overly expensive)

Is there a way to avoid this and only render a specific component?

Configuration details:
Code:
May 28, 2014 11:40:47 AM com.sun.faces.config.ConfigureListener contextInitialized
 INFO: Initializing Mojarra 2.1.21 ( 20130409-1421 https://svn.java.net/svn/mojarra~svn/tags/2.1.21@11854) for context '/xxxxx'
 May 28, 2014 11:40:50 AM org.icefaces.util.EnvConfig init
 INFO: ICEfaces Configuration: 
 org.icefaces.render.auto: true [default]
 org.icefaces.autoid: true [default]
 org.icefaces.aria.enabled: true [default]
 org.icefaces.blockUIOnSubmit: false
 org.icefaces.compressDOM: false [default]
 org.icefaces.compressResources: true
 org.icefaces.compressIDs: false [default]
 org.icefaces.connectionLostRedirectURI: null [default]
 org.icefaces.diffConfig: null [default]
 org.icefaces.deltaSubmit: false
 org.icefaces.focusManaged: true [default]
 org.icefaces.lazyPush: true [default]
 org.icefaces.generateHeadUpdate: false [default]
 org.icefaces.includeScrollOffsets: true [default]
 org.icefaces.reloadOnUpdateFailure: false [default]
 org.icefaces.sessionExpiredRedirectURI: null [default]
 org.icefaces.standardFormSerialization: false
 org.icefaces.strictSessionTimeout: false [default]
 org.icefaces.subtreeDiff: true [default]
 org.icefaces.windowScopeExpiration = 1000 [default]
 org.icefaces.mandatoryResourceConfiguration: none [default]
 org.icefaces.uniqueResourceURLs: true [default]
 org.icefaces.lazyWindowScope: true [default]
 org.icefaces.messagePersistence: true [default]
 org.icefaces.disableDefaultErrorPopups: false [default]
 org.icefaces.fastBusyIndicator: false [default]
 org.icefaces.replayNavigationOnReload: false [default]
 org.icefaces.resourceVersion: 3_3_0_130829 [default]
 org.icefaces.versionableTypes: */javascript */css image/* [default]
 org.icefaces.coalesceResources: true
 org.icefaces.clientSideElementUpdateDetermination: false [default]
 org.icefaces.ace.fileEntry.requireJavascript: true [default]
 org.icefaces.publicContextPath: null [default]
 
 May 28, 2014 11:40:50 AM org.icefaces.impl.renderkit.DOMRenderKit <clinit>
 INFO: 
 ICEsoft Technologies Inc.
 ICEfaces-EE 3.3.0.GA_P01
 Build number: 13
 Build date: 130829
 Revision: 35307
 
 May 28, 2014 11:40:51 AM com.sun.faces.lifecycle.ELResolverInitPhaseListener populateFacesELResolverForJsp
 INFO: JSF1027: [null] The ELResolvers for JSF were not registered with the JSP container.
 May 28, 2014 11:40:51 AM org.icepush.EmailNotificationProvider <init>
 INFO: ICEpush Email Notification Provider Properties {mail.smtps.socketFactory.class=org.icepush.DummySSLSocketFactory, mail.smtp.auth=true, mail.smtps.socketFactory.fallback=false} nobody@localhost.com :0(hash)@localhost:25
 May 28, 2014 11:40:51 AM org.icepush.EmailNotificationProvider$AutoRegister contextInitialized
 INFO: ICEpush Email Notification Provider Registered.
 May 28, 2014 11:40:51 AM com.icesoft.icepush.GcmNotificationProvider$AutoRegister contextInitialized
 INFO: GCM Notification Provider is off
 May 28, 2014 11:40:51 AM com.icesoft.icepush.APNSNotificationProvider <init>
 INFO: APNS Notification Provider is on
 May 28, 2014 11:40:51 AM com.icesoft.icepush.BPNSNotificationProvider$AutoRegister contextInitialized
 INFO: BPNS Notification Provider is off
 May 28, 2014 11:40:51 AM com.icesoft.icepush.AmazonSNSNotificationProvider$AutoRegister contextInitialized
 INFO: Amazon SMS Notification Provider is off
 May 28, 2014 11:40:51 AM com.icesoft.icepush.TwilioSMSNotificationProvider$AutoRegister contextInitialized
 INFO: Twilio SMS Notification Provider is off
 
 May 28, 2014 11:44:04 AM org.icepush.servlet.MainServlet <init>
 INFO: 
 ICEsoft Technologies Inc.
 ICEpush-EE 3.3.0.GA_P01
 Build number: 13
 Revision: 35307

ted.goddard

Joined: 26/Oct/2004 00:00:00
Messages: 874
Offline


Look carefully at the page update from the push: the ICEfaces strategy is to always render the entire page, but only the parts of the page that have changed are sent to the browser. If the page update is larger than expected, this means that something in the page is changing each time, requiring a larger update to be sent.

One approach is to enable org.icefaces.diffConfig to debugAB to dump the two versions of the page to the server log and compare them with a diff command.
[Email]
bfuller18

Joined: 06/May/2014 11:50:53
Messages: 47
Offline


Thanks Ted,

I enabled the debug option and and the only part that is different in the diff is the component that I want updated on the push notice. I should add that the form reset issue doesn't occur 100% of the time, but it is reproducible.

High Level it works like:
- Background thread runs and generates data.
- Background thread stores the data in the user session.
- Background thread then sends push client

- Client has xhtml that has a rendered attribute set to only render when the data is present in the session
- Client receives push notice and now renders the xhtml because data is int the backing bean

Diff update:
Code:
       element[tag: form; attributes: action=/xxxxx/yyyyy.jsf enctype=application/x-www-form-urlencoded id=noticesForm method=post name=noticesForm ]
           text[
 ]
           element[tag: input; attributes: name=noticesForm type=hidden value=noticesForm ]
           text[
 ]
           element[tag: input; attributes: autocomplete=off name=ice.window type=hidden value=evhvquvsec ]
           element[tag: input; attributes: autocomplete=off name=ice.view type=hidden value=v3dcmdnj ]
           element[tag: script; attributes: id=noticesForm:noticesForm_captureSubmit type=text/javascript ]
             text[ice.captureSubmit('noticesForm',false);ice.captureKeypress('noticesForm',null);]
           element[tag: div; attributes: class=ui-notificationbar ui-widget ui-widget-content ui-corner-all id=noticesForm:j_idt113 role=alert style=background: none; background-image: url('../resources/images/semi.transbg.png');    background-repeat: repeat;    width: 75%; margin: 0 0 0 12.5%;     height:auto; ]
             text[
 
 		]
             element[tag: table; attributes: style=width: 100%; text-align:center; color: white; ]
               text[
 		]
               element[tag: tr; attributes: ]
                 text[
 		]
                 element[tag: td; attributes: style=width: 33% ]
                   element[tag: span; attributes: id=noticesForm:_t115 ]
                     text[ ]
                   text[
 		]
                 text[
 		]
                 element[tag: td; attributes: ]
                   text[
 			Messages
 		]
                 text[	
 		]
                 element[tag: td; attributes: style=width: 33% ]
                   element[tag: img; attributes: alt=Close New id=noticesForm:j_idt117 onclick=jsf.util.chain(this,event,'noticesPanelOpen.hide();','mojarra.ab(this,event,\'click\',0,0)');return false src=/xxxxx/javax.faces.resource/cal_off.gif.jsf?ln=css/css-images&v=3_3_0_130829 style=float:right; cursor: pointer; ]
                   text[
 		]
                 text[
 		]
               text[
 		]
             text[
 		
 		]
             element[tag: div; attributes: style=width: 100%; padding-top: 2px; ]
               text[
 			]
               element[tag: ul; attributes: style=color: white ]
                 text[
 				]
                 element[tag: li; attributes: ]
                   element[tag: span; attributes: class=iceOutTxt id=noticesForm:j_idt119:0:j_idt121 style=color:white ]
                     text[<u>Inbox Updated</u> - <b>Type</b>: New Assignment <b>Title</b>: TEST REMDINGER 45 - TEST REMDINGER 45 <b>Status</b>: Pending]
                 text[
    			]
               text[
     	]
             element[tag: script; attributes: type=text/javascript ]
               text[ice.ace.jq(document).ready(function(){]
               text[noticesPanelOpen = ice.ace.create("NotificationBar",["noticesForm:j_idt113",{"position":"top","effect":"fade","effectSpeed":"slow","visible":true,"ariaEnabled":true}]);]
               text[});]
           element[tag: span; attributes: id=noticesFormhdnFldsDiv ]
             element[tag: input; attributes: name=icefacesCssUpdates type=hidden value= ]
           text[
 ]
         text[
 ]



XHTML:
Code:
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                 xmlns:ui="http://java.sun.com/jsf/facelets"
                 xmlns:h="http://java.sun.com/jsf/html"
                 xmlns:f="http://java.sun.com/jsf/core"
                 xmlns:ace="http://www.icefaces.org/icefaces/components"
                 xmlns:ice="http://www.icesoft.com/icefaces/component"
                 xmlns:fn="http://java.sun.com/jsp/jstl/functions">
     <h:form id="noticesForm" rendered="#{managerBean.hasNotificationMessages()}">
 	<ace:notificationPanel visible="true"
 			widgetVar="noticesPanelOpen" position="top" 
 			style="background: none; background-image: url('../resources/images/semi.transbg.png');
 			background-repeat: repeat;
 			width: 75%; margin: 0 0 0 12.5%; 
 			height:auto;"
 			effect="fade"
 			effectSpeed="slow">
 
 		<table style="width: 100%; text-align:center; color: white;">
 		<tr>
 		<td style="width: 33%">
 			<h:outputText value=" " />
 		</td>
 		<td>
 			Messages
 		</td>	
 		<td style="width: 33%">
 			<h:graphicImage alt="Close New" library="css/css-images" name="cal_off.gif" style="float:right; cursor: pointer;" onclick="noticesPanelOpen.hide();">
 			    <f:ajax event="click" listener="#{managerBean.removeNotificationMessages}" />
 			</h:graphicImage>
 		</td>
 		</tr>
 		</table>
 		
 		<div style="width: 100%; padding-top: 2px;">
 			<ul style="color: white">
 				<ui:repeat var="o" value="#{managerBean.notificationMessages}" varStatus="status">
 				<li><ice:outputText escape="false" value="#{o}" style="color:white"/></li>	 
 	   			</ui:repeat>
    			</ul>
     	</div>
 
 	</ace:notificationPanel>
 	</h:form>
 </ui:composition>

ted.goddard

Joined: 26/Oct/2004 00:00:00
Messages: 874
Offline


Which element is intended to be updated? The escape="false" might be causing a problem if there is any complication with the embedded HTML being well-formed. It might help to wrap an h:panelGroup with an ID around the changing element. Otherwise, we would likely need to look at some specific output from debugAB which you could send to product.support@icesoft.com.
[Email]
bfuller18

Joined: 06/May/2014 11:50:53
Messages: 47
Offline


The entire xhtml is to be rendered (see near the top): Code:
<h:form id="noticesForm" rendered="#{managerBean.hasNotificationMessages()}">


Sorry I should have been a bit more specific. The above XHTML is ui:included into a larger page. The form in the xhtml above is not the form who has input elements being reset. It's another form on the same page.

I did take your advice and wrapped the form in an always visible and id'ed panel. So far I think it's working, many thanks!
 
Forum Index -> ICEpush General
Go to:   
Powered by JForum 2.1.7ice © JForum Team