Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread TButtonComboBox and binding to a TCollection...
Sun, May 27 2018 2:18 PMPermanent Link

Mario Enríquez

Open Consult

Hi guys,

I'm starting my second (this time more serious) project on EWB and have some questions regarding the correct use of TButtonComboBox.

I've a REST Webservice from where I retrieve some json collections that get loaded on TCollections on the EWB side. I've been struggling to properly bind these collection to a TButtonComboBox. So far, I've done it manually, adding the values manually through the Items.Add method, and once a value is selected I search/find the TButtonComboBox.Text value throuht the elements on the collection in order to retrieve the corresponding value. Obviously there should be a more efficient way, right?

Any advice?

Regards,
Mario
Tue, May 29 2018 1:07 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Mario,

<< I've a REST Webservice from where I retrieve some json collections that get loaded on TCollections on the EWB side. I've been struggling to properly bind these collection to a TButtonComboBox. So far, I've done it manually, adding the values manually through the Items.Add method, and once a value is selected I search/find the TButtonComboBox.Text value throuht the elements on the collection in order to retrieve the corresponding value. Obviously there should be a more efficient way, right? >>

Don't the values in the collection map, positionally, to the same items in the TButtonComboBox ?  Or are they sorted in the TButtonComboBox ?

Tim Young
Elevate Software
www.elevatesoft.com
Wed, May 30 2018 10:19 AMPermanent Link

Mario Enríquez

Open Consult

Tim,

Yes, the items should by in the same position, guess I could use the ItemIndex then right?

I'll look into it, thank you.

Regards,
Mario
Mon, Jun 4 2018 3:23 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Mario,

<< Yes, the items should by in the same position, guess I could use the ItemIndex then right? >>

Correct.

Tim Young
Elevate Software
www.elevatesoft.com
Image