Solved

XSL Editor Parameters - to open a max size new window

Posted on 2013-01-30
8
816 Views
Last Modified: 2013-01-30
Hi experts,

<xsl:when test="@ContentType='Process'">
<a href="http://company.net/sites/sg/Forms/DispForm.aspx?ID={@ID}&amp;Source=http://.company.net/sites/sg/Forms/AllItems.aspx" target="_blank">
<xsl:value-of select="@FileLeafRef"/>
</a>
 </xsl:when>

However the window appears small. How do I ensure the window is max size- What do I need to add to the a href?
0
Comment
Question by:sharepoint2013
  • 5
  • 3
8 Comments
 
LVL 50

Expert Comment

by:teylyn
Comment Utility
Hello,

forcing a new window to maximise is not a good idea. Most people would be quite cross if the control of the new window size was overridden. With current monitor sizes and screen resolutions, a maximised window often makes it harder to digest the content.

Having said that, it is possible. You need some javascript in the file and then include a call to that js function in the link.

There are two examples in this question (the accepted solutions)

http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_22146450.html

cheers, teylyn
0
 

Author Comment

by:sharepoint2013
Comment Utility
Saw it. would it be possible to put the <script> tag in the xsl editor?

How do i integrate it into the onclick line without the <script> tag? eg:

..href="http://company.net/sites/sg/Forms/DispForm.aspx?ID={@ID}&amp;Source=http://.company.net/sites/sg/Forms/AllItems.aspx"

onClick="return !window.open(this.href,this.target,'width=1024,height=250')"

target="_blank">

Is this fine?
0
 
LVL 50

Accepted Solution

by:
teylyn earned 500 total points
Comment Utility
You can put the script anywhere in the page, for example just above the link tag.

<xsl:when test="@ContentType='Process'">
						<script>
						  function winpop(url){
						  var w = screen.width;
    						var h = screen.height;
						    popup = window.open(url,&apos;popup&apos;,&apos;screenX=0,screenY=0,left=0,top=0,width=&apos;+w+&apos;,height=&apos;+h);
							  }
						</script>
						<a href="http://company.net/sites/sg/Forms/DispForm.aspx?ID={@ID}&amp;Source=http://.company.net/sites/sg/Forms/AllItems.aspx" onClick="winpop(this.href);return false;">
							<xsl:value-of select="@FileLeafRef"/>
						</a>
					</xsl:when>

Open in new window

0
 

Author Comment

by:sharepoint2013
Comment Utility
Sorry for my lack of knowledge.

Where do I put the width and height size?
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

Author Comment

by:sharepoint2013
Comment Utility
Sorry I tried and it works perfect!
0
 
LVL 50

Expert Comment

by:teylyn
Comment Utility
You don't.

Because you don't know what they are. Each user can have a different screen resolution.

Javascript will calculate them. The script works as is. I copied it from my test site.
0
 

Author Comment

by:sharepoint2013
Comment Utility
The problem is, the new window does not have back forward buttons..

i inserted toolbar=yes and status=yes and location=yes

Still no effrt.
0
 

Author Comment

by:sharepoint2013
Comment Utility
nvm i fixed it
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now