voyent
Strange rowSelector behavior after a validation error  XML
Forum Index -> Components
Author Message
edykory


Joined: 27/Nov/2006 00:00:00
Messages: 332
Offline


Hello there!
Long time no see, sorry for that.
I have a little annoying issue on my head.
I'm using two dataTables, each with a rowSelector:
A category dataTable (master one) and a parameters dataTable (sort of cascading one). When I select a category in the first dataTable, I display a list of parameters in that category in the second dataTable. Then I can select a parameter and delete it, or add a new parameter (so no editing of existing parameters).
Everything is working as expected, with one exception:
A parameter has two fields: label (required) and code (optional). So, if I just navigate in the two tables and add/remove parameters without causing validation problems, everything works smoothly, but if I try to press on the Add button, the "required" validation kicks in (as expected), after which the dataTables' selectors start acting strange: The mouse pointer turns on selection into a "busy" one (for something between a few seconds and forever), sometimes the row previously selected doesn't get unselected on selecting a different row ... the "required" error messages appear only sometimes, although in the logs they appear always ... the application hangs on the client side, the connection gets lost, etc, etc.
I repeat, as long as no "required" errors occurs, everything works alright, it's just the errors that trigger all this strange behavior. I don't use any exotic things ... I'll just post the code below.
I'm using IceFaces 1.7Beta1 (same behavior was on DR#3) on JBoss 4.2.2 with JSF 1.2.
For client I'm using Firefox 2 (with Firebug disabled).

Code:
 <html xmlns="http://www.w3.org/1999/xhtml"
 	xmlns:ui="http://java.sun.com/jsf/facelets"
 	xmlns:f="http://java.sun.com/jsf/core"
 	xmlns:h="http://java.sun.com/jsf/html"
 	xmlns:ice="http://www.icesoft.com/icefaces/component">
 
 <ui:composition template="/WEB-INF/templates/administrare.xhtml">
 	<ui:define name="pageTitle">Parametri documente</ui:define>
 	<ui:define name="bodyContent">
 		<ice:form id="mainFrm">
 			<table>
 				<tr>
 					<td valign="top" rowspan="2"><ice:dataTable
 						value="#{parametersController.categoryList}" var="row"
 						width="200px">
 						<ice:column>
 							<f:facet name="header">Category</f:facet>
 							<ice:outputText value="#{row.label}" />
 							<ice:rowSelector multiple="false"
 								selectionListener="#{parametersController.changeSelectedCategory}"
 								value="#{row.selected}" />
 						</ice:column>
 					</ice:dataTable></td>
 					<td valign="top"><ice:dataTable
 						value="#{parametersController.parameterList}" var="row"
 						width="400px" columnWidths="240px,160px"
 						rendered="#{not empty parametersController.selectedCategory}">
 						<ice:column>
 							<f:facet name="header">Label</f:facet>
 							<ice:outputText value="#{row.label}" />
 							<ice:rowSelector multiple="false"
 								selectionListener="#{parametersController.changeSelectedParameter}"
 								value="#{row.selected}" />
 						</ice:column>
 						<ice:column>
 							<f:facet name="header">Code</f:facet>
 							<ice:outputText value="#{row.code}" />
 						</ice:column>
 					</ice:dataTable></td>
 					<td valign="top"><ice:commandButton value="Delete"
 						action="#{parametersController.deleteParameter}"
 						immediate="true" rendered="#{not empty parametersController.selectedParameter}" /></td>
 				</tr>
 				<tr>
 					<td valign="bottom"><ice:panelGrid columns="2"
 						rendered="#{not empty parametersController.selectedCategory}">
 						<ice:outputText value="Label *" />
 						<ice:outputText value="Code *" />
 						<ice:inputText required="true" label="label"
 							value="#{parametersController.newLabel}"
 							binding="#{parametersController.txtNewLabel}"
 							maxlength="32" size="32">
 							<f:validateLength maximum="32"/>
 						</ice:inputText>
 						<ice:inputText label="Code"
 							value="#{parametersController.newCode}"
 							binding="#{parametersController.txtNewCode}"
 							maxLenght="16" size="8">
 							<f:validateLength maximum="16"/>
 						</ice:inputText>
 					</ice:panelGrid></td>
 					<td valign="bottom"><ice:commandButton value="Add"
 						action="#{parametersController.addParameter}"
 						rendered="#{not empty parametersController.selectedCategory}" /></td>
 				</tr>
 			</table>
 		</ice:form>
 		<ice:messages showSummary="false" showDetail="true" />
 	</ui:define>
 </ui:composition>
 
 </html>
 

