Search code examples
filedownloadtabsxpagesattachment

How to change the default action to "open in new tab" when clicked on an attachment in xpages?


I have an xpage with a "File Download" control in it, binded to a data source which is pretty basic. When its displayed and I click on an attachment in the list from a computer / laptop, it downloads it as expected (When you click on the downloaded thing in the bar below the browser, it opens the attachment in the appropriate application).

But when I use this feature from mobile (phone or a tablet), the attachment is opened in the same page directly. Only when I click on it for a longer period (I'm using an IPhone in this case), I have the option to "Open in New Tab" (as if I "right-clicked" in desktop).

Now what I want to do is, when I click on an attachment from mobile, I want the default action to open it in a new tab.

How can I do this?


Solution

  • This answer put me in the correct path but I'm not quite where I want to be.

    This answer works when I extend the Bootstrap3_flat theme (which is the selected application theme in xsp.properties) and add the required code. Then when I use the file download control, attachments are opened in new tab by default.

    But in xps.properties of the application, I am selecting "Mobile default" for the mobile theme. So in order to extend "Mobile default" I guess I have to extend "iphone" but when I try that, my application is not loaded correctly.

    How can I extend "Mobile default" theme correctly for my application to load correctly?