Recommended approach for implementing a "create and link" button

Hi everyone,

Let’s imagine I have an application comprising a Movie and an Actor class, and I want to provide a “create and link” button from an Actor page that will create a Movie, and directly link it to the current Actor (that is the one from which the button was pressed), while going through the standard creation page for choosing a name and a location in particular. Since this seems like a generic use case, I was wondering if anyone would recommend a specific approach to implement it.

I thought about the following, but it won’t work as is:

  • Let the “create and link” button point at /create/Movies/WebHome?MovieClass.actors=Actors.MyActor
  • Make sure that the createinline.vm form stores the query string parameters as hidden input fields so that they propagate to the XWiki form.

However, it seems that the hidden inputs are actually not propagated from the create action to the actual edit form, which prevents from letting the user go through the standard creation process for choosing a name and a location in particular. Have you ever encountered this type of need? What do you think?

Cheers