2013-07-09 19 views
2

我想插入來自AJAX(XmlHttp)的數據,並且在插入後,我需要將所有數據恢復回顯示在fancybox彈出窗口中。我有下面的代碼,在一個jsp頁面中,並使用它來創建一個jstl變量。在jsp中更新數據列表

`<c:set var="List_of_OrderSet" value="${orderSetList}" scope="session" ></c:set>` 

scope="session" 這是否意味着我能得到這個列表中的任何頁面?

<table style="width: 1400px;" cellpadding="0" cellspacing="0" border="0" class="display" id="orderSet"> 
        <thead> 
         <tr> 
          <th></th> 
          <th>Sr</th> 
          <th>Order Date</th> 
          <th>Service Name</th> 
          <th>Quantity</th> 
          <th>IsExternal</th> 
          <th>Care Professional</th> 
          <th>Remarks</th> 
         </tr> 
        </thead> 
        <tbody > 
         <c:if test="${! empty List_of_OrderSet}"> 
          <c:forEach var="complaint" items="${List_of_OrderSet}"> 

           <c:choose> 
            <c:when test="${complaint.orderStatus ne 'true' }"> 
             <tr class="gradeX" style="color: red;" > 
              <td width="10px;"><input type="radio" name="btnRadio" id="btnRadio" value="${complaint.patientOrderSetIDP},${complaint.createdByIDF},${complaint.lastModifiedByIDF},${complaint.orderStatus}" onclick="editOrderSet('OrderSetEdit',this.value)" /></td> 
              <td width="20px;"><%=count++ %> </td> 
              <td width="80px;" ><c:out value="${complaint.orderDate}"></c:out></td> 
              <td ><c:out value="${complaint.serviceName}"></c:out></td> 
              <td ><c:out value="${complaint.quantity}"></c:out></td> 
              <td > 
               <c:choose> 
                <c:when test="${complaint.isExternal eq true}"> 
                 <c:out value="Yes"></c:out> 
                </c:when> 
                <c:otherwise> 
                 <c:out value="No"></c:out> 
                </c:otherwise> 
               </c:choose> </td> 
              <!-- 
              <td ><c:set var="IsExternal" value="${complaint.isExternal}"></c:set> 
               <% if(pageContext.getAttribute("IsExternal").equals(true)) { %>Yes<% } 
               else { %>No<% } %> 
              </td> 
              --> 
              <td ><c:out value="${complaint.careProfessionalName}"></c:out></td> 
              <td width="280px;" ><c:out value="${complaint.remarks}"></c:out></td> 
             </tr> 
            </c:when> 
            <c:otherwise> 
             <tr class="gradeX"> 
             <td width="10px;"><input type="radio" name="btnRadio" id="btnRadio" value="${complaint.patientOrderSetIDP},${complaint.createdByIDF},${complaint.lastModifiedByIDF},${complaint.orderStatus}" onclick="editOrderSet('OrderSetEdit',this.value)" /></td> 
             <td width="20px;"><%=count++ %> </td> 
             <td width="80px;" ><c:out value="${complaint.orderDate}"></c:out></td> 
             <td ><c:out value="${complaint.serviceName}"></c:out></td> 
             <td ><c:out value="${complaint.quantity}"></c:out></td> 
             <td > 
              <c:choose> 
               <c:when test="${complaint.isExternal eq true}"> 
                <c:out value="Yes"></c:out> 
               </c:when> 
               <c:otherwise> 
                <c:out value="No"></c:out> 
               </c:otherwise> 
              </c:choose> </td> 
             <!-- 
             <td ><c:set var="IsExternal" value="${complaint.isExternal}"></c:set> 
              <% if(pageContext.getAttribute("IsExternal").equals(true)) { %>Yes<% } 
              else { %>No<% } %> 
             </td> 
             --> 
             <td ><c:out value="${complaint.careProfessionalName}"></c:out></td> 
             <td width="280px;" ><c:out value="${complaint.remarks}"></c:out></td> 
            </tr> 
            </c:otherwise> 
           </c:choose> 

          </c:forEach> 
         </c:if> 
        </tbody> 
       </table> 

該列表顯示正確,但插入後未更新。我需要製作並刷新<div>嗎?還有其他選擇嗎?

回答

0

嘗試這個JavaScript函數..

$('#divID').load('your.jsp').fadeIn("slow"); 
+0

但加載新的JSP文件引起的fancybox關閉的問題。 – Youddh