File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts Dojo Tree disappears on page reload" Watch "Struts Dojo Tree disappears on page reload" New topic

Struts Dojo Tree disappears on page reload

Rizwan Merchant

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:

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!!



<%@ 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" %>

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

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

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

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


<%@ taglib uri="" 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">

<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="%{}"/>
<s:checkbox name="select[%{#attr.row_rowNum - 1}]" value="select[%{#attr.row_rowNum - 1}]" />
<display:column class="text_01" property="" 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 >

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


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 agree. Here's the link:
subject: Struts Dojo Tree disappears on page reload
It's not a secret anymore!