You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Costa Basil <co...@yahoo.ca> on 2006/03/08 01:20:47 UTC
problem with tree2 plus/minus images
I use myfaces 1.1.1. Here is my tree2 tag:
<t:tree2 id="contactsTree" binding="#{contacts$contactRelations.tree}" value="#{contacts$contactRelations.treeData}" var="node" varNodeToggler="t"
imageLocation="../../images/tree" javascriptLocation="../../js" clientSideToggle="true" preserveToggle="true">
<f:facet name="leaf">
<h:panelGroup>
<h:outputText value="#{node.description}"/>
</h:panelGroup>
</f:facet>
<f:facet name="folder">
<h:panelGroup>
<h:outputText value="#{node.description}"/>
</h:panelGroup>
</f:facet>
</t:tree2>
The problem that I have is that when I click on the icon to expand the node the image is not changed from plus to minus. If I refresh the page the plus/minus images are refreshed properly.
Am I doing something wrong here? I did search the mailing list but I couldn't find anything satisfactory. Some people complained at one point that a relative imageLocation is not working properly but in my case the images are there.
Thanks
---------------------------------
Make Yahoo! Canada your Homepage Yahoo! Canada Homepage
RE: problem with tree2 plus/minus images
Posted by Costa Basil <co...@yahoo.ca>.
Randy, I figured out what the problem is. It is the treeNavClick function, to be more specific it is the line with:
if (navImage.src.indexOf(image1)>=0) navImage.src = image2; else navImage.src = image1;
If you use a relative image path then image1 & image2 will be: '../../images/tree/../../images/tree/nav-minus-line-last.gif' respectively '../../images/tree/nav-plus-line-last.gif', however, navImag.src contains the full path to the image, i.e. http://localhost:7001/app/images/tree/nav-plus-line-last.gif' therefore the test in that line is always false.
To answer your question, I might be asked to change icons.
Randy Simon <ra...@hotmail.com> wrote: Why do you need the imageLocation and javascriptLocation? Are you not using
the images and javascript that is packaged with tomahawk?
I think that if you do not use the packaged images and javascript then
techincally you do not need the filter. I would guess that the reason it
does not work is that your imageLocation is wrong.
Randy
>From: Costa Basil
>Reply-To: "MyFaces Discussion"
>To: MyFaces Discussion
>Subject: RE: problem with tree2 plus/minus images
>Date: Tue, 7 Mar 2006 19:52:16 -0500 (EST)
>
>Thank you for your suggestion, Randy. Here is what I did:
>
>1. If I remove the imageLocation & javascriptLocation attributes and
>install the filter, then the tree works fine, I changes the +/- images
>fine.
>
>2. If I keep the imageLocation & javascriptLocation attributes, toggling
>the +/- images doesn't work even with the filter.
>
>I think I am going to take a look at the javascript portion to see why the
>heck it doesn't change the plus or the minus in case 2.
>
>Randy Simon wrote: I kind of remember having the
>same problem. Did you include the myfaces
>extensions filter in your web.xml?
>
>
>
> extensionsFilter
>
>org.apache.myfaces.component.html.util.ExtensionsFilter
>
>
>
>
> extensionsFilter
> *.jsp
>
>
>
> >From: Costa Basil
> >Reply-To: "MyFaces Discussion"
> >To: users@myfaces.apache.org
> >Subject: problem with tree2 plus/minus images
> >Date: Tue, 7 Mar 2006 19:20:47 -0500 (EST)
> >
> >I use myfaces 1.1.1. Here is my tree2 tag:
> >
> >
> >binding="#{contacts$contactRelations.tree}"
> >value="#{contacts$contactRelations.treeData}" var="node"
>varNodeToggler="t"
> > imageLocation="../../images/tree"
> >javascriptLocation="../../js" clientSideToggle="true"
> >preserveToggle="true">
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >The problem that I have is that when I click on the icon to expand the
>node
> >the image is not changed from plus to minus. If I refresh the page the
> >plus/minus images are refreshed properly.
> >
> >Am I doing something wrong here? I did search the mailing list but I
> >couldn't find anything satisfactory. Some people complained at one point
> >that a relative imageLocation is not working properly but in my case the
> >images are there.
> >
> >Thanks
> >
> >
> >
> >---------------------------------
> >Make Yahoo! Canada your Homepage Yahoo! Canada Homepage
>
>
>
>
>
>---------------------------------
>7 bucks a month. This is Huge Yahoo! Music Unlimited
---------------------------------
7 bucks a month. This is Huge Yahoo! Music Unlimited
RE: problem with tree2 plus/minus images
Posted by Randy Simon <ra...@hotmail.com>.
Why do you need the imageLocation and javascriptLocation? Are you not using
the images and javascript that is packaged with tomahawk?
I think that if you do not use the packaged images and javascript then
techincally you do not need the filter. I would guess that the reason it
does not work is that your imageLocation is wrong.
Randy
>From: Costa Basil <co...@yahoo.ca>
>Reply-To: "MyFaces Discussion" <us...@myfaces.apache.org>
>To: MyFaces Discussion <us...@myfaces.apache.org>
>Subject: RE: problem with tree2 plus/minus images
>Date: Tue, 7 Mar 2006 19:52:16 -0500 (EST)
>
>Thank you for your suggestion, Randy. Here is what I did:
>
>1. If I remove the imageLocation & javascriptLocation attributes and
>install the filter, then the tree works fine, I changes the +/- images
>fine.
>
>2. If I keep the imageLocation & javascriptLocation attributes, toggling
>the +/- images doesn't work even with the filter.
>
>I think I am going to take a look at the javascript portion to see why the
>heck it doesn't change the plus or the minus in case 2.
>
>Randy Simon <ra...@hotmail.com> wrote: I kind of remember having the
>same problem. Did you include the myfaces
>extensions filter in your web.xml?
>
>
>
> extensionsFilter
>
>org.apache.myfaces.component.html.util.ExtensionsFilter
>
>
>
>
> extensionsFilter
> *.jsp
>
>
>
> >From: Costa Basil
> >Reply-To: "MyFaces Discussion"
> >To: users@myfaces.apache.org
> >Subject: problem with tree2 plus/minus images
> >Date: Tue, 7 Mar 2006 19:20:47 -0500 (EST)
> >
> >I use myfaces 1.1.1. Here is my tree2 tag:
> >
> >
> >binding="#{contacts$contactRelations.tree}"
> >value="#{contacts$contactRelations.treeData}" var="node"
>varNodeToggler="t"
> > imageLocation="../../images/tree"
> >javascriptLocation="../../js" clientSideToggle="true"
> >preserveToggle="true">
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >The problem that I have is that when I click on the icon to expand the
>node
> >the image is not changed from plus to minus. If I refresh the page the
> >plus/minus images are refreshed properly.
> >
> >Am I doing something wrong here? I did search the mailing list but I
> >couldn't find anything satisfactory. Some people complained at one point
> >that a relative imageLocation is not working properly but in my case the
> >images are there.
> >
> >Thanks
> >
> >
> >
> >---------------------------------
> >Make Yahoo! Canada your Homepage Yahoo! Canada Homepage
>
>
>
>
>
>---------------------------------
>7 bucks a month. This is Huge Yahoo! Music Unlimited
RE: problem with tree2 plus/minus images
Posted by Costa Basil <co...@yahoo.ca>.
Thank you for your suggestion, Randy. Here is what I did:
1. If I remove the imageLocation & javascriptLocation attributes and install the filter, then the tree works fine, I changes the +/- images fine.
2. If I keep the imageLocation & javascriptLocation attributes, toggling the +/- images doesn't work even with the filter.
I think I am going to take a look at the javascript portion to see why the heck it doesn't change the plus or the minus in case 2.
Randy Simon <ra...@hotmail.com> wrote: I kind of remember having the same problem. Did you include the myfaces
extensions filter in your web.xml?
extensionsFilter
org.apache.myfaces.component.html.util.ExtensionsFilter
extensionsFilter
*.jsp
>From: Costa Basil
>Reply-To: "MyFaces Discussion"
>To: users@myfaces.apache.org
>Subject: problem with tree2 plus/minus images
>Date: Tue, 7 Mar 2006 19:20:47 -0500 (EST)
>
>I use myfaces 1.1.1. Here is my tree2 tag:
>
>
>binding="#{contacts$contactRelations.tree}"
>value="#{contacts$contactRelations.treeData}" var="node" varNodeToggler="t"
> imageLocation="../../images/tree"
>javascriptLocation="../../js" clientSideToggle="true"
>preserveToggle="true">
>
>
>
>
>
>
>
>
>
>
>
>
>The problem that I have is that when I click on the icon to expand the node
>the image is not changed from plus to minus. If I refresh the page the
>plus/minus images are refreshed properly.
>
>Am I doing something wrong here? I did search the mailing list but I
>couldn't find anything satisfactory. Some people complained at one point
>that a relative imageLocation is not working properly but in my case the
>images are there.
>
>Thanks
>
>
>
>---------------------------------
>Make Yahoo! Canada your Homepage Yahoo! Canada Homepage
---------------------------------
7 bucks a month. This is Huge Yahoo! Music Unlimited
RE: problem with tree2 plus/minus images
Posted by Randy Simon <ra...@hotmail.com>.
I kind of remember having the same problem. Did you include the myfaces
extensions filter in your web.xml?
<!-- MyFaces extenstion filter -->
<filter>
<filter-name>extensionsFilter</filter-name>
<filter-class>org.apache.myfaces.component.html.util.ExtensionsFilter</filter-class>
</filter>
<!-- Define filter mappings for myfaces extensions filter -->
<filter-mapping>
<filter-name>extensionsFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
>From: Costa Basil <co...@yahoo.ca>
>Reply-To: "MyFaces Discussion" <us...@myfaces.apache.org>
>To: users@myfaces.apache.org
>Subject: problem with tree2 plus/minus images
>Date: Tue, 7 Mar 2006 19:20:47 -0500 (EST)
>
>I use myfaces 1.1.1. Here is my tree2 tag:
>
> <t:tree2 id="contactsTree"
>binding="#{contacts$contactRelations.tree}"
>value="#{contacts$contactRelations.treeData}" var="node" varNodeToggler="t"
> imageLocation="../../images/tree"
>javascriptLocation="../../js" clientSideToggle="true"
>preserveToggle="true">
> <f:facet name="leaf">
> <h:panelGroup>
> <h:outputText value="#{node.description}"/>
> </h:panelGroup>
> </f:facet>
> <f:facet name="folder">
> <h:panelGroup>
> <h:outputText value="#{node.description}"/>
> </h:panelGroup>
> </f:facet>
> </t:tree2>
>
>The problem that I have is that when I click on the icon to expand the node
>the image is not changed from plus to minus. If I refresh the page the
>plus/minus images are refreshed properly.
>
>Am I doing something wrong here? I did search the mailing list but I
>couldn't find anything satisfactory. Some people complained at one point
>that a relative imageLocation is not working properly but in my case the
>images are there.
>
>Thanks
>
>
>
>---------------------------------
>Make Yahoo! Canada your Homepage Yahoo! Canada Homepage