[ https://issues.apache.org/jira/browse/JSPWIKI-867?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14291240#comment-14291240 ]
brushed commented on JSPWIKI-867: --------------------------------- David, Bringing the user back to the tab from where the DELETE was invoked is preferred; rather then returning to the default page view. Redirecting back to the "ATTACH" tab can be done without JS; by using an additional "&tab=attach" parameter in the url which is captured as "defaultTab". This trick to go back to the correct TAB is used in various other places too. In AttachmentTab.jsp you can change {noformat} <wiki:Link format='url' context='<%=WikiContext.DELETE%>' /> {noformat} to {noformat} <wiki:Link format='url' context='<%=WikiContext.DELETE%>' ><wiki:Param name='tab' value='attach'/></wiki:Link> {noformat} This parameter can then be picked up by the InfoContent.jsp, when defining the defaultTab. In InfoContents.jsp change {noformat} <wiki:TabbedSection defaultTab="info"> {noformat} to {noformat} <wiki:TabbedSection defaultTab="${param.tab}"> {noformat} The difficulty now is that Delete.jsp needs to pass on the tab parameter in the redirection url. I was able to get this to work by adding the tab parameter to the wiki.getURL(...) invocation, but strangely the "&" was added as "&". (this could be a bug in URLConstructor classes ... to be further checked ) In Delete.jsp change {noformat} response.sendRedirect(wiki.getURL( WikiContext.INFO, redirTo, null, false )); {noformat} to {noformat} response.sendRedirect( TextUtil.replaceString( wiki.getURL( WikiContext.INFO, redirTo, "tab="+request.getParameter("tab"), false ),"&","&") ); {noformat} dirk > Deleting attachments should retain focus on the Attach tab > ---------------------------------------------------------- > > Key: JSPWIKI-867 > URL: https://issues.apache.org/jira/browse/JSPWIKI-867 > Project: JSPWiki > Issue Type: Improvement > Components: Default template > Affects Versions: 2.10.2 > Environment: This is using the "PlainVanilla" skin. > Reporter: Dave Koelmeyer > Priority: Minor > Labels: attachments > > Procedure to recreate the issue follows: > Start off with an existing JSPWiki page containing a number of existing > attachments. Then, go to the "Attach" tab. Delete one existing attachment by > clicking on the "Delete" button, accepting the warning prompt that appears. > On successful deletion of the attachment, JSPWiki will then bounce you to the > "Info" tab, instead of retaining focus on the "Attach" tab. The net result is > the user then has to click back on the "Attach" tab to continue deleting > further attachments, repeating the procedure each time for each attachment to > be deleted. > Alternately, checkboxes to select multiple attachments for deletion would be > another solution here. -- This message was sent by Atlassian JIRA (v6.3.4#6332)