wood burning stoves
The moose likes Struts and the fly likes Struts Dojo Tree disappears on page reload Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts Dojo Tree disappears on page reload" Watch "Struts Dojo Tree disappears on page reload" New topic
Author

Struts Dojo Tree disappears on page reload

Rizwan Merchant
Greenhorn

Joined: Oct 19, 2011
Posts: 1
Hi all,
Hope someone can help me with this issue. I am stuck and clueless!

I have 2 JSPs:
genInvoice.jsp
unbilledshipments.jsp

The genInvoice.jsp includes the second jsp via the s:include tag
There is a ajax call in the geninvoice.jsp that refreshes the div containing the second jsp (unbilledshipments.jsp)

The second jsp contains a display table which contains a column that generates a tree (so each row has 1 tree). The tree loads correctly on the first load of genInvoice.jsp, but when I try to refresh the div containing unbilledshipments.jsp through a ajax search, the tree disappears! I suspect it has something to do with the struts dojo head tag (sx:head) but I have tried everything!!

HELP!!

--------genInvoice.jsp-------------------------------

<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<%@ taglib prefix="mmr" uri="/mmr-tags" %>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>


<html>
<head>
<sj:head jqueryui="true" />
<sx:head cache="true" debug="true"/>
<title></title>
</head>
<body>

<div id="messages">
<jsp:include page="../common/action_messages.jsp"/>
</div>

<div class="form-container">
<s:form action="invoice.create" id="generateInvoiceForm">
<fieldset>
<legend>Generate Invoices</legend>
<div class="text_01">
<table width="100%">
<tr>
<td><mmr:message messageId="label.customer.name" />: </td>
<s:url id="customerList" action="listCustomers" />
<td><sx:autocompleter value="%{invoice.customer.name}" keyName="invoice.customerId" name="searchString" href="%{customerList}" dataFieldName="customerSearchResult" loadOnTextChange="true" loadMinimumCount="3"/></td>
</tr>
</table>
</div>
<div class="text_01">
<s:url id="searchOrders" value="invoiceable.list.action"/>
<sj:submit
id="formSubmit2"
href="%{searchOrders}"
targets="formResult"
value="Search"
indicator="indicator"
button="true"
/>
<s:url id="createInvoice" value="invoice.create.action"/>
<sj:submit
id="formSubmit3"
targets="formResult"
href="%{createInvoice}"
value="Bill Selected"
indicator="indicator"
button="true"
/>
</div>

</fieldset>
<div id="formResult">
<s:include value="unbilledShipments.jsp"></s:include>
</div>
</s:form>
</div>

</body>
</html>

----------------unbilledShipments.jsp---------
<%@ taglib uri="http://displaytag.sf.net" prefix="display" %>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>


<div id="bottom_table_New_rate" class="text_01">
<div>

<display:table id="ordersTable" name="orders" export="false" uid="row" pagesize="100" sort="list" requestURI="invoiceable.list.action?type=refresh" >

<display:setProperty name="paging.banner.items_name" value=""></display:setProperty>
<display:setProperty name="paging.banner.some_items_found" value=""/>
<display:setProperty name="paging.banner.all_items_found" value=""></display:setProperty>
<display:setProperty name="paging.banner.placement" value="bottom"></display:setProperty>
<display:setProperty name="paging.banner.group_size" value="3"></display:setProperty>

<display:column title="" >
<s:hidden name="selectedOrders[%{#attr.row_rowNum - 1}].id" value="%{#attr.row.id}"/>
<s:checkbox name="select[%{#attr.row_rowNum - 1}]" value="select[%{#attr.row_rowNum - 1}]" />
</display:column>
<display:column class="text_01" property="customer.name" sortable="true" title="Company" />
<display:column class="text_01" property="id" sortable="true" title="Order #" />
<display:column class="text_01" property="dateCreated" sortable="true" title="Date Created" />

<display:column title="Charges" >
<sx:tree label="Total" >
<s:iterator value="%{orders[#attr.row_rowNum-1].charges}">
<sx:treenode label="%{name} : %{charge}" />
</s:iterator >
</sx:tree>
</display:column>


<s:if test="%{customer!=null}">
<display:caption>Unbilled shipments for customer: <s:text name="%{customer.name}"/></display:caption>
</s:if>
<s:else>
<display:caption>Unbilled shipments for all customers</display:caption>
</s:else>


</display:table>
</div>
</div>


Sunil Sunny
Ranch Hand

Joined: Oct 18, 2011
Posts: 41
i think it is your browser's javascript problem. have you tried it on some another browser than you are trying on.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Struts Dojo Tree disappears on page reload
 
jQuery in Action, 3rd edition