RE: [flexcoders] Need help Combobox label property

2009-07-29 Thread Tracy Spratt
Use labelFunction, but an alternative to a switch statement would be to use
an associative array (Object).

 

Tracy Spratt,

Lariat Services, development services available

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Mark Lapasa
Sent: Tuesday, July 28, 2009 3:18 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Need help Combobox label property

 

  

look at combo boxes labelfunction
the function will then inspect the countrycode and you'll have a nasty 
switch statement that will output the correct country name

-mL

gan_sun2006 wrote:
 

 Hi,

 I am using combobox for which the bound data is coming from an 
 arraycollection. My arraycollection has two properties called 
 countryname(labelField) and countrycode. When i submit my page, the 
 countrycode from my combo is saved to the DB. During retrieval I am 
 given only countrycode and not countryname.

 How can I show the equivalent countryname as selectedItem in my 
 combobox? Presently I am looping through the arraycollection and 
 showing the equivalent countyname. Is there any other way to do it?

 Any help is highly appreciated...

 Regards,
 Ganesh Sundar R.

 

Notice of confidentiality:
The information contained in this e-mail is intended only for the use of the
individual or entity named above and may be confidential. Should the reader
of this message not be the intended recipient, you are hereby notified that
any unauthorized dissemination, distribution or reproduction of this message
is strictly prohibited. If you have received this message in error, please
advise the sender immediately and destroy the e-mail.





[flexcoders] Need help Combobox label property

2009-07-28 Thread gan_sun2006
Hi,

I am using combobox for which the bound data is coming from an arraycollection. 
My arraycollection has two properties called countryname(labelField) and 
countrycode. When i submit my page, the countrycode from my combo is saved to 
the DB. During retrieval I am given only countrycode and not countryname.

How can I show the equivalent countryname as selectedItem in my combobox? 
Presently I am looping through the arraycollection and showing the equivalent 
countyname. Is there any other way to do it?

Any help is highly appreciated...

Regards,
Ganesh Sundar R.



Re: [flexcoders] Need help Combobox label property

2009-07-28 Thread Jeffry Houser


 If I understand correctly, you have a ComboBox with a dataProvider, 
and want to set the selectedIndex / selectedItem of that dataProvider 
knowing only piece of data (the CountryCode).  Is that correct?


Unfortunately, your approach is the way to do it using the built in 
Flex ComboBox. 

Our Flextras AutoCompleteComboBox implemented a selectedValue property, 
which allows you to do just that, though


http://www.flextras.com/?event=ProductHomeproductID=10

Does this answer the question? 



gan_sun2006 wrote:
 


Hi,

I am using combobox for which the bound data is coming from an 
arraycollection. My arraycollection has two properties called 
countryname(labelField) and countrycode. When i submit my page, the 
countrycode from my combo is saved to the DB. During retrieval I am 
given only countrycode and not countryname.


How can I show the equivalent countryname as selectedItem in my 
combobox? Presently I am looping through the arraycollection and 
showing the equivalent countyname. Is there any other way to do it?


Any help is highly appreciated...

Regards,
Ganesh Sundar R.




--
Jeffry Houser, Technical Entrepreneur
Adobe Community Expert: http://tinyurl.com/684b5h
http://www.twitter.com/reboog711  | Phone: 203-379-0773
--
Easy to use Interface Components for Flex Developers
http://www.flextras.com?c=104
--
http://www.theflexshow.com
http://www.jeffryhouser.com
--
Part of the DotComIt Brain Trust



Re: [flexcoders] Need help Combobox label property

2009-07-28 Thread Mark Lapasa
look at combo boxes labelfunction
the function will then inspect the countrycode and you'll have a nasty 
switch statement that will output the correct country name

-mL

gan_sun2006 wrote:
  

 Hi,

 I am using combobox for which the bound data is coming from an 
 arraycollection. My arraycollection has two properties called 
 countryname(labelField) and countrycode. When i submit my page, the 
 countrycode from my combo is saved to the DB. During retrieval I am 
 given only countrycode and not countryname.

 How can I show the equivalent countryname as selectedItem in my 
 combobox? Presently I am looping through the arraycollection and 
 showing the equivalent countyname. Is there any other way to do it?

 Any help is highly appreciated...

 Regards,
 Ganesh Sundar R.

 



Notice of confidentiality:
The information contained in this e-mail is intended only for the use of the 
individual or entity named above and may be confidential. Should the reader of 
this message not be the intended recipient, you are hereby notified that any 
unauthorized dissemination, distribution or reproduction of this message is 
strictly prohibited. If you have received this message in error, please advise 
the sender immediately and destroy the e-mail.



Re: [flexcoders] Need help Combobox label property

2009-07-28 Thread Jeffry Houser


I started to give him a similar answer, but then realized he may be 
talking about setting the selectedItem on the ComboBox.  He mentioned he 
already had a labelField which seems to be exactly what he needs for 
display purposes without a complicated switch statement. 


Ganesh, if neither answer helps you, could you elaborate on the problem?

Mark Lapasa wrote:
 


look at combo boxes labelfunction
the function will then inspect the countrycode and you'll have a nasty
switch statement that will output the correct country name

-mL

gan_sun2006 wrote:


 Hi,

 I am using combobox for which the bound data is coming from an
 arraycollection. My arraycollection has two properties called
 countryname(labelField) and countrycode. When i submit my page, the
 countrycode from my combo is saved to the DB. During retrieval I am
 given only countrycode and not countryname.

 How can I show the equivalent countryname as selectedItem in my
 combobox? Presently I am looping through the arraycollection and
 showing the equivalent countyname. Is there any other way to do it?

 Any help is highly appreciated...

 Regards,
 Ganesh Sundar R.



Notice of confidentiality:
The information contained in this e-mail is intended only for the use 
of the individual or entity named above and may be confidential. 
Should the reader of this message not be the intended recipient, you 
are hereby notified that any unauthorized dissemination, distribution 
or reproduction of this message is strictly prohibited. If you have 
received this message in error, please advise the sender immediately 
and destroy the e-mail.





--
Jeffry Houser, Technical Entrepreneur
Adobe Community Expert: http://tinyurl.com/684b5h
http://www.twitter.com/reboog711  | Phone: 203-379-0773
--
Easy to use Interface Components for Flex Developers
http://www.flextras.com?c=104
--
http://www.theflexshow.com
http://www.jeffryhouser.com
--
Part of the DotComIt Brain Trust