K2: How may I open a file in a new window unless I already have such a window open? -


i have k2 smartform displays list of file names. when user clicks file name, program opens file (all of them pdfs) in new tab in browser (ie). far. if click on second file list, opens in third tab. not user wants.

they want second file selection open in same window first file.

this process can see:

  1. click on file in list.
  2. open in tab.
  3. click on second file in list.
  4. if there tab open file list, open file there. otherwise, open new tab file.

i suppose automatically closing first tab when click on second file accomplish same thing.

how can done?

when deal opening links, first of all, can limited. indeed, browsers (ie, chrome, etc...) can configured users open links in new tabs, windows, etc... , form developer cannot change that.

i have made jsfiddle reproduce situation , propose solution can test. don´t guaranty work use mac describe better solution below.

you can find here: https://jsfiddle.net/chevdor/45k40npv/

i guess first example (#1) happens @ moment. using 'target' attribute, tried implement solution may work you. click on #2 , #3 , check whether work. cannot test since use mac.

you can read more target attribute here:

http://www.w3schools.com/tags/att_a_target.asp 

another solution give more control use iframe control. think comes in standard smartforms now. if not, can sure community site. recommend create new view iframe , define 1 parameter (string) called "url".

let´s speak in k2 rules languages :) "when parameter changed", "and parameters defined", if 'transfer data' passing url iframe control, display doc. if user clicks document, update same iframe. solution, no tab ever involved.

please note work great document supported browser. types may require plugin. other documents (ie zip, etc..) not appear downloaded instead.

i hope helps. best regards, -chevdor


Popular posts from this blog