メーリングリスト webobjects-dev@wocommunity.org メッセージ #280
差出人: Markus Ruggiero (rucotec) <webobjects-dev@wocommunity.org>
件名: localinstance for not-yet-saved EOs?
日付: Fri, 15 Oct 2021 14:48:56 +0200
宛先: Jesse Tayler <webobjects-dev@wocommunity.org>
署名済み (Text SHA256)
LocalInstance is only allowed for EOs that have already been saved. If isNewObject() return true then any form of localinstance call returns an exception. Why? And how can I overcome this?

I have the following scenario:

The user picks existing EOs to be worked on at a later point in time. They can also create on-the-fly new EOs for picking. All EOs as well as the new ones are associated with the current editing context. The whole list of picked objects (NSArray containing existing and new EOs) is then passed to the next page and on to the next. In each step some of the EOs are modified in various ways until about 3 steps down the line a final saveChanges() is done. All fine so far.

But on each step the user can go back up one step (either browser back button or with a dedicated navigation button on the page). The page cache takes care of this but the EOs themselves are not in the page cache and remain modified in their EC. Coming back the previous / first page does not show the initial state anymore. Ok, easy to solve (methinks): map the EOs into a new editing context right before going to the next step. Coming back then automatically throws away that EC. Going forward again will create a brand new EC. But! localInstancing into the new EC only works for saved EOs. How do I get these new EOs into the nextPhaseEC? The new EOs are fairly complex and already have relationships to other EOs. How can I re-wire the new EOs?

Thanks for any help
---markus---

次の署名によって内容は保証されています:
<markus.ruggiero@rucotec.ch>
リストを購読 ダイジェストを購読 インデックスを購読 購読停止 メーリングリスト管理者に送信