[JIRA] Updated: (SDK-16727) ComboBox::calculatePreferredSizeFromData does not handle ItemPendingError
Matt,
SDK-16728: calculatePreferredSizeFromData (protected)
From this list, you can see that it is possible to create a subclass that provides implementations that correctly handle ItemPendingError. My issue here is one of SDK correctness (robustness) and documentation. The documentation for ComboBox does not explain that data providers cannot throw ItemPendingError without expecting runtime errors visible to the application user. In my case, I have created a class that implements ICollectionView and implements paging of remote data (i.e. a collection of lists). When an index in the collection is requested that is not cached on the client side, an ItemPendingError is dispatched and the class requests the appropriate page from the remote data source.
The code changes for ItemPendingError are minimal and actually reduce the code in some cases. That said, I have not done performance testing, which is definitely important. Was any done at Adobe regarding handling of ItemPendingError? I don't like the idea of suggesting to developers that we subclass ComboBox to re-write the mentioned functions. This causes two problems, one is the amount of code duplication maintained independently of the SDK, but dependent on it. The other is the number of developers that may desire similar functionality. If ComboBox is not to support ItemPendingError, then perhaps another class should be added to the SDK with robust implementations of the mentioned functions.
Now, my patches for ListBase are a different, but related story:
ListBase:
SDK-16845: adjustAfterSort (private)
SDK-16895: commitSelectedIndex (mx_internal)
SDK-16846: selectItem (protected)
