voyent
PanelSeries in Datatable Update Problem  XML
Forum Index -> Components
Author Message
ejay

Joined: 28/Nov/2006 00:00:00
Messages: 34
Offline


Hi,

I have a panel Series inside a datatable column (which for each row display data coming from a Collection). The first set of data displayed in the panelSeries is correct, however if the content of my datatable changes it seems that the panelSeries content is not updated properly (it seem to be the old one).

Does anyone have any suggestion as to why this would occur?

Thanks,
Emmanuel

Emmanuel
ibanhoe

Joined: 12/Apr/2007 00:00:00
Messages: 71
Offline


hi

i have a similar problem with two nested datatables

i didnĀ“t found a solution

I made this:

http://www.icefaces.org/JForum/posts/list/4520.page

I hope this helps


dkohl

Joined: 02/Jun/2007 00:00:00
Messages: 13
Offline


Here the solution:

a) Create a new class for the surrounding UISeries (datatable, panelseries...). The field we've to reset is protected.
b) Create a "forceRefresh"-method with the following code:

Code:
 	public void forceRefresh() {
 		savedChildren.clear();
 	}
 


c) Create binding for this UISeries.
d) Call this method before the new page is rendered (e.g. when a button is pressed).

For me it works really fine and seems to be an elegant workaround for this problem.

Greetings

Daniel
sbutalia

Joined: 18/Sep/2007 00:00:00
Messages: 18
Offline


Tried this but getting an "argument mismatch" error...

Code:
 package view.UI;
 
 import com.icesoft.faces.component.panelseries.PanelSeries;
 
 public class MDPanelSeries extends PanelSeries {
     
     public void forceRefresh() {
         savedChildren.clear();
     }
 }
 


Code:
         <ice:column rendered="#{backing_search.showColPartData}" >
             <f:facet name="header">
                  <ice:outputText value="#{backing_search.partDataColumnName}"/>
             </f:facet> 
             <ice:panelSeries binding="#{backing_search.psMDPartPayloads}"
                                     id="panelSeries1"/>
 ...
 
 


Code:
 javax.faces.FacesException: Problem in renderResponse: argument type mismatch
 	at com.icesoft.faces.facelets.D2DFaceletViewHandler.renderResponse(D2DFaceletViewHandler.java:329)
 	at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:153)
 	at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:107)
 	at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:268)
 
intercollector

Joined: 11/Jan/2008 00:00:00
Messages: 17
Offline


Had the same problem as you "Argument Mismatch".

The issue got me puzzled, and it comes down to the inability to "override" existing components, which using the same tag and renderer.

I had to create my own "custom tag" even though I wanted to re-use the renderer and tag definition. I did this with the following snippets:

faces-config:

Code:
     <component>
         <component-type>package.ExtendingPanelSeries</component-type>
         <component-class>package.ExtendingPanelSeries</component-class>
     </component>
 


web.xml:

Code:
 
     <context-param>
         <param-name>facelets.LIBRARIES</param-name>
         <param-value>
             /WEB-INF/<custom tag file>.xml
         </param-value>
     </context-param>
 


<custom tag file>:
Code:
 <?xml version="1.0"?>
 <!DOCTYPE facelet-taglib PUBLIC
   "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
   "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
 
 <facelet-taglib>
 	<namespace>your name space here</namespace>
 	<tag>
 		<tag-name>panelSeries</tag-name>
 		<component>
 			<component-type>package.ExtendingPanelSeries</component-type>
 			<renderer-type>com.icesoft.faces.PanelSeriesRenderer</renderer-type>
 			<handler-class>com.icesoft.faces.component.facelets.IceComponentHandler</handler-class>
 		</component>
 	</tag>
 </facelet-taglib>
 
 


