[ 
https://issues.apache.org/jira/browse/SLING-458?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12597901#action_12597901
 ] 

Felix Meschberger commented on SLING-458:
-----------------------------------------

Handling (1).

A new parameter suffix "@Delete" is added to the SlingPostServlet 
ModifyOperation, which causes the property (or item actually) addressed by the 
parameter to be removed prior to optionally set any value on it.

The use in forms may then be:

    <form ....>
        <input type="hidden" name="[EMAIL PROTECTED]" />
        <input type="checkbox" name="prop" value="one" />
        <input type="checkbox" name="prop" value="two" />
        <input type="checkbox" name="prop" value="three" />
    </form>

If none of the checkboxes is checked, only the "[EMAIL PROTECTED]" parameter is 
submitted causing the property "prop" to be removed. Otherwise the "[EMAIL 
PROTECTED]" parameter along with any checked parameter is submitted causing the 
property "prop" to be deleted and then set to the selected values.

> Enhance SlingPostServlet for multiple operations
> ------------------------------------------------
>
>                 Key: SLING-458
>                 URL: https://issues.apache.org/jira/browse/SLING-458
>             Project: Sling
>          Issue Type: Improvement
>          Components: Servlets Post
>            Reporter: Felix Meschberger
>            Assignee: Felix Meschberger
>
> After implementing SLING-422, the SlingPostServlet can only execute one 
> single operation. It shows that some times, it is required to actually 
> evaluate multiple operations. Some examples:
> (1) A CMS system provides a dialog to modfiy existing content. One such 
> content element is stored in a multivalue property represented in the dialog 
> as a series of checkbox. If the user checks no checkboxes the respective 
> request parameter is not sent to the server and out of the box the property 
> will not be touched. In this case it would be required to remove the 
> respective property before actually modifying the existing content. So in 
> addition to the modification operation, a delete operation must be executed.
> (2) In some administration application, an operation such as moving items may 
> be applied to multiple items at once. So having a way of specifying all such 
> items at once would be required.
> Both use cases require multiple requests after the SLING-422 implementation.
> The goal is to come up with a solution, which is simple out of the box but 
> provides more functionality if really required.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to