You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Jorge Vásquez <jv...@3eyegroup.com> on 2006/07/28 03:37:02 UTC
tree2 images problem...
Regards,
I know that this subject has been treated lots of times but unfortunately I
haven´t found a clear and helpful answer in other mails.
I have defined specific images to use with this component and have placed
them in images..
The following is a fragment from my .xhtml file (In case it matters I am
using Facelets):
<h:form id="treeForm">
<!-- Expand/Collapse Handled By Server -->
<t:tree2 id="serverTree" value="#{searchTreeBean.treeModel}"
var="node" varNodeToggler="t"
org.apache.myfaces.tree2.CLIENT_SIDE_TOGGLE="#{searchTreeBean.booleanFalse}"
org.apache.myfaces.tree2.SHOW_ROOT_NODE="#{searchTreeBean.booleanFalse}"
org.apache.myfaces.tree2.SHOW_LINES="#{searchTreeBean.booleanFalse}"
org.apache.myfaces.tree2.SHOW_NAV="#{searchTreeBean.booleanFalse}">
<f:facet name="searchableLibrariesFolder">
<h:panelGroup>
<t:graphicImage value="#{node.iconOpen}"
rendered="#{t.nodeExpanded}"
style="border:0px" />
<t:graphicImage value="#{node.icon}"
rendered="#{!t.nodeExpanded}"
style="border:0px" />
<h:outputText value="#{node.description}"
styleClass="nodeFolder" />
</h:panelGroup>
</f:facet>
<f:facet name="libraryFolder">
<h:panelGroup>
<t:graphicImage value="#{node.iconOpen}"
rendered="#{t.nodeExpanded}"
style="border:0px" />
<t:graphicImage value="#{node.icon}"
rendered="#{!t.nodeExpanded}"
style="border:0px" />
<h:outputText value="#{node.description}"
styleClass="nodeFolder" />
</h:panelGroup>
</f:facet>
My tree gets loaded for the first time appropriately but after a request is
made the images that I defined stop appearing.
These images are located in:
WebContent/pages/images/timages/
";
And they are mapped to a property named icon that I created in a class that
extends from TreeNodeBase.
I also have verified my web.xml a thousand times and the filter is
configured accordingly as follows:
<filter>
<filter-name>extensionsFilter</filter-name>
<filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-clas
s>
<init-param>
<param-name>uploadMaxFileSize</param-name>
<param-value>100m</param-value>
</init-param>
<init-param>
<param-name>uploadThresholdSize</param-name>
<param-value>100k</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>extensionsFilter</filter-name>
<url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>extensionsFilter</filter-name>
<url-pattern>*.jsf</url-pattern>
</filter-mapping>
I have tried the solution recommended in other mails with the imageLocation
attribute but then the problem is even worst since no images appear on
screen.
Please, somebody help me!!!!
I don´t mean to sound too dummy but if somebody can give me a detailed
example where he/she uses his/her own images and shows me how to configure
the web page, the imageLocation attribute and the web.xml, I think that it
would definitely suffice.
Thanks in advance,
JV
RE: tree2 images problem...
Posted by Jorge Vásquez <jv...@3eyegroup.com>.
Problem solved for now:
I changed the path of each image to be absolute and it started working.
Regards,
JV
p.d: One new problem in case anyone knows: As I post a new request the
opened nodes are lost, I have to navigate again
in other words no state of
the opened nodes is kept.
_____
De: Jorge Vásquez [mailto:jv@3eyegroup.com]
Enviado el: jueves, 27 de julio de 2006 20:37
Para: 'MyFaces Discussion'
Asunto: tree2 images problem...
Regards,
I know that this subject has been treated lots of times but unfortunately I
haven´t found a clear and helpful answer in other mails.
I have defined specific images to use with this component and have placed
them in images..
The following is a fragment from my .xhtml file (In case it matters I am
using Facelets):
<h:form id="treeForm">
<!-- Expand/Collapse Handled By Server -->
<t:tree2 id="serverTree" value="#{searchTreeBean.treeModel}"
var="node" varNodeToggler="t"
org.apache.myfaces.tree2.CLIENT_SIDE_TOGGLE="#{searchTreeBean.booleanFalse}"
org.apache.myfaces.tree2.SHOW_ROOT_NODE="#{searchTreeBean.booleanFalse}"
org.apache.myfaces.tree2.SHOW_LINES="#{searchTreeBean.booleanFalse}"
org.apache.myfaces.tree2.SHOW_NAV="#{searchTreeBean.booleanFalse}">
<f:facet name="searchableLibrariesFolder">
<h:panelGroup>
<t:graphicImage value="#{node.iconOpen}"
rendered="#{t.nodeExpanded}"
style="border:0px" />
<t:graphicImage value="#{node.icon}"
rendered="#{!t.nodeExpanded}"
style="border:0px" />
<h:outputText value="#{node.description}"
styleClass="nodeFolder" />
</h:panelGroup>
</f:facet>
<f:facet name="libraryFolder">
<h:panelGroup>
<t:graphicImage value="#{node.iconOpen}"
rendered="#{t.nodeExpanded}"
style="border:0px" />
<t:graphicImage value="#{node.icon}"
rendered="#{!t.nodeExpanded}"
style="border:0px" />
<h:outputText value="#{node.description}"
styleClass="nodeFolder" />
</h:panelGroup>
</f:facet>
My tree gets loaded for the first time appropriately but after a request is
made the images that I defined stop appearing.
These images are located in:
WebContent/pages/images/timages/
";
And they are mapped to a property named icon that I created in a class that
extends from TreeNodeBase.
I also have verified my web.xml a thousand times and the filter is
configured accordingly as follows:
<filter>
<filter-name>extensionsFilter</filter-name>
<filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-clas
s>
<init-param>
<param-name>uploadMaxFileSize</param-name>
<param-value>100m</param-value>
</init-param>
<init-param>
<param-name>uploadThresholdSize</param-name>
<param-value>100k</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>extensionsFilter</filter-name>
<url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>extensionsFilter</filter-name>
<url-pattern>*.jsf</url-pattern>
</filter-mapping>
I have tried the solution recommended in other mails with the imageLocation
attribute but then the problem is even worst since no images appear on
screen.
Please, somebody help me!!!!
I don´t mean to sound too dummy but if somebody can give me a detailed
example where he/she uses his/her own images and shows me how to configure
the web page, the imageLocation attribute and the web.xml, I think that it
would definitely suffice.
Thanks in advance,
JV