struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Affan Qureshi" <quere...@etilize.com>
Subject theKB Example (prev: Complicated Web Interfaces?)
Date Fri, 29 Nov 2002 03:34:10 GMT
Nested Tags really helped me in achieving what I had nightmares trying to
accomplish otherwise. I have something similar to what we have at
http://www.keyboardmonkey.com/StrutMonkey/MonkeyStruts_v2.jsp
but in my case the Adding/Deleting object (corresponding to BunchBean ) is
pretty dynaimc i.e you dont know in advance the properties of the
BananaBean. However it works pretty sweet.

The problem is screen refresh. If I delete a node and click Refresh then
there is an ArrayIndexOutOfBoundsException because the request is resent to
delete a node that is already deleted. I have disabled the user to delete
the last Banana (i.e the user should not be able to delete the last Banana).
But the refresh problem I dont get. In the example it just deletes the last
Banana if I refresh until all bananas are gone. But at least it does not
show an exception.

I have even tried to catch and ignore the error at the
Action/RequestProcessor but it did not work too well. (Maybe i did not
implement it correctly).

Has anybody come across this?

Thanks for a great example.

----- Original Message -----
From: "Arron Bates" <struts-user@keyboardmonkey.com>
To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
Sent: Thursday, November 28, 2002 6:06 PM
Subject: Re: Complicated Web Interfaces?


> > > I've also looked at the monkey-struts example as well but that seems
to
> > > lack the
> > > creation of objects in these lists, which doesn't look to be a problem
> > > to implement
> > > but that might be an oversight on my part : ) please let me know if
I'm
> > > wrong.
>
> Have another play, click on "new banana"... :)
>
> http://www.keyboardmonkey.com/StrutMonkey/MonkeyStruts_v2.jsp
>
>
> > KB-Monkey-example uses a fixed object model (i.e it knows what fields
are
> > there in each object). However I think if you want the tree to be
dynamic
> > you can use the same technique with your own object model (which seems
to be
> > dynamic in content). The key to adding and deleting the nodes is the way
the
> > button clicks of "Add" and "Delete" are handled in a nested environment.
> > Nested tags enable you to remember the context of added and deleted
> > objects/nodes. You can use Map-backed properties for dynamic
form-fields.
> >
> > But one issue with the monkey example is that it refreshes the page if I
> > want to add/delete an object/node. Wouldn't it be more efficient to use
> > JavaScript for the purpose? I mean why resend the request back to the
server
> > if you only want to add "blank" fields? If anybody has accomplished this
I
> > would be glad to know.
>
> It's all up to watever you want to code. The fact that the monkey
> example trips to the server has nothing to do with the nested tags.
>
> To write the monkey example in Struts without the nested tags is verging
> on impossible, at the very least a truly large headache, it was really
> quite easy.
>
> If the nested tags are guilty of anything, they make it very easy (and
> even fun?... maybe I'm wired differently) to add more and more
> complexity to the structure. The nested tags have made some truly
> unwieldy applications, including the reason for their creation.
>
> You just have to ask yourself one question...
> Red or Blue pill?  :P
>
>
> Arron.
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message