You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Brian Hart <BH...@MAIL.NYSED.GOV> on 2003/03/05 17:03:47 UTC

Using a TreeModel for Menu State - Best Practice to send state changes via Struts

The TreeModel interface and DefaultTreeModel implementation of the JDK provide the necessary functionality to manage the state of a tree which will be managed in a set of database tables.  We will be rendering the state of the tree in HTML.  My question is how to build the HTML links to correctly communicate which link is clicked in Struts 1.1 RC1.  I picture a single Action class, something like MenuAction that would then get a set of parameters indicating the node clicked and then delegate to the business object to update the TreeModel accordingly.  Much of the documentation is about using ActionForms to pass information to the Struts Action.  Without A Formbean how does one correctly use the action attribute of the <html:link> tag in struts 1.1?

<html:link action="/menu?menuID=20&content_id=30">Arts</html:link>
<html:link action="/menu?menuID=10&content_id=30">English</html:link>

Tree could be something like:
Arts
  Music
    Learning Experiences
  Theature
    Best Practices 
ELA
  Learning Experiences
  Best Practices

RE: Using a TreeModel for Menu State - Best Practice to send statechanges via Struts

Posted by BaTien Duong <ba...@dbgroups.com>.
This is what we are waiting for in Java Server Faces to bring server side
action to rich client side interface with easy to use Tags.

BaTien
==========================

-----Original Message-----
From: Brian Hart [mailto:BHART2@MAIL.NYSED.GOV]
Sent: Wednesday, March 05, 2003 9:04 AM
To: struts-user@jakarta.apache.org
Subject: Using a TreeModel for Menu State - Best Practice to send
statechanges via Struts


The TreeModel interface and DefaultTreeModel implementation of the JDK
provide the necessary functionality to manage the state of a tree which will
be managed in a set of database tables.  We will be rendering the state of
the tree in HTML.  My question is how to build the HTML links to correctly
communicate which link is clicked in Struts 1.1 RC1.  I picture a single
Action class, something like MenuAction that would then get a set of
parameters indicating the node clicked and then delegate to the business
object to update the TreeModel accordingly.  Much of the documentation is
about using ActionForms to pass information to the Struts Action.  Without A
Formbean how does one correctly use the action attribute of the <html:link>
tag in struts 1.1?

<html:link action="/menu?menuID=20&content_id=30">Arts</html:link>
<html:link action="/menu?menuID=10&content_id=30">English</html:link>

Tree could be something like:
Arts
  Music
    Learning Experiences
  Theature
    Best Practices
ELA
  Learning Experiences
  Best Practices


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