Mark all the documents and delete at one go

I need to implement something like a checkbox whereby, those that are ticked… are the documents to be deleted…

How do i do it in xapplication?


X-Application Version: 3.1.2, 3.1.1
Tamino Version : 3.1.1
Platform : NT, Win2k, Solaris, …
WebContainer : Tomcat 3.3
JDK Version : 1.3.1


the functionality you request is currently not directly supported. Before a few day, there was another request for checkbox support where the values of selected elements had to be added.

My tip for X-Application version 3.1.2 was using Scriptlets. I have a posted small example. Have a look at the following topic Performing Addition using X-application ? Subject is ?Example?).

In your case, I would use the ino:id of the documents as value for the checkbox.

<BR><bdm:browse ...><BR>   ...<BR>   <input type=?checkbox? name=?toBeDeleted? value=?<bdm:display select=?$ID?/>?/><BR>   ...<BR></bdm:browse><BR></pre><BR><BR>On the next JSP where the request is processed use the scriptlet to evaluate the parameter ?toBeDeleted?.<BR><BR>Use the workspace to read the document with the selected Id<BR><BR><pre class="ip-ubbcode-code-pre"><BR>String[] value = request.getParameterValues(?toBeDeleted?)<BR>for (int i = 0; i < values.length; i++) {<BR>	String selectedId = value[i];<BR>BusinessDocument doc = + selectedId, ?/doctype[@ino:id=? + selectedId + ?]?);<BR>doc.delete();<BR>}<BR>workspace.commitAll();<BR>

Warning: When I entered this code, I used a normal text editor. I did not try out this example. Therefore, there may be typos. I hope it will help you.

Just for advertising our next version of X-Application 3.1.3: it will include a plugin concept. It allows you to implement actions which are currently not supported by X-Applications standard framework (your ?mass delete? of documents for instance). The advantage of plugins will be:

  • in contrast to Scriptlets, they will easier to be maintained (you can compile and test your plugin outside a JSP page).
  • the plugin can be used on different pages without copied code.