質問

Receiver.OnSuccessで受信した直後にRequestContext.Edit(Anobject)を既に編集可能なクライアントサイドデータベースに入れることができます。残念ながら、私がそうするとき、requestFactoryは要求がすでに進行中であると訴えます。どうやってこれを達成できますか?

requestContext.findOrganization(id).fire(new Receiver<OrganizationProxy>()
{
    public void onSuccess(OrganizationProxy response)
    {
        database.put(requestContext.edit(response)); //fails because a request is already in progress
    }
});
.

役に立ちましたか?

解決

I resolved this by using a disposable request context to create the request, and then using my more-permanent request context to edit the object:

temporaryRequestContext.findOrganization(id).fire(new Receiver<OrganizationProxy>()
{
    public void onSuccess(OrganizationProxy response)
    {
        database.put(permanentRequestContext.edit(response)); //succeeds because it has not been fired, even though edit() has been called many times
    }
});
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top