Ok I'm having a problem with an ajax call. I found this group from
the prototype homepage, but the name seems misleading. I'm not using
RoR, I'm using Java.
Here's my problem,
I'm I have a list of items that can be expanded or contracted, each
potentially has children lists, these lists are to be populated
dynamically with Ajax. When the user clicks the plus symbol, it
should expand that list. I accomplished this using Ajax.Updater. It
worked well on FF, but when I went to test it on IE, I'm having some
troubles. The Ajax is getting called, I can tell by debugging. The
Div I'm replacing gets erased, but nothing is put in it. I'm sure the
response is sent back right though because it populates the right data
in FF. In IE it just shows a blank line.
Here is some of my source:
In the calling jsp, I have only this line to load the parent:
<jsp:include flush="true" page="metlBranch.jsp"/>
---------------------------------------------------------------------------
Here is my javascript file: (case 3 is where the ajax call is made,
and I'm sure thats where its hitting cause of the alerts)
function populateChildren(parentId){
statusField = parentId + 'Status';
childDiv = parentId + 'children';
// Case one, the field is expanded
if($(statusField).value == 'expanded'){
alert('case1');
$(childDiv).style.display = 'none';
$(statusField).value = 'collapsed'
}
// Case two the field is collapsed and the data is already
populated
else if($(statusField).value == 'collapsed'){
alert('case2');
$(childDiv).style.display = '';
$(statusField).value = 'expanded';
}
// Case three, we need to get the children
else{
alert('case3');
url= "${AppPath}/metl/getBranchChildren.do?MET_ID_KEY="
+ parentId;
$(statusField).value = 'expanded';
new Ajax.Updater(childDiv, url, { method: 'post'});
}
}
----------------------------------------------------------------------------------------------------------------
Here is the Jsp that creates the list, (and is also used to create an
expanded list)
<%@ taglib prefix="c" uri="/WEB-INF/tld/c.tld" %>
<%@ page import="mil.proj.web.action.metl.ActiveMetlSearchAction" %>
<%@ taglib prefix="metl" tagdir="/WEB-INF/tags/metl" %>
<c:set var="tempTreeVo" scope="request" value ="<
%=session.getAttribute(ActiveMetlSearchAction.TREE_VO)%>"/>
<ul class="mkTree">
<c:if test="${empty tempTreeVo}">
Need to throw some kind of error
</c:if>
<c:forEach var="item" items="${tempTreeVo}">
<c:choose>
<c:when test="${item.hasSupportingMets}">
<c:set var="itemType" value="liClosed"/>
<c:set var="itemImg" value="plus"/>
</c:when>
<c:otherwise>
<c:set var="itemType" value="liBullet"/>
<c:set var="itemImg" value="bullet"/>
</c:otherwise>
</c:choose>
<li class="${itemType}"> <span id="${item.metId}node"> <img
id="$
{item.metId}img" src="/jtims/images/${itemImg}.gif"
<c:if
test="${item.hasSupportingMets}">onclick="populateChildren('$
{item.metId}')"</c:if> /></span>
<span id="${item.metId}"
onclick="highlight_row('${item.metId}')">
${item.taskNumber} ${item.taskName}
</span>
</li>
<div id="${item.metId}children"></div>
<input type="hidden" id="${item.metId}Status"/>
</c:forEach>
</ul>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---