Context:
Silverlight 5, 64 bit, Win7, VS2010
Expected: a new Browser Window/Tab opens up for the url passed in.
Actual: no new browser window ot tab appears.
Code Sample: (called from ViewModel. The View is a sdk:ChildWindow.
AddRelatedIssueDialog dialog = new AddRelatedIssueDialog();
dialog.Closed +=
(s1, e1) =>
{
if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
{
var window = HtmlPage.PopupWindow("www.goole.com", "_blank", null);
}
};
dialog.Show();
We have also tried Prism events to do the same thing but with no joy...
Also have included the on the control host - but again no luck.
Any help much appreciated:
Cheers,
John
Try this:
HtmlPage.Window.Navigate(new Uri("www.google.com"), "_blank");
It works for me :)
Related
Is there any way to open a custom screen, as placed in the Acumatica menu in the Site map, as a popup (not a new tab) so that it doesn't occupy the existing browser?
I've tried using this, which works ok:
var url = "http://localhost/AcumaticaDB2562/?ScreenId=AC302000&&OpenSourceName=Bills+and+Adjustments&DataID=" + apinvoice.RefNbr;
throw new PXRedirectToUrlException(url, "Open Source")
{
Mode = PXBaseRedirectException.WindowMode.NewWindow
};
The problem is, I don't want the lefthand menu to show up. I just want the screen without any navigation. Is this possible?
I like to use PXRedirectHelper.TryRedirect for calling other graphs. The WindowMode tells the framework how to open the graph. For your question, you will want to use WindowMode.NewWindow as shown in the example below:
var graph = PXGraph.CreateInstance<MyGraph>();
PXRedirectHelper.TryRedirect(graph, PXRedirectHelper.WindowMode.NewWindow);
The enum values for WindowMode are: InLineWindow, New, NewWindow, PopUp, Same.
Alternatively you could do something like this...
throw new PXRedirectRequiredException(graph, true, string.Empty) { Mode = PXBaseRedirectException.WindowMode.NewWindow };
I've got a strange behavior when showing a ContentDialog. When the dialog is on screen and I drag the StatusBar down, the dialog disappears.
private ContentDialog _connectivityDialog = new ContentDialog { IsPrimaryButtonEnabled = false, IsSecondaryButtonEnabled = false, Title = "Test"};
Somewhere I just call _connectivityDialog.ShowAsync();
I made a simple project to reprduce this behavior:
https://www.dropbox.com/sh/0a6ad5xtrzii7sx/AADnbF9TGpfJnV9xnVG4FQMJa?dl=0
Any idea why this happens?
I found the solution while investigating for another problem:
BackButton dismisses the dialog.
Solution:
_connectivityDialog.Closing += (sender, args) =>
{
args.Cancel = true;
};
But be aware that the Hide()-Method is also affected. You can do a workaround like on this post:
How to prevent the ContentDialog from closing when home key is pressed in Windows phone 8.1..?
It seems that the certain richtext button just does the field refresh and hence nothing gets changed. So, after selecting the text in the editor if we try to perform any of the below "yellow marked (in the image) " operation it just refreshes and nothing happens.
I am using domino 8.5.3 and I have tried IE 10, 13. Any suggestion, or should I just report it as a bug?
Public Link (for testing): http://teamground.de/test.nsf/home.xsp
Domino 8.5.3 comes with CKEditor 3.2.1.6 http://www-01.ibm.com/support/knowledgecenter/SSVRGU_8.5.3/com.ibm.designer.domino.ui.doc/wpd_whatsnew.html?cp=SSVRGU_8.5.3%2F1. Searching the web I can see lots of issues of versions of CK Editor not working on Internet Explorer 10.
You may need to upgrade Domino to have a version of CKEditor that is supported by Internet Explorer 10. Domino 9.0 FP2 packages a version of CK Editor that supports Internet Explorer 11 http://per.lausten.dk/blog/2014/08/xpages-and-domino-9-0-1-fp2-upgrades-to-ckeditor-and-dojo.html
Thanks to Paul Withers and Per Henrik Lausten. It is partially a duplicate question as marked here.
The solution mentioned in the answer is precisely for IE 10.
However, I faced a problem because of the IE version. I thought I will just document it for others. IE 11.0.9 responds "unknown" and hence it doesn't change the response header. I designed a small function for later versions of IE. Hopefully this could help anyone:
function isIE() {
var isBrowserIE = false;
if (context.getUserAgent().getBrowser() == 'Unknown') {
var userAgent = context.getUserAgent().getUserAgent();
if (userAgent.indexOf('Trident/7') > -1 && userAgent.indexOf('rv:11') > -1) {
isBrowserIE = true;
}
}
if (context.getUserAgent().getBrowser() == 'Microsoft Internet Explorer') {
isBrowserIE = true;
}
if (context.getUserAgent().getBrowser() == 'IE') {
isBrowserIE = true;
}
return isBrowserIE;
}
And then as suggested by Per Henrik Lausten we could render the response header to IE 9 (would just copy it for one click answer)
<xp:this.beforeRenderResponse><![CDATA[#{javascript:
if (isIE()) {
var response = facesContext.getExternalContext().getResponse();
// Use IE9 mode because of CKEditor bugs with IE10
response.setHeader("X-UA-Compatible", "IE=9");
}
}]]></xp:this.beforeRenderResponse>
My code is to insert the text from textbox, I did my code well but I want to empty the textbox before ModalPopupExtender show. I did my code but It didn't work.
protected void Btn_monthlyemployee_Click(object sender, ImageClickEventArgs e)
{
var Comment = (TextBox)((ImageButton)sender).Parent.FindControl("txt_monthlyemployee");
ftier.Addcomment(LblMonthlyPID.Text, LoggedUserID, txt_monthlyemployee.Text, DateTime.Now, DateTime.Now, false);
Comment.Text = string.Empty;
ModelExtenderPost.Show();
}
You don't have provided enough information although i am giving you some good techniques to resolve this
Your code should be work i don't know why its not working
You can have a jquery method
when your button clicked
$('#idofmonthlyeployeed').click(function()
{
$('#commentboxid').val('');
return false;
});
You can see working example here Fiddle
Or you can have a update panel issue if you don't have triggered button of your idofmonthlyeployeed
So please add trigger of idofmonthlyeployeed
I hope this will help you regards.....:)
I grabbed some code from the link below to generate a screenshot from a web browser control:
http://pietschsoft.com/post/2008/07/C-Generate-WebPage-Thumbmail-Screenshot-Image.aspx
Then, I modified to be an extension method like so:
public static Bitmap GetScreenshot(this WebBrowser webBrowser)
{
// Load the webpage into a WebBrowser control
using (WebBrowser wb = new WebBrowser())
{
wb.ScrollBarsEnabled = false;
wb.ScriptErrorsSuppressed = true;
wb.Navigate(webBrowser.Url);
while (wb.ReadyState != WebBrowserReadyState.Complete)
{
Application.DoEvents();
}
// Set the size of the WebBrowser control
wb.Width = wb.Document.Body.ScrollRectangle.Width;
wb.Height = wb.Document.Body.ScrollRectangle.Height;
// Get a Bitmap representation of the webpage as it's rendered in the WebBrowser control
Bitmap bitmap = new Bitmap(wb.Width, wb.Height);
wb.DrawToBitmap(bitmap, new Rectangle(0, 0, wb.Width, wb.Height));
return bitmap;
}
}
It works great for most web pages, but I am trying to use it for a SharePoint site and the image is coming out as 250x250 every time. :-s
Any geniuses here that can give me a solution?
Thanks in advance
Well, the reason for this seems to be that my new WebBrowser (wb) is uninitialized even after I call Navigate(). The Url property shows as null. This is weird. Does it mean I cannot create a WebBrowser in code and never display it? It would be a shame to have to display the thing. :-(
You can check that question taking-screenshot-of-a-webpage-programmatically.
It is based on this webpage_thumbnailer which uses Web Browser control.
For one, the DrawToBitmap class does not exist under the webbrowser control. I suggest using CopyFromScreen. Here is a code snippet:
Bitmap b = new Bitmap(wb.ClientSize.Width, webBrowser1.ClientSize.Height);
Graphics g = Graphics.FromImage(b);
g.CopyFromScreen(this.PointToScreen(wb.Location), new Point(0, 0), wb.ClientSize);
//The bitmap is ready. Do whatever you please with it!
b.Save(#"c:\screenshot.jpg", ImageFormat.Jpeg);
MessageBox.Show("Screen Shot Saved!");