myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo11 <joel_mat...@infosys.com>
Subject problem with image rendering
Date Fri, 01 Aug 2008 12:30:17 GMT

Hi,

We have a data table with sortable header.But we have our own implementation
for the sortable headers.
We are putting it in facelets and the content is like

<ui:composition>
        <h:commandLink
actionListener="#{paginationBean.getSortedColumnList}"
value="#{columnHeader}" styleClass="#{styleClass}">
		<f:param name="columnName" value="#{columnParam}" />
        <h:graphicImage	id="#{columnParam}"  rendered="false"
immediate="true" style="border:none;padding:4px;" />			 		
  		</h:commandLink>		
</ui:composition>

When the user is clicks on the second header after he has clicked the first
one, the first header image should disappear.To achieve this we keep a
handle of the previous image in the session and when the user clicks on a
new header we set the old image component's rendered property to false .
This logic used to work fine in icefaces as the image objects always remain
the same.But in myfaces its not working as the objects are different and
they are taking the state of the previous object.

The code snippet that gets invoked on click of a header is given below

	List childrenList = event.getComponent().getChildren();
		Iterator it = (Iterator) childrenList.iterator();
		while (it.hasNext()) {
			UIComponent comp = (UIComponent) it.next();
			if (comp instanceof HtmlGraphicImage) {
				HtmlGraphicImage image = (HtmlGraphicImage) comp;
				if (getOldImageComponent() != null && getOldImageComponent() != image) {		
					getOldImageComponent().setRendered(false);
				
				}
				image.setRendered(true);
				getPaginationBeanState().setOldImageComponent(image);


Can someone provide any workaround for the issue?

Thanks in advance...


-- 
View this message in context: http://www.nabble.com/problem-with-image-rendering-tp18773409p18773409.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Mime
View raw message