Hi John, welcome.

As Jeroen says, the way to return to the original object is to "return
this" rather than void.

We actually had a discussion about this a little while back on the mailing
list [1], and I raised a ticket then [2] as a placeholder.

~~~
Also, you mentioned you've implemented the mutual registration pattern. If
you're using the JDO objectstore (you probably are), then you probably
don't need to do this if you mark up the relationship as bidirectional [3].

Cheers
Dan



[1] https://issues.apache.org/jira/browse/ISIS-666
[2] http://markmail.org/message/xhmeq62ywr2vqvje
[3]
http://isis.apache.org/components/objectstores/jdo/managed-1-to-m-relationships.html



On 27 March 2014 07:39, Jeroen van der Wal <[email protected]> wrote:

> accidentally sent, add this:
>
> public Invoice addInvoiceItem(..) {
>     invoiceItems.create(...);
>
> *    return this;*
> }
>
> I agree that the viewer should return the last screen after a void action.
> Perhaps you could raise a ticket?
>
> Cheers,
>
> Jeroen
>
>
>
>
>
> On Thu, Mar 27, 2014 at 8:33 AM, Jeroen van der Wal <[email protected]
> >wrote:
>
> > Hi John, welcome to the Isis mailing list.
> >
> > If you use JDO there's no need to use the mutual registration pattern [1]
> > which saves a lot of boilerplate code.
> >
> > The pattern that we have currently in Estatio when creating child object
> > return the parent object after adding a new child.
> >
> > public Invoice addInvoiceItem(..) {
> >     ....
> >
> > }
> >
> >
> >
> >
> >
> >
> >
> >
> > On Thu, Mar 27, 2014 at 1:53 AM, John Lafer <[email protected]> wrote:
> >
> >> Hello Isis Users,
> >>
> >> I'm a first-time user with likely a naive question. I'm using Isis 1.40
> >> and the Wicket viewer. I defined an action for a (parent) entity that
> >> allows the user to create a child (1-M) object and add it to a
> collection
> >> in the parent. When the user fills out the required child fields and
> >> presses the OK button in the modal dialog window, the view switches to a
> >> page with a message ("No results") under a title ("Add a <name of child
> >> entity>"). I wrote the action to return void and I thought this would
> allow
> >> the action to return the user to the parent entity detail (or edit)
> page,
> >> which is what I desire. I've implemented the mutual registration pattern
> >> and the child object is being added to the parent's collection just
> fine.
> >> Any ideas on what I'm missing?
> >>
> >> Thanks in advance.
> >> John
> >
> >
> >
>

Reply via email to