aspose file tools*
The moose likes Struts and the fly likes dynamically generated buttons within nested jsp pages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "dynamically generated buttons within nested jsp pages" Watch "dynamically generated buttons within nested jsp pages" New topic
Author

dynamically generated buttons within nested jsp pages

Jason Alterbon
Greenhorn

Joined: Dec 13, 2004
Posts: 3
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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: dynamically generated buttons within nested jsp pages
 
Similar Threads
Topic: finding selected record of nested:iterate using nested:form
problems with form
finding selected record of nested:iterate using nested:form
Problems with select
Topic: finding selected record of nested:iterate using nested:form