Hi,
Thanks for the reply.
I tried this,but i am getting following exception in testcases.

java.lang.ClassCastException: au.com.suncorp.model.Webappssystem
        at org.appfuse.model.LabelValue$1.compare(LabelValue.java:25)
        at java.util.Arrays.mergeSort(Arrays.java:1284)

I am implementing  Comparable interface in Webappssystem class.




mraible wrote:
> 
> Are you Webappssystem objects LabelValue objects?  You might want to
> consider tranlating them into them and then using
> LabelValue.CASE_INSENSITIVE_ORDER as the comparator (2nd argument in
> Collections.sort()).
> 
> http://static.appfuse.org/appfuse-data-common/xref/org/appfuse/model/LabelValue.html
> 
> This is what's done in LookupManagerImpl.java:
> 
> http://static.appfuse.org/appfuse-service/xref/org/appfuse/service/impl/LookupManagerImpl.html
> 
> Matt
> 
> On 7/17/07, Msarda <[EMAIL PROTECTED]> wrote:
>>
>> Hi,
>>
>> I am doing as following
>>
>> protected Map referenceData(HttpServletRequest request) throws Exception
>> {
>>         Map model = new HashMap();
>>         List<Webappssystem> webSystemImpacted =
>> webappssystemManager.getAll();
>>         Collections.sort(webSystemImpacted);
>>         model.put("webSystemImpacted",webSystemImpacted);
>>         model.put("areas",areasimpactedManager.getAll());
>>         return model;
>>     }
>>
>> But still "webSystemImpacted" in not sorted.:(
>>
>>
>> mraible wrote:
>> >
>> > You should sort your list with your HQL query, or use
>> > Collections.sort() to sort the list.
>> >
>> > Matt
>> >
>> > On 7/17/07, Msarda <[EMAIL PROTECTED]> wrote:
>> >>
>> >> Hi all,
>> >>
>> >> I want to sort the drop down before displaying it on jsp.
>> >> I am using following in jsp to populate drop dowm list.
>> >>
>> >> <appfuse:label styleClass="desc" key="engagementform.systems"/>
>> >>                 <select name="systems" multiple="true">
>> >>                 <c:forEach var="system" items="${webSystemImpacted}">
>> >>                 <option value="<c:out value="${system.id}"/>"
>> <c:forEach
>> >> var="sys"
>> >> items="${engagementform.systems}">
>> >>         <c:if test="${sys.id==system.id}">SELECTED</c:if>
>> >>         </c:forEach>
>> >>         ><c:out value="${system.name}"/></option>
>> >>         </c:forEach>
>> >>                 </select>
>> >>
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/How-to-alphabetically-sort-drop-down-list-before-displaying-on-jsp-tf4100323s2369.html#a11660394
>> >> Sent from the AppFuse - User mailing list archive at Nabble.com.
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >> For additional commands, e-mail: [EMAIL PROTECTED]
>> >>
>> >>
>> >
>> >
>> > --
>> > http://raibledesigns.com
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >
>> >
>> >
>>
>> --
>>
>> View this message in context:
>> http://www.nabble.com/How-to-alphabetically-sort-drop-down-list-before-displaying-on-jsp-tf4100323s2369.html#a11661211
>>
>> Sent from the AppFuse - User mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 
> -- 
> http://raibledesigns.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-alphabetically-sort-drop-down-list-before-displaying-on-jsp-tf4100323s2369.html#a11662378
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