Yup, it works perfectly.
Sorry, what do you mean by "controller code" and "property editor code" ?
I am using struts and hibernate
Aled Rhys Jones wrote:
>
> Hi Fan
>
> Does the below save ok, i.e. when you change club does it save the
> selected club? The below works for me showing the drop down list but
> not saving. Can I ask you to show some of your controller code and
> property editor code if you're using one?
>
> Thanks
> Aled
>
> Fan wrote:
>> Finally , I got it works with the following lines:
>>
>> <li>
>> <div>
>> <label class="desc"><fmt:message key="user.club"/>*</label>
>> <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}"/>"
>> <c:if test="${club.clubID eq user.club.clubID}">
>> <c:out value="selected" escapeXml="false" />
>> </c:if>
>> >
>> <c:out value="${club.clubName}" escapeXml="false" />
>> </option>
>> </c:forEach>
>> </c:if>
>> </select>
>> </div>
>> </li>
>>
>>
>> Please make sure the name and Id of the dropdown list matches the
>> property
>> in your POJO.
>>
>> You could try to debug at the service layer(Action class) to check if the
>> value is submitted to the action class.
>>
>>
>> Aled Rhys Jones wrote:
>>
>>> What about:
>>>
>>> <c:if test="${user.club.clubID==club.clubID}">SELECTED</c:if>>
>>>
>>> Lemme know if it works, been having trouble getting drop-down lists
>>> working myself.
>>> My issue is that the drop down list appears, and the correct value
>>> selected, but saving doesn't work.
>>>
>>> Cheers
>>> Aled
>>>
>>>
>>> Fan wrote:
>>>
>>>> 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 !!
>>>>
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>>
>>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
--
View this message in context:
http://www.nabble.com/%3Cc%3Aif-test%3E-tf4044675s2369.html#a11494670
Sent from the AppFuse - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]