UISeries Components: Issue with ICE-4667, Revision: 19144
[Logo]
ICEsoft.org Forums: ICEfaces, ICEmobile, ICEpdf
[Search] Search   [Recent Topics] Recent Topics   [Groups] Home Page | www.icefaces.org  [Register] Register  [Login] Login 
UISeries Components: Issue with ICE-4667, Revision: 19144  XML
Forum Index -> Components
Author Message
chrishantha

Joined: 04/03/2008 00:00:00
Messages: 148
Offline


I was using ICEfaces 1.8.1 with revision 18921 and I couldn't update to ICEfaces 1.8.2 as there is an issue.

The issue seems to be related with the fix applied for http://jira.icefaces.org/browse/ICE-4667.

The problem is with a page in our application. That pages uses a data table inside another data table. i.e. Nested <ice:dataTable> components.

There are <ice:selectOneMenu> components in the parent and child tables.

Following is a stripped down version of the page.

Code:
 <ice:dataTable id="tblPhs" value="#{managedBean.phaseDTOs}" var="phaseDTO"
 	width="100%" style="width: 100%;" binding="#{managedBean.compPhases}" styleClass="phasesDatTbl">
 	<ice:column id="col1">
 		<ice:panelGroup id="pnlPhSts">
 			<ice:setEventPhase id="sepPST" events="ValueChangeEvent" phase="INVOKE_APPLICATION">
 				<ice:selectOneMenu id="mnuPhSts" partialSubmit="true" value="#{phaseDTO.status}"
 					valueChangeListener="#{managedBean.valueChangeStatus}" immediate="true">
 				</ice:selectOneMenu>
 			</ice:setEventPhase>
 			<ice:message id="msgPhSts" for="mnuPhSts"/>
 		</ice:panelGroup>
 		<ice:dataTable id="tblActivity" value="#{phaseDTO.activities}"
 			var="row" width="100%">
 			<ice:column id="colStat">
 				<ice:panelGroup id="pngStatVal">
 					<ice:setEventPhase id="sepST" events="ValueChangeEvent" phase="INVOKE_APPLICATION">
 						<ice:selectOneMenu id="mnuSts" partialSubmit="true" value="#{row.status}" 
 							valueChangeListener="#{managedBean.valueChangeStatus}">
 						</ice:selectOneMenu>
 					</ice:setEventPhase>
 					<ice:message id="msgSts" for="mnuSts"/>
 				</ice:panelGroup>
 			</ice:column>
 		 </ice:dataTable>
 	</ice:column>
 </ice:dataTable>
 


The values in each <ice:selectOneMenu> depend on each others' values. There are value change listeners and each value change listener may change the values in all other drop downs.

After value change listener changes other drop downs' values, an information FacesMessage is added to appropriate component.

These value change listeners worked perfectly in ICEfaces 1.8.1.

After updating to ICEfaces 1.8.2, values in drop downs did not reflect correctly after the value change event.

Then I analyzed the revisions after 18921 and I found that the issue is related to the fix done in revision 19144.

Reverting the change done in revision 19144 solves the issue with value change events.

SVN Log

Diff View

I am not sure what causes the issue, but it just works after reverting the change.

Isuru Perera
chrishantha

Joined: 04/03/2008 00:00:00
Messages: 148
Offline


I just found out a reason.

Revision 19144 changed com.icesoft.faces.component.panelseries.UISeries.keepSaved(FacesContext) method

From: (Old Version)
Code:
private boolean keepSaved(FacesContext facesContext) {
 	Iterator childIds = savedChildren.keySet().iterator();
 	while (childIds.hasNext()) {
 		String childId = (String) childIds.next();
 		Iterator childMessages = facesContext.getMessages(childId);
 		while (childMessages.hasNext()) {
 			FacesMessage childMessage = (FacesMessage) childMessages.next();
 			if (childMessage.getSeverity()
 					.compareTo(FacesMessage.SEVERITY_ERROR) >= 0) {
 				return (true);
 			}
 		}
 	}
 	// return true if this component is nested inside a UIData 
 	return (isNestedWithinUIData());
 }



To: (New Version)
Code:
private boolean keepSaved(FacesContext facesContext) {
 	if (maximumSeverityAtLeastError(facesContext)) {
 		return true;
 	}
 	// return true if this component is nested inside a UIData 
 	return (isNestedWithinUIData());
 }
 
 private boolean maximumSeverityAtLeastError(FacesContext facesContext) {
 	FacesMessage.Severity maximumSeverity = facesContext.getMaximumSeverity();
 	return ( (maximumSeverity != null) &&
 			 (FacesMessage.SEVERITY_ERROR.compareTo(maximumSeverity) >= 0) );
 }


In some cases, these methods return two different values. (I observed these using eclipse expression watch view)

When keepSaved() method is called for the parent Data Table, Old version returns "false".

New version returns "true". This is because "maximumSeverityAtLeastError(facesContext)" return true as I have added a FacesMessage with severity INFO.

In both versions "isNestedWithinUIData()" is false as the component is the parent data table.

It seems I have to use the reverted version for now.

Isuru Perera
chrishantha

Joined: 04/03/2008 00:00:00
Messages: 148
Offline


The method com.icesoft.faces.component.panelseries.UISeries.keepSaved(FacesContext) is used in two places.

1. com.icesoft.faces.component.panelseries.UISeries.encodeBegin(FacesContext)

2. com.icesoft.faces.component.panelseries.UISeries.processDecodes(FacesContext)

The issue is with encodeBegin() method.

Code:
 public void encodeBegin(FacesContext context) throws IOException {
 	dataModel = null;
 	if (!keepSaved(context)) {
 		savedChildren = new HashMap();
 	}
 	super.encodeBegin(context);
 }


In latest version, keepSaved() returns "true" and then savedChildren map is not initialized, which causes the problem for me.

This is because I add a FacesMessage. I need to add that to display a successful message.

I hope ICEfaces developers can look in to this issue and provide a fix.

For now, I decided to revert the change in revision 19144.

Isuru Perera
mark.collette


Joined: 07/02/2005 00:00:00
Messages: 1556
Offline


Thanks for reporting this, with such informative detail. That really helped solve this expediently :)

Here's the Jira for this issue:

Regression: UISeries.keepSaved performance
http://jira.icefaces.org/browse/ICE-5525
[Email]
chrishantha

Joined: 04/03/2008 00:00:00
Messages: 148
Offline


Hi Mark,

Thank you very much for fixing the issue quickly.

Yes, I try to explain in detail when there is an issue. I always try to find exact place of the issue and report. I know that will be helpful to you and other developers.

If you have time, can you please look at another small issue. http://www.icefaces.org/JForum/posts/list/16406.page

Thanks again for the help.

Isuru Perera
 
Forum Index -> Components
Go to:   
Powered by JForum 2.1.7ice © JForum Team