I have a dropdown with a list of club POJO:

<c:set var="clublist" value="${availableClubs}" scope="request"/>    
    <select name="user.club.clubID" id="user.club.clubID">
    <c:if test="${clublist != null}">
        <c:forEach var="club" items="${clublist}" varStatus="status">
            <option value="<c:out value="${club.clubID}"/>"
            
            //if club.clubID equals user.club.clubID then selected

            >
                <c:out value="${club.clubName}" escapeXml="false" />
            </option>
        </c:forEach>
    </c:if>
    </select>


My problem is , what's the syntaxfor checking if club.clubID equals
user.club.clubID then set the "selected"  
for the option.

I have tried the following ways, but both also did not work, 

<c:if test="${club.clubID.equals(${user.club.clubID})}">
    <c:out value="selected" escapeXml="false" />
</c:if>


<c:if test="${club.clubID.equals(user.club.clubID)}">
    <c:out value="selected" escapeXml="false" />
</c:if>

please give your valuable advice if you know the trick, thank you !!

-- 
View this message in context: 
http://www.nabble.com/%3Cc%3Aif-test%3E-tf4044675s2369.html#a11489169
Sent from the AppFuse - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to