You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Scott Gray (JIRA)" <ji...@apache.org> on 2009/05/22 14:46:45 UTC
[jira] Commented: (OFBIZ-2507) Sort options in form fields by their
visible description (also if localized)
[ https://issues.apache.org/jira/browse/OFBIZ-2507?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12712066#action_12712066 ]
Scott Gray commented on OFBIZ-2507:
-----------------------------------
Hi Karim
description is nothing more than an entity field name and the results would already have been sorted by that during the query if specified so there is no need to include it in your if condition. You should simply only sort if the entity-order-by attribute is false.
Also you can use Collections.sort(optionValues, new Comparator() ...
instead of putting everything into an array, sorting and pulling them back out again.
Regards
Scott
> Sort options in form fields by their visible description (also if localized)
> ----------------------------------------------------------------------------
>
> Key: OFBIZ-2507
> URL: https://issues.apache.org/jira/browse/OFBIZ-2507
> Project: OFBiz
> Issue Type: Improvement
> Components: framework
> Affects Versions: SVN trunk
> Reporter: Karim Rahimpur
> Fix For: SVN trunk
>
> Attachments: ModelFormField.java.patch
>
>
> Currently, when options are shown in drop-down fields we can use entity-order-by to sort the options by e.g. description.
> *But the order in which options appear is only valid for non-localized descriptions.*
> If we have localized descriptions we want to make sure that these also appear in order, otherwise we make it difficult for the user to find the desired option especially in drop-down fields with many options.
> Btw i consider this _major_ because for users who do not use the default language:
> - the presentation is non-standard and a usability obstacle
> - it's simply a real pain to look for an option in 'strangely-ordered' drop-downs
> *Proposed Solution*
> My proposal is to have a default ordering based on the description value of the _OptionValue_ key-description-pairs in ModelFormField.java.
> The advantage of doing this is that you get what you'd normally expect, by default, in any drop-down field without even having to tell the system to order by description. An implementation should of course respect _entity-order-by_ if present.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.