kellybaz 0 Newbie Poster

I am working on a project. Here is some background:

I am working on a page that lists people and their training info. The training info is an expansion box listed underneath each person. I am trying to have the expansion box automatically open on page load if their training is expired, expiring, or not complete. Each person can have more than one training course listed. So I am doing a check to see if any of the flags are set, and if so will expand the box. Problem is cookies are not being set correctly for the 'effct.blindDown' function.

Here is my code:

<%--Checks personnel--%>
<c:forEach var="selPersonnel" items="${command.otherPHSPersonnel}" varStatus="curIndex">
<c:forEach var="training" items="${selPersonnel.training}" varStatus="curCourse">

<c:if test="${fn:contains(training.completionStatus, 'Not') || fn:contains(training.completionStatus, 'Expired') || ! empty training.expiringIndicator}">
new Effect.BlindDown('spnOtherInfo${curIndex.index}_0');
Cookie.set('spnOtherInfo${curIndex.index}_0' +'_visibility', 'show');
</c:if>

</c:forEach>
</c:forEach>

But what is happening, If the user goes in and changes the training information for the last course in the list from expired to 'complete,' the cookie is still set to show- and upon page refresh, the complete course is displayed, which should be hidden. And if I code it such that I set the cookie to hide if the condition is not satisfied, then if the last course on the list is complete, then the cookie is set to hide, and any courses above that in the list that are not complete wont be expanded.

Any ideas?

Thank you =)