On the controller I'm keeping everything as simple as possible: on changing the selected category I load a list of parameters from the database, and on that list I add/remove new parameters (also saving changes in the database).

Thanx,
Eduard
edykory


Joined: 27/Nov/2006 00:00:00
Messages: 332
Offline


I can reproduce this behavior consistently even with just one rowSelector, but this happens only on the 1.7Beta1. I checked with 1.6.2 and it doesn't reproduce at all.

After the "required" validation fails (actually even if I remove it and I replace it with adding by hand an error message, the behavior is the same), I get the following log in DOM update log:

Close on exit Lines 2550100200400 Category Level DebugInfoWarnError[window.tAph#1.async-connection.heartbeat] : ping[window.tAph#1.async-connection.ui] : [4813793] : send asynchronous POST[window.tAph#1.async-connection.ui] : [4813793] : receive [200] OK[window.tAph#1.async-connection.blocking] : [1712526] : receive [200] OK[window.tAph#1.async-connection.ui] : [7071627] : send asynchronous POST[window.tAph#1.async-connection.ui] : [7071627] : receive [200] OK[window.tAph#1.async-connection] : receive broadcast failedUnknown message received: pong[window.tAph#1.async-connection.ui] : [7071627] : connection closed[window.tAph#1.async-connection] : closing previous connection...[window.tAph#1.async-connection.blocking] : [1712526] : connection closed[window.tAph#1.async-connection] : connect...[window.tAph#1.async-connection.blocking] : [5322324] : send asynchronous POST[window] : Interup pressed[window.tAph#1.async-connection] : send > | ice.submit.partial=false || ice.event.target=mainFrm:j_id14:10:j_id17 || ice.event.captured=mainFrm:j_id14sel_rows || ice.event.type=onclick || ice.event.alt=false || ice.event.ctrl=false || ice.event.shift=false || ice.event.meta=undefined || ice.event.x=63 || ice.event.y=338 || ice.event.left=false || ice.event.right=false || mainFrm= || icefacesCssUpdates= || mainFrm:j_id14sel_rows=10 || mainFrm:j_id34= || mainFrm:j_id35= || focus_hidden_field= || ice.session=tAphFMlXkdERmHR3aiPNKg || ice.view=1 || ice.focus= |[window.tAph#1.async-connection.ui] : [3769259] : send asynchronous POST[window.tAph#1.async-connection.ui] : [3769259] : receive [200] OK[window.tAph#1] : applied update : <tr class="iceDatTblRow2 iceRowSel" id="mainFrm:j_id14:7" onclick="ice_tableRowClicked('7', 'mainFrm:j_id14sel_rows');" onmouseout="this.className='iceDatTblRow2 iceRowSel'" onmouseover="this.className='iceRowSelMouseOver'">...</tr>[window.stateMon] : Checking [0] monitors[window.stateMon] : Rebuilding Monitors [0][window.stateMon] : Rebuilding Monitors [0][window.tAph#1] : applied update : <tr class="iceDatTblRow1 iceRowSelSelected" id="mainFrm:j_id14:10" onclick="ice_tableRowClicked('10', 'mainFrm:j_id14sel_rows');" onmouseout="this.className='iceDatTblRow1 iceRowSelSelected'" onmouseover="this.className='iceRowSelSelectedMouseOver'">...</tr>[window.stateMon] : Checking [0] monitors[window.stateMon] : Rebuilding Monitors [0][window.stateMon] : Rebuilding Monitors [0][window.tAph#1] : applied update : <input id="mainFrm:j_id14sel_rows" name="mainFrm:j_id14sel_rows" type="hidden">...</input>[window.stateMon] : Checking [0] monitors[window.stateMon] : Rebuilding Monitors [0][window.stateMon] : Rebuilding Monitors [0][window.tAph#1] : applied update : <table cellspacing="0" class="iceDatTbl" id="mainFrm:j_id20" width="400px">...</table>[window.stateMon] : Checking [0] monitors[window.stateMon] : Rebuilding Monitors [0][window.stateMon] : Rebuilding Monitors [0][window.tAph#1.async-connection.ui] : [3769259] : connection closed[window] : Interup pressed[window] : User action. Set focus will be ignored.[window.tAph#1.async-connection.heartbeat] : ping[window.tAph#1.async-connection.ui] : [4869115] : send asynchronous POST[window.tAph#1.async-connection.blocking] : [5322324] : receive [200] OK[window.tAph#1.async-connection.ui] : [4869115] : receive [200] OK[window.tAph#1.async-connection.ui] : [1985670] : send asynchronous POST[window.tAph#1.async-connection.ui] : [1985670] : receive [200] OK[window.tAph#1.async-connection] : receive broadcast failedUnknown message received: pong[window.tAph#1.async-connection.ui] : [1985670] : connection closed[window.tAph#1.async-connection] : closing previous connection...[window.tAph#1.async-connection.blocking] : [5322324] : connection closed[window.tAph#1.async-connection] : connect...[window.tAph#1.async-connection.blocking] : [7318951] : send asynchronous POST[window.tAph#1.async-connection.heartbeat] : pong lost[window.tAph#1] : connection in trouble[window.tAph#1.async-connection] : retry to connect...[window.tAph#1.async-connection] : closing previous connection...[window.tAph#1.async-connection.blocking] : [7318951] : connection closed[window.tAph#1.async-connection] : connect...[window.tAph#1.async-connection.blocking] : [5033885] : send asynchronous POST[window.tAph#1.async-connection.heartbeat] : pong lost[window.tAph#1] : connection in trouble[window.tAph#1.async-connection] : retry to connect...[window.tAph#1.async-connection] : closing previous connection...[window.tAph#1.async-connection.blocking] : [6694140] : connection closed[window.tAph#1.async-connection] : connect...[window.tAph#1.async-connection.blocking] : [5432135] : send asynchronous POST[window.tAph#1.async-connection.blocking] : [5033885] : receive [200] OK[window.tAph#1.async-connection.heartbeat] : ping[window.tAph#1.async-connection.ui] : [9679963] : send asynchronous POST[window.tAph#1.async-connection.ui] : [9679963] : receive [200] OK[window.tAph#1.async-connection.blocking] : [5432135] : receive [200] OK[window.tAph#1.async-connection.ui] : [1111662] : send asynchronous POST[window.tAph#1.async-connection.ui] : [1111662] : receive [200] OK[window.tAph#1.async-connection] : receive broadcast failedUnknown message received: pong[window.tAph#1.async-connection.ui] : [1111662] : connection closed[window.tAph#1.async-connection] : closing previous connection...[window.tAph#1.async-connection.blocking] : [5432135] : connection closed[window.tAph#1.async-connection] : connect...[window.tAph#1.async-connection.blocking] : [2466450] : send asynchronous POST[window.tAph#1.async-connection.heartbeat] : ping[window.tAph#1.async-connection.ui] : [3987121] : send asynchronous POST[window.tAph#1.async-connection.ui] : [3987121] : receive [200] OK[window.tAph#1.async-connection.blocking] : [2466450] : receive [200] OK[window.tAph#1.async-connection.ui] : [4417884] : send asynchronous POST[window.tAph#1.async-connection.ui] : [4417884] : receive [200] OK[window.tAph#1.async-connection] : receive broadcast failedUnknown message received: pong[window.tAph#1.async-connection.ui] : [4417884] : connection closed[window.tAph#1.async-connection] : closing previous connection...[window.tAph#1.async-connection.blocking] : [2466450] : connection closed[window.tAph#1.async-connection] : connect...[window.tAph#1.async-connection.blocking] : [1299485] : send asynchronous POST[window.tAph#1.async-connection.heartbeat] : pong lost[window.tAph#1] : connection in trouble[window.tAph#1.async-connection] : retry to connect...[window.tAph#1.async-connection] : closing previous connection...[window.tAph#1.async-connection.blocking] : [5033885] : connection closed[window.tAph#1.async-connection] : connect...[window.tAph#1.async-connection.blocking] : [3191142] : send asynchronous POST[window.tAph#1.async-connection.blocking] : [1299485] : receive [200] OK[window.tAph#1.async-connection.heartbeat] : pong lost[window.tAph#1] : connection in trouble[window.tAph#1.async-connection] : retry to connect...[window.tAph#1.async-connection] : closing previous connection...[window.tAph#1.async-connection.blocking] : [1299485] : connection closed[window.tAph#1.async-connection] : connect...[window.tAph#1.async-connection.blocking] : [576374] : send asynchronous POST[window.tAph#1.async-connection.blocking] : [3191142] : receive [200] OK[window.tAph#1.async-connection.heartbeat] : ping[window.tAph#1.async-connection.ui] : [4165085] : send asynchronous POST[window.tAph#1.async-connection.ui] : [4165085] : receive [200] OK[window.tAph#1.async-connection.blocking] : [576374] : receive [200] OK[window.tAph#1.async-connection.ui] : [5425224] : send asynchronous POST[window.tAph#1.async-connection.ui] : [5425224] : receive [200] OK[window.tAph#1.async-connection] : receive broadcast failedUnknown message received: pong[window.tAph#1.async-connection.ui] : [5425224] : connection closed[window.tAph#1.async-connection] : closing previous connection...[window.tAph#1.async-connection.blocking] : [576374] : connection closed[window.tAph#1.async-connection] : connect...[window.tAph#1.async-connection.blocking] : [9708085] : send asynchronous POST[window.tAph#1.async-connection.heartbeat] : ping[window.tAph#1.async-connection.ui] : [3922216] : send asynchronous POST[window.tAph#1.async-connection.ui] : [3922216] : receive [200] OK[window.tAph#1.async-connection.blocking] : [9708085] : receive [200] OK[window.tAph#1.async-connection.ui] : [8918660] : send asynchronous POST[window.tAph#1.async-connection] : closing previous connection...[window.tAph#1.async-connection.blocking] : [9708085] : connection closed[window.tAph#1.async-connection] : connect...[window.tAph#1.async-connection.blocking] : [8537700] : send asynchronous POST[window.tAph#1.async-connection.heartbeat] : pong lost[window.tAph#1] : connection in trouble[window.tAph#1.async-connection] : retry to connect...[window.tAph#1.async-connection] : closing previous connection...[window.tAph#1.async-connection.blocking] : [3191142] : connection closed[window.tAph#1.async-connection] : connect...[window.tAph#1.async-connection.blocking] : [8503582] : send asynchronous POST[window.tAph#1.async-connection.ui] : [8918660] : receive [200] OK[window.tAph#1.async-connection] : receive broadcast failedUnknown message received: pong[window.tAph#1.async-connection.ui] : [8918660] : connection closed[window.tAph#1.async-connection.blocking] : [8537700] : receive [200] OK[window.tAph#1.async-connection.heartbeat] : pong lost[window.tAph#1] : connection in trouble[window.tAph#1.async-connection] : retry to connect...[window.tAph#1.async-connection] : closing previous connection...[window.tAph#1.async-connection.blocking] : [8537700] : connection closed[window.tAph#1.async-connection] : connect...[window.tAph#1.async-connection.blocking] : [6314237] : send asynchronous POST[window.tAph#1.async-connection.blocking] : [8503582] : receive [200] OK 


So basically the heart beating stops working (the ajax functionality still works) ... which also causes the connection to get lost.

Eduard.
 
Forum Index -> Components
Go to:   
Powered by JForum 2.1.7ice © JForum Team