Hi Anti,
Sounds like you might be better off having A fire a change event
whenever its data is loaded or refreshed. B can be registered as a
listener with A and so be notified whenever it needs to update its own
view. If A fires its change event only after the RPC call has been
successfully returned and processed, B will only call for the new data
from A if when it is ready (i.e. the RPC call has actually returned) ,
and your null problem will go away.
RPC calls are asynchronous: that means that execution of your client
code does not stop to wait for an RPC call to return. So your client
is constructing B before the RPC call has returned and is calling A
for the data again before the RPC has returned. That's why you are
getting the error.
regards
gregor