How about just FacesContext.addmessage("The selected item no longer
exists."). Then the end user can display the message or not. Just because
one branch or leaf was deleted doesn't mean the tree is gone (and even it it
was that's a use case). The above is way to handle errors recommended in the
J2EE Tutorial JSF chapters.

I have to read up on bundles but I'd think there was a way to add a message
as a key so an end user can just put it in their bundle and get a custom
message out.

The reason that I encountered it is that I wrote example code that randomly
generates the tree every time the page loads so I could test whether or not
the tree would survive in my actual application.

Rob


----- Original Message ----- 
From: "Sean Schofield" <[EMAIL PROTECTED]>
To: "MyFaces Discussion" <[email protected]>
Sent: Thursday, March 31, 2005 11:31 PM
Subject: Re: tree2 deleted nodes


> This is a known limitation.  Please add an issue to JIRA for us so we
> can keep track of it.  I was always aware of the possibility of this
> happening but I'm suprised you encountered it so easily.  How did the
> node get deleted in such a short time?
>
> I agree though that we should handle this more gracefully although I'm
> not sure the best course.  One idea is to preserve the data model
> between requests and only update it after the action events have been
> processed (similar to preserveDataModel in x:dataTable.)  In your
> case, however, you've got the 90,000+ nodes so I doubt you'd like to
> do that.
>
> Perhaps a warning and then skip any subsequent event processing is the
> way to go.  Let me think on it some.
>
> sean
>
> On Mar 31, 2005 11:55 AM, Rob Decker <[EMAIL PROTECTED]> wrote:
> > If a node gets deleted between the time it is clicked on and when the
server processes
> > the request I get this error:
> >
> > java.lang.IllegalArgumentException: Node with id 0:1:1. Failed to parse
0:1:1
> >
> > Basically the node's child was deleted and the index of the child list
is no longer
> > valid. It was valid when the tree was displayed. This gets thrown from
> > TreeModel.getNodeById() when an IndexOutOfBoundsException is thrown by
the child list.
> >
> > I'd like to handle this in a more graceful manner. Is it possible to
just set a
> > message that uses an application message tag I can set in my app's
Messages.properties?
> >
> > --
> > Rob
> >
> > @objectsource.org
> >
> >

Reply via email to