RE: addOptions - format the text/value shown in listbox(select)

View: New views
1 Messages — Rating Filter:   Alert me  

RE: addOptions - format the text/value shown in listbox(select)

by David Marginian-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The easiest solution I know of is to create a displayName field on your
bean and have it return the display you want.

Original Message:
-----------------
From: andle andreas.lecerof@...
Date: Thu, 24 Apr 2008 12:26:42 -0700 (PDT)
To: users@...
Subject: [dwr-user] addOptions - format the text/value shown in
listbox(select)



I have a java-method returning a collection with javabeans with countries
which have an id and a name
something like ('SE', 'Sweden), ('DK', 'Denmark')

I use addOptions like this:
dwr.util.addOptions('mylistbox', data, 'id', 'name');

data is the result from dwr with id and name for many countries.

Is there a way to format the text that is shown in the listbox?
Now in the listbox the name of the countries is shown:
like "Sweden, Denmark", etc
The value in the listbox is the "id" of the country: SE, DK, etc

I would like to format the text (shown to the user in the listbox), so
more than the country name is shown.
For example, I would like the result to be
'SE Sweden', 'DK Denmark' in the listbox.
Is there a way with addOptions to do this?
/Andreas
--
View this message in context:
http://www.nabble.com/addOptions---format-the-text-value-shown-in-listbox-%2
8select%29-tp16851774p16851774.html
Sent from the DWR - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...



--------------------------------------------------------------------
mail2web LIVE – Free email based on Microsoft® Exchange technology -
http://link.mail2web.com/LIVE



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...