On 07/12/2011 02:17 PM, Gianluca Sabena wrote:
> Hi,
> I would like to create multiple objects and attach to the same
> document (page).
>
> --- velocity script --------------------------------------------------
> #if("$context.action" == 'inline'  )
>     #set($obj = $doc.newObject("Intranet.AbPersonClass"))
>     #foreach($prop in $obj.xWikiClass.properties)
>     ; $prop.prettyName
>     : $doc.display($!prop.getName(),$obj)
>     #end

>     $doc.save()

Why do you save here? The document should be saved when the form is 
submitted, not when the form is displayed.

Hope this helps,
Marius

> #end
> --------------------------------------------------------------------
>
> With this code I have two different behaviors:
>
> * edit inline, add field, save =>  everything works well
> * edit inline, press CANCEL =>  the system save an empty object
>
> Is there a workaround?
>
> Thank you,
> Gianluca
> _______________________________________________
> users mailing list
> [email protected]
> http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________
users mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to