On 07/12/2011 03:38 PM, Gianluca Sabena wrote:
> Thank you,
> How can I save when the document is submitted?
> I tried with #if("$context.action" == 'save'  ) but no lucky, I can't
> catch the "inline save action"
>
> Any idea?

If you use the standard inline action then the document is saved 
automatically when you click 'Save & View' or 'Save & Continue'. In 
other words, if you don't use a custom HTML form (i.e. if you don't 
generate the HTML form yourself) then the HTML form is generated by the 
inline action and you just have to call 'display' for some/all 
properties that you want to view/edit. The rest is handled automatically.

Hope this helps,
Marius

>
> Regards,
> Gianluca
>
> On 12/lug/11, at 14:17, Marius Dumitru Florea wrote:
>
>> 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
>
> _______________________________________________
> 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