You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Bruyn Bill <Br...@mcao.maricopa.gov> on 2006/01/31 22:56:49 UTC
selectionList sort order
I have a multivaluefield with a selection list, bound with some
fb:javascript. The contents of the list are sorted the way I want them
when I obtain the list, but are rendered differently. Snippet follows:
<fb:javascript id="languages" path="languages" direction="load">
<fb:load-form>
var list = facade.getListOptions(Language.LIST_NAME);
for(var i = list.iterator(); i.hasNext();) {
print(i.next().getOptionLong());
}
/* yields the following, as desired:
English
ASL or other assistance for hearing impaired
Achumaw
*/
widget.setSelectionList(list, "id", "optionLong");
/* but is rendered in the following order:
ASL or other assistance for hearing impaired
Achumaw
English
*/
</fb:load-form>
</fb:javascript>
Anybody know offhand where/why this is happening and how to stop it?
Thanks in advance.
Thanks,
Bill Bruyn
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
RE: selectionList sort order
Posted by Bruyn Bill <Br...@mcao.maricopa.gov>.
Yes, that's it exactly. Lemme take look at that JS and see what I can do.
Thanks, Bruno!
________________________________
From: Bruno Dumon [mailto:bruno@outerthought.org]
Sent: Wed 2/1/2006 12:10 PM
To: users@cocoon.apache.org
Subject: RE: selectionList sort order
What styling option do you use for the multivaluefield?
Maybe the double-listbox styling? In that case the options are indeed
sorted, by the client-side javascript, since otherwise it wouldn't know
where to put the items as they are moved from one listbox to the other
(unless it would remember the original list, which is not impossible but
requires some additional implementation effort).
The other stylings (listbox, checkboxes) do not reorder items AFAICS.
On Wed, 2006-02-01 at 11:48 -0700, Bruyn Bill wrote:
> Is the problem statement clear? Is this the intended behavior, or am
> I doing something wrong? I scanned the source and didn't see anything
> obvious. FWIW, here is the widget definition (not much to it):
>
> <fd:multivaluefield id="languages">
> <fd:label>Languages</fd:label>
> <fd:datatype base="integer" />
> <fd:selection-list />
> </fd:multivaluefield>
>
> BTW, the list contains some ListOption objects, whose method getId
> returns a java.lang.Integer and getOptionLong returns a
> java.lang.String.
>
> Thanks again for your time.
>
>
> Bill
>
> ________________________________
>
> From: Bruyn Bill [mailto:Bruynb@mcao.maricopa.gov]
> Sent: Tue 1/31/2006 2:56 PM
> To: users@cocoon.apache.org
> Subject: selectionList sort order
>
>
>
> I have a multivaluefield with a selection list, bound with some
> fb:javascript. The contents of the list are sorted the way I want them
> when I obtain the list, but are rendered differently. Snippet follows:
>
> <fb:javascript id="languages" path="languages" direction="load">
> <fb:load-form>
>
> var list = facade.getListOptions(Language.LIST_NAME);
> for(var i = list.iterator(); i.hasNext();) {
> print(i.next().getOptionLong());
> }
>
> /* yields the following, as desired:
>
> English
> ASL or other assistance for hearing impaired
> Achumaw
> */
>
> widget.setSelectionList(list, "id", "optionLong");
>
> /* but is rendered in the following order:
>
> ASL or other assistance for hearing impaired
> Achumaw
> English
> */
>
> </fb:load-form>
> </fb:javascript>
>
>
> Anybody know offhand where/why this is happening and how to stop it?
> Thanks in advance.
>
>
> Thanks,
>
> Bill Bruyn
--
Bruno Dumon http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org bruno@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
RE: selectionList sort order
Posted by Bruno Dumon <br...@outerthought.org>.
What styling option do you use for the multivaluefield?
Maybe the double-listbox styling? In that case the options are indeed
sorted, by the client-side javascript, since otherwise it wouldn't know
where to put the items as they are moved from one listbox to the other
(unless it would remember the original list, which is not impossible but
requires some additional implementation effort).
The other stylings (listbox, checkboxes) do not reorder items AFAICS.
On Wed, 2006-02-01 at 11:48 -0700, Bruyn Bill wrote:
> Is the problem statement clear? Is this the intended behavior, or am
> I doing something wrong? I scanned the source and didn't see anything
> obvious. FWIW, here is the widget definition (not much to it):
>
> <fd:multivaluefield id="languages">
> <fd:label>Languages</fd:label>
> <fd:datatype base="integer" />
> <fd:selection-list />
> </fd:multivaluefield>
>
> BTW, the list contains some ListOption objects, whose method getId
> returns a java.lang.Integer and getOptionLong returns a
> java.lang.String.
>
> Thanks again for your time.
>
>
> Bill
>
> ________________________________
>
> From: Bruyn Bill [mailto:Bruynb@mcao.maricopa.gov]
> Sent: Tue 1/31/2006 2:56 PM
> To: users@cocoon.apache.org
> Subject: selectionList sort order
>
>
>
> I have a multivaluefield with a selection list, bound with some
> fb:javascript. The contents of the list are sorted the way I want them
> when I obtain the list, but are rendered differently. Snippet follows:
>
> <fb:javascript id="languages" path="languages" direction="load">
> <fb:load-form>
>
> var list = facade.getListOptions(Language.LIST_NAME);
> for(var i = list.iterator(); i.hasNext();) {
> print(i.next().getOptionLong());
> }
>
> /* yields the following, as desired:
>
> English
> ASL or other assistance for hearing impaired
> Achumaw
> */
>
> widget.setSelectionList(list, "id", "optionLong");
>
> /* but is rendered in the following order:
>
> ASL or other assistance for hearing impaired
> Achumaw
> English
> */
>
> </fb:load-form>
> </fb:javascript>
>
>
> Anybody know offhand where/why this is happening and how to stop it?
> Thanks in advance.
>
>
> Thanks,
>
> Bill Bruyn
--
Bruno Dumon http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org bruno@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
RE: selectionList sort order
Posted by Bruyn Bill <Br...@mcao.maricopa.gov>.
Is the problem statement clear? Is this the intended behavior, or am I doing something wrong? I scanned the source and didn't see anything obvious. FWIW, here is the widget definition (not much to it):
<fd:multivaluefield id="languages">
<fd:label>Languages</fd:label>
<fd:datatype base="integer" />
<fd:selection-list />
</fd:multivaluefield>
BTW, the list contains some ListOption objects, whose method getId returns a java.lang.Integer and getOptionLong returns a java.lang.String.
Thanks again for your time.
Bill
________________________________
From: Bruyn Bill [mailto:Bruynb@mcao.maricopa.gov]
Sent: Tue 1/31/2006 2:56 PM
To: users@cocoon.apache.org
Subject: selectionList sort order
I have a multivaluefield with a selection list, bound with some
fb:javascript. The contents of the list are sorted the way I want them
when I obtain the list, but are rendered differently. Snippet follows:
<fb:javascript id="languages" path="languages" direction="load">
<fb:load-form>
var list = facade.getListOptions(Language.LIST_NAME);
for(var i = list.iterator(); i.hasNext();) {
print(i.next().getOptionLong());
}
/* yields the following, as desired:
English
ASL or other assistance for hearing impaired
Achumaw
*/
widget.setSelectionList(list, "id", "optionLong");
/* but is rendered in the following order:
ASL or other assistance for hearing impaired
Achumaw
English
*/
</fb:load-form>
</fb:javascript>
Anybody know offhand where/why this is happening and how to stop it?
Thanks in advance.
Thanks,
Bill Bruyn
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org