I am using then new NavigationBar control to control a series of applications. Using the basicLeafNode I have this in the href:
var prefix:String = "";
if (#ClientType() == "Web")
{prefix = "https:xxx/"}
else
{prefix = "notes:xxx"}
url = prefix + "path/databsase.nsf?OpenXpage";
url
This works fine except in XPiNC I want the link to replace the tab, not open a new window. How can I do this?
===================================================
To clarify, I want the target to replace the current tab, not open a new one. While primarily a web app, the users will access it from XPiNC.
In the onClick event of the NavigationBar I have this in CSJS:
window.open('notes://<server>/common/db.nsf/xpHome.xsp?OpenXpage','_self')
Just trying to get this to replace the current tab in XPiNC. It opens a new tab. Shouldn't it replace this tab?
Brian - in XPiNC the URL is /xsp/path/database.nsf if you are going to do it manually you have to adjust for the XPiNC environment.
In the XSP Properties there is a setting on the General tab for Window behavior for the Notes client.
Related
I have three different Hyperlinks on a web page
Planning.
Solutions.
Contact Us.
I want to open them in separate browser tab one by one using codedUI.
i have written the above code to obtain the list of Hyperlink
HtmlControl Hyperlink = new HtmlControl(browser);
Hyperlink.SearchProperties.Add(HtmlControl.PropertyNames.ControlType,"Hyperlink");
UITestControlCollection controls = Hyperlink.FindMatchingControls();
foreach(UITestControl control in controls)
{
if (control is HtmlHyperlink)
{
HtmlHyperlink link = (HtmlHyperlink)control;
if(link.InnerText=="Planning"|| link.InnerText== "Solutions")
{
//separate Tab logic goes here
}
}
}
I need the help related to opening a hyperlink in new browser tab. Is it possible in CodedUI ?
By default if you click the mouse middle button (or click the scroll wheel), it opens a link in new tab. I would modify your code as below in this case,
if(link.InnerText=="Planning"|| link.InnerText== "Solutions")
{
//Open Link in New tab, by clicking middle button
Mouse.Click(link, MouseButtons.Middle);
}
You can do this a couple different ways. I would use #Prageeth-Saravan 's approach first to see if it works because it's easier and actually tests your UI. You could also:
Get the URL from the found link control
Send the "New tab" keyboard shortcut
Reinstantiate your browser window object to be sure it's pointing to the new tab
Navigate to that URL
The reason why I bolded step 3 is regardless of approach, if you intend to assert or interact with anything in a new tab you're going to have to remember that the CodedUI software will still be "Looking" at the old tab until you reinitialize it.
I'm using Notes/Domino 8.5.3. I've added a button control to an xpage. The button uses a Confirm Action to display a client-side prompt to the user before continuing with the next action defined for the button. When I use static text for the Confirmation Text for the Confirm Action, the confirmation prompt is displayed. However, when I change the Confirmation Text to be computed, and retrieve the text from a profile document, the confirmation prompt it not displayed at all in XPiNC. The confirmation prompt with the computed confirmation text is displayed just fine in a browser. Is there a work-around for this issue with XPiNC?
Following is the code I'm using in the Confirm Action to get the text for the prompt:
var server = database.getServer();
var dbProfile:NotesDocument = database.getProfileDocument("DBProfile", "");
var msg = dbProfile.getItemValueString("ContactsInitUpdatePrompt");
return msg;
To further my comments, this is a work around I use the below code for an app that uses the bootstrap extension library on the web but uses basic functionality with xpinc.
If the values for xPinc are different you could make the confirm action different in the browser and in the client.
if (#ClientType()== "Notes")
{
<action>;
}
else{
<action>;
}
I think that profile documents are a bad idea in xPages though. Having to restart HTTP to get a new value ruins the point I think. Almost better to hard code values at that point. I think you can set application scope to handle the work of profile documents. But then application scope in xpinc is just on the current machine as the server is the client.
I've noticed with Sharepoint 2010, many of the links do not the support open in new tab/window feature. For example, items on the quick menu do not. Is it possible to enable?
Use the JavaScript function to open a new window in SharePoint 2010.
Create the function to open your target window as sample provide below.
function load_url(externallink)
{
window.open(externallink,target='_blank')
}
Place the function load_url in JavaScript file
Click site actions, select manage content and structure.
Suppose you want to change the links in the page
http://someserver/sites/Dev/Help/HelpLinks/AllItems.aspx
Then select the List named HelpLinks in the sub site Help. Dev will be the top most node(site). Help will be a sub site and inside Help you can find List by name HelpLinks.
All the links in the page and their title will be displayed
Select the title of link which you want to open in new tab and right click.
Select Edit properties. Then in the URL field and call the function as javascript:load_url('http://www.google.co.in'); instead of http:// www.google.co.in
Or Else
Suppose you want to change the links in the below URL.
URL: http:// someserver/sites/Dev/Help/HelpLinks/AllItems.aspx
Go To
open to the link http:// someserver/sites/Dev/Help/HelpLinks/AllItems.aspx
You will find the columns of the List (Title Column, URL column, Summary etc).
Select the Title and click Edit property which you want to edit
Then in the URL field and call the function as javascript:load_url('http://www.google.co.in'); instead of http:// www.google.co.in
This answer is a recap of this article and is not an answer I came up with: http://sharepointsolutions.blogspot.com/2007/09/make-selected-links-in-links-list-open.html
Step 1: Add #openinnewwindow to the end of all hyperlinks you want to open in new window.
Step 2: Then you will need to add the follow script to your SharePoint pages.
[script language = "JavaScript"]
//add an entry to the _spBodyOnLoadFunctionNames array
//so that our function will run on the pageLoad event
_spBodyOnLoadFunctionNames.push("rewriteLinks");
function rewriteLinks() {
//create an array to store all the anchor elements in the page
var anchors = document.getElementsByTagName("a");
//loop through the array
for (var x = 0; x < anchors.length; x++) {
//does this anchor element contain #openinnewwindow?
if (anchors[x].outerHTML.indexOf('#openinnewwindow') > 0) {
//store the HTML for this anchor element
oldText = anchors[x].outerHTML;
//rewrite the URL to remove our test text and add a target instead
newText = oldText.replace(/#openinnewwindow/, '" target="_blank');
//write the HTML back to the browser
anchors[x].outerHTML = newText;
}
}
}
[/script]
Whats the 'Quick menu'? Do mean list item context menu or something else? Can you post a screenshot?
There are two types of links used.
Normal HTML anchors - You can hold down the CTRL key when clicking.
JavaScript links (menus and such) the CTRL key doesn't work. If you're working with the Edit/View forms then this may be of interest
SharePoint - Editing The SharePoint List Item Menu
Especially look for Part II where it talks about changing this behaviour in List Settings > Advanced Settings > Dialogs
This is actually an Internet Explorer specific bug. The navigation links in SharePoint 2010 are regular links but have two nested span tags around the text of the link. This confuses IE which doesn't realise that the text you are right-clicking up is a link and so doesn't give the correct context menu. If you right-click just to the left of the text of the link (the cursor should still show as the "hand") the context menu appears as expected.
For Sharepoint 2013, I used Keith's code with a delayed call.
<script type="text/javascript">
// Add an entry to the _spBodyOnLoadFunctionNames array
// so that our function will run on the pageLoad event
_spBodyOnLoadFunctionNames.push("rewriteLinks");
function rewriteLinks() {
$('a').attr("target","_blank");
}
</script>
In the SharePoint Wiki Editor, you can click the "From Address" Link you added, and a LINK menu will appear in the ribbon bar. Inside that, you can click "Open in New Tab" It's not exactly New Window, but it's close and easy.
Add this to the end of the link.
#openinnewwindow
example: http://www.bing.com**#openinnewwindow
Is it possible to embed an audio object (mp3, wma, whatever) in a web-enabled InfoPath form ?
If it is, how do you do it ?
#Martin
That works for local forms that open in InfoPath. Nathan was asking about web-enabled forms. ActiveX controls are disabled for web forms, as evidenced by the informational label at the bottom of the design controls when the form compatability has been set to the web.
Now, I will admit that I know nothing about the HTML tags to play audio in a browser, but I have something else that might work. I had an InfoPath form that I needed to dynamically load an image into for a web-enabled form. Similar to the ActiveX issue, the Picture control was also disabled. What I did was put some managed code behind the form and execute the following when the form loaded.
public void FormEvents_Loading(object sender, LoadingEventArgs e)
{
string imgPath = "http://yoursite/yourimage.jpeg";
XPathNodeIterator xpni = MainDataSource.CreateNavigator().SelectSingleNode("/my:FormName/my:RichTextControlName", NamespaceManager).SelectChildren(XPathNodeType.All);
xpni.Current.InnerXml = "<img xmlns=\"http://www.w3.org/1999/xhtml\" src=\"" + filePath + "\" width=\"200px\" height=\"55px\" />";
}
I don't see why you couldn't take the same approach and load audio rather than an image.
It looks like you can't embed <object> tags in a richtext field. I'm getting nothing when I do it.
Have you tried manually modifying the XSL in order to generate HTML which embedds your audio file?
I don't think there is a way to do this using the InfoPath Designer, but if it ends up in the XSL; it may just get passed through to the web enabled form.
Edit: My apologies, I missed that the question was about Web forms - for which the below does not work. Must learn to read the question fully!
Go to menu View
Click on Design Tasks
Select Controls in the 'Design Tasks' Task pane
Click on the 'add or remove custom controls' button to install your custom
control
Click on the Add button and select ActiveX Control
Select the Windows Media Player control
Select the necessary properties for databinding and finish the wizard.
After you have added the control, you can drag and drop the control on your screen.
Right-Click on the control and select the 'Windows Media Player properties'
Fill in the URL to automatically embed the file to play.
In SharePoint, it is easy to set up a List webpart consisting of Links to other documents, folders, sites, etc. Unfortunately, when clicking these links, the default behavior is for the page to open in the current browser window. That is, it does NOT open the page in a new instance of the browser. This has proven annoying for a number of the users on my site.
Does anyone know of a way to have the default behavior be to open in a NEW browser window?
I'm hoping this is something that can be set in SharePoint rather than having users need to adjust some sort of setting in their browser.
It is not possible with the default Link List web part, but there are resources describing how to extend Sharepoint server-side to add this functionality.
Share Point Links Open in New Window
Changing Link Lists in Sharepoint 2007
You can edit the page in SharePoint designer, convert the List View web part to an XSLT Data View. (by right click + "Convert to XSLT Data View").
Then you can edit the XSLT - find the A tag and add an attribute target="_blank"
The same instance for SP2010; the Links List webpart will not automatically open in a new window, rather user must manually rt click Link object and select Open in New Window.
The add/ insert Link option withkin SP2010 will allow a user to manually configure the link to open in a new window.
Maybe SP2012 release will adrress this...
Under the Links Tab ==> Edit the URL Item ==> Under the URL (Type the Web address)- format the value as follows:
Example:
if the URL = http://www.abc.com ==> then suffix the value with ==>
#openinnewwindow/,'" target="http://www.abc.com'
SO, the final value should read as ==>
http://www.abc.com#openinnewwindow/,'" target="http://www.abc.com'
DONE ==> this will open the URL in New Window