You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Guido Amarilla <ga...@gmail.com> on 2007/03/14 23:21:29 UTC

Dropdown Lists Ordering

In Party Manager application, in Find Party screen the DropDown to
select a party role are ordered in ascending alphabetical order, but
only when English language is selected. In other languages the order
is still based in the English entity descriptions.
The same happens in other screens with this dropdown and with others.

In this case I see that the list is being ordered in
PartyServices.java  public static Map findParty(DispatchContext dctx,
Map context) but at this stage the list values aren´t translated yet.

Is there another list ordering command I could use that orders the
lists AFTER being translated.

Thank you in advance.

-- 
Guido Amarilla

Re: Dropdown Lists Ordering

Posted by Guido Amarilla <ga...@gmail.com>.
Daniel,
Thank you for your answer.
Many of the lists are created like this one:

<option value="ANY">${uiLabelMap.CommonAnyRoleType}</option>
<#list roleTypes as roleType>
<option value="${roleType.roleTypeId}">${roleType.get
("description",locale)}</option>
</#list>

So even...
      <#list roleTypes?sort_by("description") as roleType>
...won´t work.

- How can I forge a new list inside freemarker, in order to iterate the
original list and create a new list with the translated lists and then use
sort_by to sort it and then create the select's options ?

Guido

2007/3/15, Daniel Martínez <da...@paradisosistemas.es>:
>
> Guido,
>
> The descriptions are translated in the view model::
>
> - <drop-down/> widget directive does not have an "order-by" directive .
> I don't know if it would be possible to have one (haven't look at the
> implementation).
> - Another possible workaround would be to define a freemarker macro that
> would sort it
> - Most probably the new integrated DOJO technology will be useful for
> this too.
>
> I also see that ordering in the ofbiz logical/data layer is not a best
> practice way of sorting lists as this is a role for the view layer
>
> I appreciate the translating work done in ofbiz, but it needs further
> going. Another example is viewing/selection of dates and timestamps in
> local format (which I think would be nice for english-speaking users too.)
>
> Guido Amarilla escribió:
> > In Party Manager application, in Find Party screen the DropDown to
> > select a party role are ordered in ascending alphabetical order, but
> > only when English language is selected. In other languages the order
> > is still based in the English entity descriptions.
> > The same happens in other screens with this dropdown and with others.
> >
> > In this case I see that the list is being ordered in
> > PartyServices.java  public static Map findParty(DispatchContext dctx,
> > Map context) but at this stage the list values aren´t translated yet.
> >
> > Is there another list ordering command I could use that orders the
> > lists AFTER being translated.
> >
> > Thank you in advance.
> >
>
> --
> ------------------------------------------------------------------------
> Soluciones de Gestión para su empresa
> eBusiness, ERP, CRM
> ------------------------------------------------------------------------
> *Daniel Martínez Martínez*
> * *
> Director de Proyectos
> C/ Julia García Boután, 29  D 3ºB
> 28022 Madrid
> España  * *
>         E-mail: daniel.martinez@paradisosistemas.es
> <mailto:daniel.martinez@paradisosistemas.es >
> Web: *www.paradisosistemas.es <http://www.paradisosistemas.es>
> *Comercial: info@paradisosistemas.es <ma...@paradisosistemas.es>
> Tel: 678416758
>
>
>

Re: Dropdown Lists Ordering

Posted by Daniel Martínez <da...@paradisosistemas.es>.
Guido,

The descriptions are translated in the view model::

- <drop-down/> widget directive does not have an "order-by" directive .
I don't know if it would be possible to have one (haven't look at the
implementation).
- Another possible workaround would be to define a freemarker macro that
would sort it
- Most probably the new integrated DOJO technology will be useful for
this too.

I also see that ordering in the ofbiz logical/data layer is not a best
practice way of sorting lists as this is a role for the view layer

I appreciate the translating work done in ofbiz, but it needs further
going. Another example is viewing/selection of dates and timestamps in
local format (which I think would be nice for english-speaking users too.)

Guido Amarilla escribió:
> In Party Manager application, in Find Party screen the DropDown to
> select a party role are ordered in ascending alphabetical order, but
> only when English language is selected. In other languages the order
> is still based in the English entity descriptions.
> The same happens in other screens with this dropdown and with others.
>
> In this case I see that the list is being ordered in
> PartyServices.java  public static Map findParty(DispatchContext dctx,
> Map context) but at this stage the list values aren´t translated yet.
>
> Is there another list ordering command I could use that orders the
> lists AFTER being translated.
>
> Thank you in advance.
>

-- 
------------------------------------------------------------------------
Soluciones de Gestión para su empresa
eBusiness, ERP, CRM
------------------------------------------------------------------------
*Daniel Martínez Martínez*
* *
Director de Proyectos
C/ Julia García Boután, 29  D 3ºB
28022 Madrid
España 	* *
	E-mail: daniel.martinez@paradisosistemas.es
<ma...@paradisosistemas.es>
Web: *www.paradisosistemas.es <http://www.paradisosistemas.es>
*Comercial: info@paradisosistemas.es <ma...@paradisosistemas.es>
Tel: 678416758