Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

dynamically generated buttons within nested jsp pages

 
Jason Alterbon
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
k so heres the deal: I am making a tree structure to represent a data structure and I need a way to put details buttons on each of the nodes on the tree structure so the user can click and a subsection of the page can populate with the details of the node. What I am having trouble with is using the buttons generated according to the nodes how do I know which button has been pressed. each of the nodes is uniquely identified by a variable "dn". i have an action that handles the button clicks:
public ActionForward execute( ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)

{
//do something here???
return(mapping.findForward("input"));
}

the base jsp page:

&<;/head>
&<;body bgcolor="#FFFFFF">
&<;nested:form action="/showLdap.do">

&<;nested:write property="beanName" />
&<;br>
&<;nested:nest property="Tree" >
&<;jsp:include page="node.jsp" />
&<;/nested:nest>
&<;/nested:form>
&<;/body>
&<;/html>




node.jsp there is some javascript functions for hiding and showing the subtree just ignore it)



&<;%@page contentType="text/html"%>
&<;%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>
&<;%@ taglib uri="/WEB-INF/struts-html-el.tld" prefix="html" %>

&<;nested:root>

&<;nested:equal property="hasChildren" value="true">
&<;div class="trigger" onC1ick="showBranch('&<;nested:write property="dn" />');swapFolder('&<;nested:write property="dn" />folder')">
&<;img src="gfx/km_plus.gif" border="0" id="&<;nested:write property="dn" />folder">
&<;nested:equal property="hasErrorInSubtree" value="true">
&<;img src="gfx/Error.gif">
&<;/nested:equal>
&<;nested:equal property="isError" value="true">
&<;img src="gfx/image.gif">
&<;/nested:equal>
&<;nested:write property="nodeName" />

&<;/div>
&<;nested:submit>Details&<;/nested:submit>
&<;br>
&<;span class="branch" id="&<;nested:write property="dn"/>">



&<;nested:iterate property="childCollection">
&<;jsp:include page="node.jsp"/>
&<;/nested:iterate>
&<;/span>
&<;/nested:equal>

&<;nested:equal property="hasChildren" value="false">

&<;img src="gfx/km_empty.gif">
&<;nested:equal property="hasErrorInSubtree" value="true">
&<;img src="gfx/Error.gif">
&<;/nested:equal>
&<;nested:write property="nodeName" />
&<;nested:submit>Details&<;/nested:submit>
&<;br>

&<;/nested:equal>

&<;/nested:root>
[ December 14, 2004: Message edited by: Jason Alterbon ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic