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

I have a K2 Smartform that displays a list of file names. When the user clicks a file name, the program opens that file (all of them are PDFs) in a new tab in the browser (IE). This is good so far. If you click on a second file from the list, it opens in a third tab. That is not what the user wants.
They want the second file selection to open in the same window as the first file.
This is the process I can see:
Click on the file in the list.
Open in a tab.
Click on a second file in the list.
If there is already a tab open with a file from the list, open this file there. Otherwise, open a new tab for the file.
I suppose automatically closing the first tab when they click on the second file would accomplish the same thing.
How can this be done?

When you deal with opening links, first of all, what you can do is limited. Indeed, browsers (IE, Chrome, etc...) can be configured by the users to open links in new tabs, windows, etc... and you as form developer cannot change that.
I have made a jsfiddle to reproduce your situation and propose a solution you can test. I don´t guaranty it will work as I use a Mac but I also describe a better solution below.
You can find it here:
https://jsfiddle.net/chevdor/45k40npv/
I guess the first example (#1) is what happens for you at the moment.
Using the 'target' attribute, I tried to implement a solution that may work for you. Click on #2 and #3 and check whether this work.
I cannot test that since I use a Mac.
You can read more about the target attribute here:
http://www.w3schools.com/tags/att_a_target.asp
Another solution that would give you more control is to use an iFrame control. I think it comes in standard with SmartForms now. If not, you can for sure get it from the community site. I recommend you create a new View with this iFrame and define one parameter (string) called "url".
Let´s speak in K2 rules languages :)
"When the parameter changed", "and the parameters is defined", if you 'Transfer data' passing your URL to the iFrame control, it will display your doc. If the user clicks another document, it will update the SAME iFrame. With this solution, no tab will ever be involved.
Please note that it will work great for any document supported by your browser. Some types may require a plugin. Other documents (ie zip, etc..) will NOT appear but be downloaded instead.
I hope this helps.
Best regards,
-chevdor

Related

Mouseup event is not propagated to a popup window in IE 11

I've a legacy app that features a DND from a popup window to the main one.
It works fine in IE 8 but not in any of the newer versions of IE. The effect results in the drag ghost image being stuck in the source window and not going away after the drop had occurred.
Some debugging did in fact confirm that the 'mouseup' event does not get propagated back to the source window. What can be done to fix it? Many thanks!
ITs a bit hard to begin to answer your question without some code....
use the File>Properties menu to find out which IE security zones the two windows(domains) map too...IE uses a different security model to other browsers... drag/drop is probably not allowed between local web files (using file: protocol) and internet or intranet sites.
Have you used the Dev tool yet to debug it? If you are using showModalDialog (which normally disables context menus) you can right click on a link (a) or input element to display the context menu so you can display the debugger for showModal content page.
If possible include a link to your website or a mashup (jsfiddle) with your questions.

Is there a way in (DocumentFormat.OpenXml.Wordprocessing) to write protect a paragraph?

I understand you can protect the whole document with something like this: myDocument.ExtendedFilePropertiesPart.Properties.DocumentSecurity= new DocumentSecurity("4");
Is there a way to do the same, but to just a single paragraph ?
-thanks in advance
Yes, although I'm on a mobile device and can't check the exact syntax at the moment. But you can find it, yourself.
Start a new document, fairly simple content. In the Word application go to the Developer tab. There's a group/button "Restrict Editing" / "Protect document" (depending on the version of Word). That displays a task pane where you can define the kind of restriction. Select everything BUT the paragraph, then from Step 2 choose "Read-only" (or something like that - not protect for comments or form fields). Make the selection editable for "everyone". In the next step, activate the protection.
Once you have this working, open the document in the Open XML SDK Productivity Tool and you can inspect the underlying Word Open XML syntax. Plus, if you're using the SDK (that's not clear from your question) it will also show you the code for generating the document.

Open Link in other tab, but named, so that same tab is used each time

In itext you can open a link using app.launchURL. This gives an extra parameter to open it in new tab.
We want to open the url in a new tab, but each time the same tab. Just like you can do in normal a href by setting the target to a named tab.
Is this possible?
Thanks in advance! Kind Regards, Marieke
As far as I know, there's no such functionality in ISO-32000-1. The best chance at finding a way to do this, is by looking at the JavaScript specification.
Incidentally, I have a copy of the unpublished ISO spec "ECMAScript for PDF" (currently in development at the ISO meeting in Pretoria). This is what it says:
launchURL — Launches a URL in a browser window.
Parameters:
cURL — A string that specifies the URL to launch.
bNewFrame — (optional) If true, this method launches the URL in a new window of the browser application. The default is false.
I think it's safe to say that you're asking for something that is impossible. If it were possible, the spec would mention an extra parameter to define the name of the tab or window.
(This answer isn't limited to iText; what you're trying isn't possible in general.)

MOSS 2007 - Customize Send To Menu

We currently have a need to add a custom menu item to the Send To menu within our document libraries that would allow a user to create a link to the currently selected list item within another library. When the user clicks on the new "Send Link to..." menu item, they should be prompted to browse to the library in which the link should be added. Once the user chooses a destination, the link, along with the metadata from the list item, should magically appear in the selected desitnation library. Once again, we only want a link, not a copy of the file. Is this possible to do? Code examples would be much appreciated.
Does it have to be in the send to menu? Can it also be directly in the context menu (say at the bottom)? If so, you can create a feature that deploys a CustomAction to the site. If it really, REALLY needs to be under the "send to" menu, you are going to have to use javascript (since that is how the out of the box context menu is created) to "hijack" the menu and insert your own item.
IMHO this is rarely needed, a CustomAction is the preferred way of doing this. It is the easiest and most "maintainable" (all it is is a feature + customaction definition with maybe some code, all of which are deployed using a solution).
More info on CustomActions here.
P.S. if you do decide to go with javascript, don't go editing the out of the box sharepoint js files in SharePoint's 12 Hive, but add a ContentEditorWebPart to the page and insert your Javascript in there.
P.P.S. While assigning a method from an assembly as the action for a CustomAction is allowed in most cases, it is not for the ListEdit (item) context menu.
What they say is that "Sharepoint server 2010 will have it out of the box", i.e. documents may stay where they were created and links go to the Records center (named "In Place Records Management, see http://www.cmswire.com/cms/document-management/the-scoop-sharepoint-2010-records-management-005948.php).
MOSS 2007 requires the actual document to be copied to the Records repository to be registered.

Stop form from open when no records

I have a data entry form that when it closes opens another form for further updating the just newly entered data. However, at times no further update is necessary. How can I suppress the 2nd form from opening when there is no need for further update? Presently the form opens even when there are no recordsets present. (need a similar Event like for the report "On No Data")
Have a bit field such as a checkbox with default set to true open second form. Uncheck it to avoid the system from opening the next form. You will need to handle this in your code and check if that check box is checked or not.
Of course we will need more details such as why you are currently opening this second form...in addition, cant you check if any changes were made and if they were then open that second form else dont? Also what lang ?
Without knowing more about what you're working on, I'd say you would have to modify the process that shuts down the first form to check if the second form is needed. In .NET, for example, you could add code to the OnClosing event for a WinForm to check. If it's needed, open it as normal, if not then don't.
Subject: Tool Kits. Tool Kits consist of 1 or more tools. If tools already exist, no need for 2nd form to pop up. If tools are new, I need to fill in one of the 3 fields in the drop down listing. I like the idea of adding code to the OnClosing event, but do not understand what you mean by WinForm.