jsp:
Code:
 <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
 	xmlns:ui="http://java.sun.com/jsf/facelets"
 	xmlns:h="http://java.sun.com/jsf/html"
 	xmlns:t="http://myfaces.apache.org/tomahawk"
 	xmlns:f="http://java.sun.com/jsf/core" version="2.0"
 	xmlns:ice="http://www.icesoft.com/icefaces/component"
 	xmlns:cust="your namespace">
 
 	<cust:panelSeries ...></cust:panelSeries>.....
 



I'm sure their might be an easier way (part of my problem might be because of facelets), but this worked for me, and I struggled with it for about a half of a day.

This should solve this problem, as well as any other time you want to use a custom component with an existing renderer.
sbutalia

Joined: 18/Sep/2007 00:00:00
Messages: 18
Offline


ah interesting... I'll defn try this. Thanks for the post.
Infrag

Joined: 26/Feb/2008 00:00:00
Messages: 3
Offline


intercollector wrote:
Had the same problem as you "Argument Mismatch".

The issue got me puzzled, and it comes down to the inability to "override" existing components, which using the same tag and renderer.

I had to create my own "custom tag" even though I wanted to re-use the renderer and tag definition. I did this with the following snippets:

faces-config:

Code:
     <component>
         <component-type>package.ExtendingPanelSeries</component-type>
         <component-class>package.ExtendingPanelSeries</component-class>
     </component>
 


web.xml:

Code:
 
     <context-param>
         <param-name>facelets.LIBRARIES</param-name>
         <param-value>
             /WEB-INF/<custom tag file>.xml
         </param-value>
     </context-param>
 


<custom tag file>:
Code:
 <?xml version="1.0"?>
 <!DOCTYPE facelet-taglib PUBLIC
   "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
   "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
 
 <facelet-taglib>
 	<namespace>your name space here</namespace>
 	<tag>
 		<tag-name>panelSeries</tag-name>
 		<component>
 			<component-type>package.ExtendingPanelSeries</component-type>
 			<renderer-type>com.icesoft.faces.PanelSeriesRenderer</renderer-type>
 			<handler-class>com.icesoft.faces.component.facelets.IceComponentHandler</handler-class>
 		</component>
 	</tag>
 </facelet-taglib>
 
 


jsp:
Code:
 <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
 	xmlns:ui="http://java.sun.com/jsf/facelets"
 	xmlns:h="http://java.sun.com/jsf/html"
 	xmlns:t="http://myfaces.apache.org/tomahawk"
 	xmlns:f="http://java.sun.com/jsf/core" version="2.0"
 	xmlns:ice="http://www.icesoft.com/icefaces/component"
 	xmlns:cust="your namespace">
 
 	<cust:panelSeries ...></cust:panelSeries>.....
 



I'm sure their might be an easier way (part of my problem might be because of facelets), but this worked for me, and I struggled with it for about a half of a day.

This should solve this problem, as well as any other time you want to use a custom component with an existing renderer. 


If yoo add something like:
Code:
 <component>
         <component-type>com.icesoft.faces.HtmlDataTable</component-type>
         <component-class>path.to.extended.component.class</component-class>
     </component>
 

Than it works OK.
dgopalkrishna

Joined: 03/Aug/2009 00:00:00
Messages: 4
Offline


The other soln. which worked:

1. Set binding property for all the panel series
In JSP:
Code:
<ice:panelSeries value="#{parent.childs}" var="ch" binding="#{bean.chPanelSeries}">
 ....
 for all panel series have the corresponding bindings
 

2. Clear the child components when the list needs to rendered again
In Bean:
a. Declare setters and getters for chPanelSeries and other series (type as com.icesoft.faces.component.panelseries.PanelSeries)
b. After the list which needs to be updated in panel series is loaded with new values, clear the child components
Code:
if(chPanelSeries != null) {
 	chPanelSeries.getChildren().clear();
 }
 ....
 for all panel series similarly clear the children.
     


Looks this will reinforce the children to be loaded again.
If there are any better solution will update the thread.

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