Hi,
In my application I have three combo boxes which act as a filter for a
datagrid. For example, I have:
Customer: Sales rep: Country:
____________ _____________ _________________
|__________|_| |___________|_| |_______________|_|
________________________________________________________
| |
| ... Datagrid of customer purchases here ... |
The datagrid and all combo boxes are populated dynamically from
HTTPServices. When the user chooses a different country, for example, I
want to show all purchases from that country which also match the
currently selected customer and sales rep. So I've defined them as
such:
<mx:ComboBox id="customer_combo" change="purchaseService.send()"
labelField="company_name"
dataProvider="{customerService.result.customers.customer}">
</mx:ComboBox>
The others are defined similarly. When my app initializes, I call:
customerService.send()
to populate the list of customers. The problem is that the change event
fires from the init routine, which then triggers the datagrid to
refresh. If all three combo boxes do this, then it's grabbing the data
three times from the server when it should only be doing one query.
After it initializes, it's not a problem, but I just want to avoid three
(possibly lengthy) database fetches at the start.
Any ideas on a cleaner way to do this? Perhaps it's possible to set the
change event for each after the initial send() completes or disable the
event until then? Or have I missed something totally obvious? :)
Thanks,
Blake
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/