What was the design solution for ItemPendingError in Flex?

Flex has the concept of lazy data loading. It has a class called ItemPendingError, which allows developers to handle it when an attempt is made to access data that is not yet available, as well as pending.

However, looking at the documentation , you should add try / catch blocks around your code wherever you have code that can raise an IPE (ItemPendingError).

I am wondering if anyone knows why it works this way. I’m not sure what the best solution might be, but inadvertently add try / catch blocks to catch the error and then register the responder if it feels bad and not very clean. And the fact that you seem to have to use your application to make sure that you catch all the possible places where an error may occur is also lame.

Is there any other way or better approach that I have not seen / not heard?

+3
source share
3 answers

, . "" . , , , . : , , . Flex .

, , , , , . try/catch - , ( , , ), . , Flex , , , , ?

, , , , .

0

, -. "" , - ItemPendingError , / , ( ). , List DataGrid, , , , .

...

0

, - GUI , .

For example, you have a list of elements, each of which has properties that reference objects that are attached to the display. When the user navigates to new elements, the accessor of these properties makes an asynchronous call to the server because he is waiting for the first request. A response from the server will be placed in this property when it returns from the server (and raises a binding event).

Binding deals with zero anywhere in the chain, so the GUI shows nothing until the final target is populated.

Greetings

0
source

Source: https://habr.com/ru/post/1713839/


All Articles