I agree with Sean that removing the
if statement would make the tree really slow with server-side toggle. The
code is correct here.
With client-side toggle we may have
to change this ... but if we get a ajax tree working that would be the
best solution.
Well, sounds like a bug. The if statement
is right there, at least with server-side toggle. But with client-side
toggle all nodes should be processed ... every component should get the
chance to update the value.
Open a bug report and add my comment
there.
[EMAIL PROTECTED] schrieb am
Currently preserveToggle only works
with client-side toggle. If you want to keep the state in server-side toggle,
provide a session scoped TreeModel instead of a TreeNode as the model.
Yes, that was the problem.
[EMAIL PROTECTED] schrieb am 28.11.2005 11:53:03:
Hmm ... so it was saving the node state in session the whole
time, even when javax.faces.STATE_SAVING_METHOD was set to
client?
danke
Original message
Date: Mon, 28 Nov 2005 11:46:47 +0100
From:
expand/collapse a node by
code because this feature was already requested and I now need it too :)
Regards,
Mathias Werlitz
[EMAIL PROTECTED] schrieb am 15.11.2005 16:14:00:
Well i have a more general solution in mind, so that you can
wirte your own
TreeModel that can create logical node
At the moment there is no way of determining
directly the parent node (version 1.1.1). You can write your own TreeNode
implementation, that stores the parent.
I'm working on a enhanced version of
the tree2 component that will include this feature.
[EMAIL PROTECTED] schrieb am 11.11.2005
Well i have a more general solution
in mind, so that you can wirte your own TreeModel that can create logical
node ids.
For backwards compatibility the default
will still be based on the old physical pattern.
[EMAIL PROTECTED] schrieb am 14.11.2005 11:21:28:
[EMAIL PROTECTED] wrote:
I'm
A second thought:
There migth also be some important issues
with the new sever-side state saving. I'm not sure how it is implemented
in detail. The state consists of the component tree and the state.
Now if concurrent requests are processed
for the same view, every request should get a
Ok, you are right! But somehow I still
have the feeling that the spec is wrong here ... a personal aversness to
inconsistent behaviour. This way input components behave different within
and outside of a dataTable. But this time I will have to cope with the
situation as it is :/
Ooops, missed this one ... sounds reasonable.
An extended behaviour of t:dataTable
would also be nice :)
I already proposed this. The problem
is, that much of the code in the renderer an the _javascript_ relies on the
physical node id.
By the way, MYFACES-568 should fix the
illogical state problem ... but does not save you from possibly expanding
to wrong node.
[EMAIL PROTECTED] schrieb am
I can confirm this wrong behaviour.
But a clone of MYFACES-277 is somehow missleading. On the contrary the
desired behaviour is the opposite of it.
Seems like a UIData bug, that was introduced
at this time.
This is a known problem ... see MYFACES-568.
,
Mathias Werlitz
[EMAIL PROTECTED] schrieb am 23.09.2005 15:16:40:
Hi,
Anybody know if this patch has made it to the nightly build?
Thanks,
Emmanuel
On 9/18/05, Bruno Aranda [EMAIL PROTECTED]
wrote:
I think that this is probable, Sean, out tree2
expert is now busy with
the release
I recently discovered the same problem
with the tree2 component (http://issues.apache.org/jira/browse/MYFACES-580).
It seems that this problem is caused
by a call to context.getViewRoot().createUniqueId()
within the component renderer.
I changed the renderer so that it does
not depend on this
You could set preserveToggle=false,
but this is the general problem that the tree does not like
dynamic changing tree structures, because the TreeState is not notified
of the changes.
I will propose a patch that will make
the tree more tolerant to incompatible states, see MYFACES-568.
[EMAIL
You can use this config in your web.xml,
there should be no _javascript_...
context-param
param-nameorg.apache.myfaces.ALLOW_JAVASCRIPT/param-name
param-valuefalse/param-value
description
This parameter tells MyFaces if _javascript_ code should be allowed
in the
rendered
Yes, it should be fixed in the nightly
build.
What about immediate=true on the input
component?
Well its more a ugly hack than a solution,
but as long as there are no methods for that in the TreeModel you could
mimic the behaviour with customized code form the expandAll() and expandEverything()
methods of UITreeData in your backing bean getter method that supplies
the TreeModel.
Hmm, strange. Are you sure that this
is a tree2 specific problem? AFAIK the recent changes in the tree2 should
not influence the behaviour of a commandLink.
Is the actionListener called at all?
Can you determine the phase in which this happens? Does the commandLink
behave normally when it is
No, I mean you can create your own method
for expanding the tree in your backing bean and use some source code of
the mentioned methods.
But as I said thats not the way it should
be ... maybe we should move the expand methods back to the TreeModel and
leave the ones in UITreeData as delegates.
If
data about
that row its somehow impossible to do a synchronization in the model that
every component gets the right data for its row currently processing.
Is this a flaw in the spec or do I miss
something here?
Regards,
Mathias Werlitz
Carsten, what toggle mode do you use?
If it is clientside toggle, that this should be fixed with the nightly
built.
Otherwise you can bind the whole component
to your session bean or provide a TreeModel instead of a
TreeNode. It should work than like Sean
explained it, because the state would be
Well, we could move the expandAll methods
back to TreeModel, that you could create your model and invoke this method
and the tree would be expanded from the start.
[EMAIL PROTECTED] schrieb am 23.08.2005 11:15:03:
... I still can't get the tree to be completely expanded at the very
first time
Well, we could move this to TreeState
... like I explained in the MYFACES-438 comment.
Additioanlly we could provide some Listener
stuff in the TreeModel.
[EMAIL PROTECTED] schrieb am 22.08.2005 16:21:53:
Mathias is right about the nodeIdentifier.
I wonder if we could make more use of the
I'm using Tomcat 5.0.28 and the nightly
bulid.
Regarding Tomcat 5.5 the doc says:
If your are using the binary version of MyFaces: MyFaces
is packaged so that it works with Tomcat5.0.x so the WEB-INF/lib/jsp-2.0.jar
and WEB-INF/lib/commons-el.jar JAR files must be removed from your WAR
I thinkt the NullPointerException
is a known problem of the CommandLinkRenderer. It works a bit different
to the RI.
You already figured out the solution:
put everything into a form.
As for the invalid bit mask: Sean already
explained the problem in another post regarding tree2.
[EMAIL
The problem is selected.getIdentifier()does
not return the String that is used in the TreeState for storing the expanded
nodes.
The TreeState does not use the TreeNode.identifier.
You have to provide a NodeId String
that represents the path to the node in the model like 0:1:2.
Currently there is
What version of myfaces and of the tree
component do you use t:tree or t:tree2?
[EMAIL PROTECTED] schrieb am 22.08.2005 15:28:00:
Hi!
I am using the myfaces tree component. It works well but now I would
like to
replace the rootnode after pressing a button in my app.
On pressing the button
Well here is my minimal web.xml that
works with the SUN RI.
Following JARs are in the lib:
commons-beanutils-1.6.1.jar
commons-codec-1.2.jar
commons-collections-3.0.jar
commons-digester-1.5.jar
commons-el.jar
commons-fileupload-1.0.jar
commons-lang-2.0.jar
commons-logging.jar
I got my jsf application running on
a tomcat 4.1 with the following jars:
commons-beanutils-1.6.1.jar
commons-codec-1.2.jar
commons-collections-3.0.jar
commons-digester-1.5.jar
commons-el.jar
commons-fileupload-1.0.jar
commons-lang-2.0.jar
commons-logging.jar
commons-validator.jar
Done :)
Can you give an example of how the tree looks like? How many nodes are
totally displayed?
I have looked a the source and found out, that the model is saved with
the component.
Sean, is that really right? On the other hand the state of the components
seems not to be saved between request.
I
As far as I know the JSF 1.1 spec does
only support saving one single view in server side mode.
Thats really a flaw in the spec and
I don't know why SUN did not included this issue in the first release.
Thus frames are not supported in this
mode. You have to use client side state saving if you
[EMAIL PROTECTED] schrieb am 10.08.2005 00:06:08:
@Mathias,
Looks good. I made a few tweaks (mostly formatting changes)
and
committed. I also changed the examples back the way they were
before
the model change.
I'm glad that its working :) It was more a proof of
concept than a final
I don't know if I understand you right,
two possible solutions:
1. reset the input compoments in the
listerner:
HtmlInputText building = (HtmlInputText) event.getComponent().findComponent(building);
building.setSubmittedValue(null);
2. do a page navigation to the same
page with a command
[EMAIL PROTECTED] schrieb am 09.08.2005 05:02:57:
Mathias. You've got several good ideas here. I will respond
inlinebelow ...
Well my thoughts:
Supplying a custom TreeModel may make sense, but as we found
out it should
not cover the
expand/collapse state of the component. A
Hi Sean,
well I couldn't resist it. I have created
a patch that includes most of my ideas.
It was a fast hack, there may be new
bugs with it.
Most of the changes are in UITree.saveState,
UITree.restoreState and UITree.getDataModel ... now it is again possible
to only supply a root TreeNode.
I
I'm using eclipse 3.1 with WTP 0.7 and Tomcat 5.0.28
and it works fine.
Although I think a context restart is not really necessary
if a edit a JSP page.
Have you looked into the tomcat log? It is located
somewhere in a temp folder under workspace\.metadata\.plugins\org.eclipse.wst.server.core
At the moment there is a problem with
it, because of the canged behavior of the UIInput component (through MYFACES-277).
Now it does not make much sense to use
it, because all not validated fields will lose their value and the user
has to reenter all the data.
My opinion is that this new
Well my thoughts:
Supplying a custom TreeModel may make
sense, but as we found out it should not cover the
expand/collapse state of the component.
A sperate state manager seems to be appropriate. But this manager
has to be saved with the state of the
tree. It would be nice to control this
I had a similar problem. I use UIInput
components with NO value binding. Instead the components have a valueChangedListern
(function) of a bean. So the values are added there internally.
Setting immediate=true on
the input components helps, but if you have serveral parts
of a form, e.g. a second
The new implementation has a major problem:
now I am required to supply a session scoped
TreeModel, because the model and therefor
the expand/collapse state is not saved with the component.
I supply a request scoped TreeModel.
The problem is now: I can expand one node and after that all the
either.
The UIInput component is located in
the footer of a DataTable component.
Any suggestions?
Regards,
Mathias Werlitz
[EMAIL PROTECTED] schrieb am 02.08.2005 11:48:24:
Finally I found a solution for that issue. Have a look into
http://issues.apache.org/jira/browse/MYFACES-277 if you
This issue seems to be fixed in the
nightly build. At least tree2 works now fine for me with the SUN RI :)
Thanks for the hint. I already read
this faq but did not found the server file.
I gave it a second try and now it works
with https (only) :)
Now I am a little bit confused about
the repository structure. Is there a short description how to build it
with eclipse?
Regards,
Mathias Werlitz
of the subcomponents
like the UIData. Maybe it shoud subclass UIData ...
like I pointed out in the Suggested
Enhancement to Tree2 thread.
Regards,
Mathias Werlitz
The Tree2 does not work client-side
because the _javascript_ files cannot be loaded via the Filter in the current
Build:
java.io.IOException: Unable to find resource _javascript_/tree.js
for component tree2.HtmlTreeRenderer. Check that this file is available
in the classpath in sub-directory
? I'm
using Eclipse 3.0 and subclipse 0.9.31.
Mathias Werlitz
[EMAIL PROTECTED] schrieb am 06.07.2005 14:25:53:
Mathias,
I will check into it when I get to work (leaving now.) In the
meantime, I was just running tree2 examples from the latest source
and
I didn't recall any problems? Can
HTTPS does not work either :(
I think I supports webdav (at least
I can connect to the gmx mediacenter via webdav).
Well, there is a bug in the new UIData
implementation. ActionListener are fired although the commandLink was not
clicked.
I'm in contact with Mathias to solve
this.
Regards,
Mathias Werlitz
[EMAIL PROTECTED] schrieb am 05.07.2005 18:30:47:
OK I committed these changes. Thanks for looking
If you output only HTML then you can use HtmlSelectManyListbox.
If it's posssible to use only methods provided by
UISelectMany, then use the superclass instead. But you have to make sure
that the Listbox renderer is used by the component.
[EMAIL PROTECTED] schrieb am 01.07.2005 13:58:16:
I
to define some default node facet.
Regards,
Mathias Werlitz
I personally think subclassing UISelectMany would
be the best way, because you have to deal with all the converter stuff
and the result is similar to a UISelectMany component. But it depends on
what requirements you have.
You can also create subcomponents by code and/or use
an existing render of
Just an idea: you could bind the component
itself to a session scoped bean or save that bean with the x:saveState
component between requests.
I have not tried this, but I guess that
should avoid loosing the state between multiple requests even with page
navigation.
Thanks for the info. Important to know.
But I would expect this behavior, because
the component and its state should be preserved with the instance in the
bean.
are doing
the iteration stuff.
Its also not possible to use JSTL c:forEach
for a similar reason with JSF components.
I think the component tree is only created
once and then the dataList iterates over the components. It does not iterate
over the jsp page.
Bad news. Or I'm wrong?
Mathias Werlitz
=myinput
valueChangeListener=#{testBean.listener} /
/f:facet
/h:dataTable
/h:column
/h:dataTable
/h:form
/body
/html
/f:view
I have created a bug report with a possible
solution at http://issues.apache.org/jira/browse/MYFACES-288
Mathias Werlitz
the effects are really fancy ... but
I would not call the component a ajax component ... more like a _javascript_
enabled component.
thats because there is no real communication
necessary back to the server, unless the state of the puff away
objects is also represented on the server ... e.g. if
Well I my case I am editing the jsp
files and the component structure. It would be interesting to know exactly
how you switch between the different detail tabs (subviews). There maybe
a general issue on using a datatable and subviews within it, because the
datatable has to store the state of the
What is your state saving method. I
guess it is SERVER. The current JSF 1.1 spec seems to have
problems with multiple open views (as produced with frames).
Try to set the state saving method to
CLIENT and it should work correctly.
I gess it is the same problem linke
in thread HTML-Frames, one-way commandLinks and forced
frame reloads.
It is not a problem of the tree component.
What is your state saving method.
I guess it is SERVER. The current JSF 1.1 spec seems to have
problems with multiple open views (as produced with
Thats strange. Can you post the full
stack trace?
Maybe one of your beans is not serializable.
Hi Tim, it is missing the
commons-codec jar in your classpath...
That was my thought, too ;)
Well I read that JSF assumes that
all bean objects are serializable or (in some cases) implement the StateHolder
interface.
I also have to work with non serializable
objects.
You can first try to
What do you mean by not getting saved? If
you mean its not saved as
part of the state, you are correct. TreeModel is serving as
a wrapper
for the data which is stored in TreeNodes. Its kind of like
a facade
to the data - helps the user to walk the hiearchy of the
data.
The getNode method
I usually get this kind of error, when
I develop a jsp page with jsf components. State saving method is CLIENT.
I guess the problem is caused because the serialized view does not correspond
to the structure of the new page. When the work on the page is finished
and the right serialized view is
As I remember the DataTable an DataList
components does not support HashMap values. You should use a List or Array
instead.
Hi,
I wonder if it is possible to modify
the state (collapse/expand) of the tree2 on the server. I want to expand
the tree down to a node (to help the user locating the specific node).
As far as I can see, the component does not provide methods for this. You
can check if the node was expanded by
I had the same strange behaviour. I
guess it's because JSF 1.1 has some problems with multiple open views.
Try to set the state saving method to
client, it should work then.
Hope this helps.
Well I have some commandLink components
nested in a dataList, too ... but the actions are invoked correctly. Here
an example:
x:dataList id=superclasses
var=item
value=#{currentClass.directSuperclasses}
layout=simple
rowCountVar=rowCount
Well, I have found the problem AND a
solution, maybe it will fix your problems, too.
Opened a bug report: http://issues.apache.org/jira/browse/MYFACES-229
Hope this helps.
PROBLEM: Unimplemented methods
in org.apache.myfaces.custom.datalist.HtmlDataList
public void
Yes it does, but it does not use h:column
sub components to wrap the nested components and the dataTable implementation
assumes this.
Therefor the dataTable component overwrites
the processDecodes() method correctly. This is also were I got the code
from.
I guess the other methods were simply
I have a problem using the DataList
component. I would like to use input components within it, but the model
isn't updated at all. I use a List a the DataList value.
If I use a DataTable instead everything
works fine.
Is this a bug, or does the DataList
component not work with input components
74 matches
Mail list logo