w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How do I bring parent window in front of child modeless dialog when parent window clicked
Take out this line: Owner = Application.Current.MainWindow and you should get the behavior you want. By specifying the owner window you are keeping the child window always in front.

Categories : Wpf

How can I show alert in parent window from child popup window in javascript?
try this code <!DOCTYPE html> <html> <head> <script> function openWin() { myWindow=window.open('','','width=200,height=100'); myWindow.document.write("<p>This is 'myWindow'</p>"); refreshParent(); } function refreshParent() { window.parent.focus(); window.parent.alert("message"); window.parent.location.reload(); } </script> </head> <body> <input type="button" value="Open 'myWindow'" onclick="openWin()" /> </body> </html>

Categories : Javascript

Accessing parent window angular scope from child window
I had a similar need and had the same problem accessing the scope using angular.element. I was was able to solve it as follows though: In your main/parent controller do something like this: $scope.food = 'Mac & Cheese'; window.$windowScope = $scope; $window.open('views/anotherWindow.html', '_blank','menubar=yes,toolbar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes,personalbar=yes'); Then in the child window controller you can access $windowScope like this: $scope.parentWindow = window.opener.$windowScope; console.log($scope.parentWindow.food); An alternative to putting data directly into the scope would be to use $window scope to broadcast and/or emit events, which is the preferred way of cross-controller communication in angular.

Categories : Javascript

Disable parent window when child popup window is open
Play around with this code in the pop-up: $(window).on("blur", function(){ ... }); This will fire every time the user leaves the window. Inside the argument function you should be able to make the window regain its focus, maybe using $(this).focus() or self.focus(). I haven't tested this myself. Good luck!

Categories : Javascript

javascript/jquery : Window.open opens child window but after few seconds child window get automatically closed for some urls(for IE and chrome)
It's because this code is executed on init on https://wpc.gcsip.com/wpc/wpc page // check that this page is not in a subwindow (e.g. after a session time out) if ( window.opener ) { window.opener.location = "wpc"; window.opener.focus(); window.close(); }

Categories : Javascript

SetFocus to parent window, then back to child window
Big thanks to Hans Passant for solving this! The crash issue was due to my window handle being unreliable. I stopped storing the window handle in a variable, and instead I got it on the spot using GetParent(). I also didn't need to set focus to the current window, all I needed to do was replace my SendMessage with a PostMessage. So the new code: case WM_KEYDOWN: ...code to handle modifiers like shift, ctrl, etc... else { PostMessage(GetParent(win32Frame->getPlatformWindow ()), message, wParam, lParam); }

Categories : C++

Call JavaScript of parent window from child window
What you're looking for is a reference to the window that opened the popup window. Once you have that, you can call functions in that window, read and write variables in that window, or even manipulate its DOM. That reference is called opener. It gives you the window object for the window that opened the current window. For example, if you have a function in the original window like this: function updateMe( data ) { alert( data ); } then in the popup window you could call it like this: opener.updateMe( 'Hello!' ); Naturally, you need to make sure that updateMe() is a global function in the original page. Or if you have some object in the original page and updateMe() is a method of that object, you can still do it, as long as the object is global. e.g. in the host page: var myOb

Categories : Javascript

Redraw in parent window in child window's onPaint in mfc
One way is to just pass data to the parent window and call its Invalidate function. Then it would paint the grid lines in its own OnPaint. Or you could paint directly on the parent window from the child, but use the parent's GetDC function instead of using the child's DC.

Categories : C++

Going back from child window to parent window in Visual C++
First of all if you want to do some navigation kind of things then, Your code of going parent to child is also not work properly. Now what I suggest you is that for going from parent to child create one global variable. Like , Form2^ pp ; initialise it in constructor or create method of parent class Like, //Create method or constructor, pp = gcnew Form2(); And do your navigation Like, private: System::Void button3_Click(System::Object^ sender, System::EventArgs^ e) { this->Hide(); pp->ShowDialog(); } In this case no matter how many time you click on button3 only one instance of child class will show and hide. No your problem is that you want go back to parent window form from child window. You may achieve this using this.Parent as Form Like, priva

Categories : Dotnet

Accessing the Parent Window's Content from the child window
The root of your problem is same origin policy that won't let you observe load events for external domains. If you try this in developer console while browsing SO, everything's fine: var child = window.open( 'http://stackoverflow.com' ); child.onload = function() { alert( 'Popup loaded!' ); // Fired! }; However if you try to open a page from other domain, it fails: var child = window.open( 'http://stackexchange.com' ); child.onload = function() { // It's not gonna be fired unless you run it from stackexchange.com. alert( 'Popup loaded!' ); }; The same thing happens when you call window.open() or window.open( '' ) as it tries to load about:blank page which is out of your domain's scope and that's why your browser won't fire attached events (same for child.addEventListene

Categories : Javascript

How to get child window url from parent window using javascript
You can't detect the event precisely, but you can do a workaround and check the URL all X milliseconds. var self = this var detectsUrl = setInterval(function(){ var a = winRef.document.createElement('a'); a.href = winRef.document.URL; if (a.hostname == "www.myURL.com") { winRef.close(); clearInterval(detectsUrl); self.callback(); }; }, 1000); // Here we check every seconds

Categories : Javascript

window.close closes the postbacked child window and a copy of child window still appears
The showModalDialog method will freeze JavaScript execution on the parent window until the dialog that it opens has closed, so we can rule out that as the reason why your second window opens. When FileUpload.aspx posts back from the server, it should work the same way as modeless aspx postbacks. I think you should be able to get rid of the window.open() method and you should be fine. Parent window: window.showModalDialog("FileUpload.aspx", "FileUpload", "center:yes;resizeable=yes;dialogHeight:300px;dialogWidth:600px;"); The Child window will call this when it's done. window.close();

Categories : Javascript

Losing the elemets/objects identity of same objects in parent window when renavigating from child window
When u navigate from the parent window a stale element reference exception is thrown each time you interact with the previously found web elements. In this case, although the replacement elements may look identical they are different; the driver has no way to determine that the replacements are actually the same or what's expected. If the element has been replaced with an identical one, a useful strategy is to look up the element again. To learn more, read this.

Categories : Selenium

My inputcommand keybinding to main window does not work when child window is focussed(same wpf window)?
The key bindings will only work if the Form is focused. You could redirect every Command in your new Window to the Main Window Change your Constructor to of the new Window to accept a Main Window and save this window: MainWindow mainWindow; public Window(MainWindow w) { mainWindow = w; } Whenever a Keybinding executes just do something like this: mainWindow.TabPress(); And show the Window with Window childwindow = new Window(this) { Title = "ChildWindow", Width = 200, Height = 300 }; childwindow.Show();

Categories : C#

When opening a 'child window' from the main site do i have to create an HTML page for each child window or is there a way to make it generate its own?
Using "popup" windows can be troublesome.. some browsers will not open them properly due to their internal "popup blockers" but to answer your question. if you set the URL of the window to the image itself it should load in the window without the need for a page. i.e. http://www.example.com/img/myimage.jpg A better way to do this would be using a javascript library such as jQuery and jQuery-UI to open modal overlays.

Categories : Javascript

In Tkinter How do I make a child window that closes the parent but shows all the widgets in the child?
The basic idea is to start with a containing frame, and then "stack" all of your screens on top of each other. Then, to show a specific screen you simply raise it to the top of the stacking order. Here's an example: import Tkinter as tk class Screen(tk.Frame): '''This defines one "screen"''' def __init__(self, parent, label): tk.Frame.__init__(self, parent) l = tk.Label(self, text=label) self.entry = tk.Entry(self) l.pack(side="top", fill="x") self.entry.pack(side="top", fill="x", padx=20) self.entry.insert(0, "this is the entry for " + label) class Example(tk.Frame): '''This is the main application''' def __init__(self, *args, **kwargs): tk.Frame.__init__(self, *args, **kwargs) # an array of screens, a

Categories : Python

How to effect change from child to parent window
Opening the child window from the parent window: private void Button_Click_1(object sender, RoutedEventArgs e) { var window = new ChildWindow(); window.buttonNo.Click += buttonNo_Click; window.Show(); } In the code of the parent window, include this click event for the child window's no button: private void buttonNo_Click(object sender, RoutedEventArgs e) { //code to uncheck the checkbox goes here } This turned out even simpler than the solution for Windows Forms that I've been using...and it appears to work in Windows Forms as well.

Categories : C#

Prevent the child window from moving together with its parent
Check out WS_EX_TOOLWINDOW style, that is intended for floating things. And CCS_NOPARENTALIGN and the other styles around it.

Categories : C++

WPF Bind child window context to parent
Is it possible to remove the code tracking the selected item just launch the child window without a parameter? I would strongly recommend you to show the details in the same window, from user experience point of view it would be preferable. you can use a page or contentControl to show the detailsWindow data. in that case it would be easy to achieve what you are looking for, all you would have to do is bind the ContentControl.dataContext to listviewSelected item. otherwise if you just have to by design create a new Window you could create a singelton ViewModel which would be bound to the ListViewSelected Item and each time you will open the DetailsWindow you would access this data.

Categories : Wpf

javascript manipulate a child window from his parent
In this specific case, why don't you simply try: window.open("https://www.youtube.com/", "otherW", "width=500, height=500, top=50, left=20, resizable"); this should not interfere with the same-origin policy.

Categories : Javascript

attach Child Window at the bottom of it's Parent
Use MoveWindow, the X and Y parameters are not absolute coordinates but are relative to the upper-left corner of the parent window's client area.

Categories : C

Delphi. Show parent window from child
I think you've used the wrong event. You appear to be showing and hiding the form. So you want to attach the event to OnHide rather than OnClose. It's also a mistake to call Show on Parent. The Parent of a windows control is it's containing control. For example when you put a button inside a panel, the button's parent is the panel. In you situation you want to call Show on the other form.

Categories : Windows

Close child window from parent viewmodel wpf mvvm
With Catel (see http://www.catelproject.com/) you can close a view based on a view model. Thus closing a view means a call like this: myChildViewModel.CloseViewModel(); To show a child window: var myChildViewModel = new MyChildViewModel(); uiVisualizerService.Show(myChildViewModel);

Categories : C#

How to make Parent window unrelative to child dialog
Did you try alwaysRaised=yes option? Check if this works for you: <head> <script type="text/javascript"> function OpenModeless () { if (window.showModelessDialog) { // Internet Explorer showModelessDialog ("modeless.htm", window, "dialogWidth:300px; dialogHeight:200px;"); } else { window.open ("modeless.htm", "","width=300, height=200, alwaysRaised=yes"); } } </script> </head> <body> First open a modeless dialog with this button: <button id="modeless_button" onclick="OpenModeless ();">Open a modeless dialog!</button> </body>

Categories : Javascript

iOS: Passing javascript variable from child to parent window
You could try using localStorage or sessionStorage to store the variable you need passed between the two windows. I doubt that you could do anything else but pass variables as you can only have one "tab" open at a time in iOS. Alternatively, you could use PHP and pass the variable as a GET in the url http://myurl.com/page.php?myvar=blah and retrieve it that way.

Categories : Javascript

How to pass parameter from child model window to parent viewModel
Here you can see example how can we do this ..Let us suppose public void createReorderModal(Component comp) { Map args = new HashMap(); List list = new ArrayList(); list.add("test"); args.put("availableList", list ); Executions.getCurrent().createComponents("/core/component/model_window.zul",comp, args); } Now in model_window.zul have a own ViewModel ,now in this viewmodel's afterCompose method write below code,to get argument passed in previous step. @AfterCompose public void doAfterCompose(@ContextParam(ContextType.VIEW) Component view, @ExecutionArgParam("availableList") List list) { //Your Business logic } Now how you will pass the data from child modal Window to main Window , for that you have create a button in your child Window l

Categories : Java

Better way to pass many form input values from child to parent window
You have lots of options. The parent window's window object is available to you (as you've found) via window.opener. The child window's window object is also availble to the parent, it's the return value of window.open. So the two can talk directly. This means you can... ...assign values to the parent directly, or (ideally) to an object it makes available on that for the purpose. In the parent: window.results = {}; In the child: opener.results.name = "value"; opener.results.anotherName = "another value"; ...or have the child window call a function on the parent: opener.callback(/*...values here...*/); ...passing in individual values, or an object, etc. ...or have the parent window reach out and interact directly with the child's controls (but that creates a lot of tight couplin

Categories : Javascript

Show output from child scripts in the parent console window
You should try to use .Exec and .Stdout.Readline() as in this bare bone demo script: mother.vbs Option Explicit Dim oWS : Set oWS = CreateObject("WScript.Shell") WScript.Echo "A", "mother starts child" Dim oEx : Set oEx = oWS.Exec("cscript child.vbs") Do Until oEx.Stdout.AtEndOfStream WScript.Echo oEx.Stdout.ReadLine() Loop WScript.Echo "B", "mother done" child.vbs: Option Explicit Dim n For n = 1 To 5 WScript.Echo n, "child" Next output: cscript mother.vbs A mother starts child 1 child 2 child 3 child 4 child 5 child B mother done Added: see Pythonic version

Categories : Vbscript

pyGTK how to redisplay a top level window (with child widgets) after window destroy signal is sent
Have you tried making another copy of the window class and showing that one instead? Note: This will reset anything that was set in the window. i.e. if a person did something to make label1 say 'Hi!' instead of 'Hello!', it is going to be reset again to 'Hello!', since you are recreating the window.

Categories : Misc

Closing a process child window (e.g. a Word window) accessing a specific file
I found this very detail post about the subject, maybe it can help you http://forum.sysinternals.com/howto-enumerate-handles_topic18892.html That post hase some disucussions and related questions here http://forum.sysinternals.com/topic19403.html

Categories : C#

Javascript Window.Open how to obtain the opened child window from a different page
First its seen little bit tricky.. you declare some ajax function to send information to server whether child window opened or not.. if child window opened then refresh page. for E.g . -> assume that user opened 2 same page In different tabs1 and tab2. -> user opened opened popup window on tab2 and add/change some information.. -> tab2 content refresh as per ur event. you should also send a one flag to server with session id and tab1 continuous check is that any changes happed to server it will be refresh..

Categories : Javascript

Opening a child dialog window from a main window with Pyside
If your MainWindow have a Menu action named actionAbout, and a slot called openAbout, all you need to do is connect the triggered signal from the actionAbout to the slot openAbout. self.actionAbout.triggered.connect(self.openAbout) The process is similar to what have you done with the pushbutton. Just change the names used in this example with the ones in your application.

Categories : Python

How to execute main window key binding when child window is focussed in wpf?
WPF Behavior: Global Application Shortcut Keys Seems to be what you're looking for. I made a couple small modifications to the author's code to get your required functionality(rather than passing in an InputBindings collection, made the Behavior pick it from the AssociatedObject directly. Also took out the restriction for requiring modifier keys, Although I suggest you do read through the author's notes in the article and incorporate it to your requirements) Sample download for your requirements ^^ I could get your required behavior, however do go through the Behavior<T> to see if you can optimise it better for yourself(only bit's I actually looked into was just stuff relating to your specific requirement.)

Categories : C#

Load another window in background; when rendered, close the parent window
Changed code to: InitWindow I = null; Thread C = null; public InitWindow() { InitializeComponent(); I = this; C = Thread.CurrentThread; Thread T = new Thread(() => { MainWindow M = new MainWindow(); M.Show(); M.ContentRendered += M_ContentRendered; System.Windows.Threading.Dispatcher.Run(); M.Closed += (s, e) => M.Dispatcher.InvokeShutdown(); }) { IsBackground = true, Priority = ThreadPriority.Lowest }; T.SetApartmentState(ApartmentState.STA); T.Start(); } void M_ContentRendered(object sender, EventArgs e) { // Making the parent thread background C.IsBackground = true; // foreground the current thre

Categories : C#

Gray and disable out the parent window as soon as pop up window is opened
Updated fiddle from answer in this question with iframe support http://jsfiddle.net/LT5JC/ Open function is rather simple function open(url) { $('#block').fadeIn(); // show grayed pane $('#iframe').attr('src', url); // update src of iframe $('#container').fadeIn(); // show container with iframe }

Categories : Javascript

How to pass data from Parent html window to pop-up window
You forgot to call transferText() :) After I called transferText() the text was transferred... <html> <head> <script type="text/javascript"> function init() { popupWin = window.open('','popupWin',''); popupWin.document.writeln('<html><head><title>test</title></head><body><form><input type="text" id="popupTextBox"/></form></body></html>'); popupWin.document.close(); popupText = popupWin.document.getElementById("popupTextBox"); parentText = document.getElementById("parentTextBox"); transferText(); } function transferText() { popupText.value = parentText.value } </script> </head> <body> <input type="text" id="parentTextBox"/> <input type="button" onclick=

Categories : Javascript

How to reload the parent window from a pop-up window by calling a JS function?
Window Launcher: <script type="text/javascript"> function launch() { window.open('opened.html'); } </script> <a href="#" onclick="launch()">Launch!</a> Launched Window: <script type="text/javascript"> function reload_parent() { parent.window.opener.document.location.reload(); } </script> <a href="#" onclick="reload_parent()">Reload!</a> This kind of problem does not lend itself nicely to jsfiddle.net, and can't be done on file:/// domain due to cross-domain security problems, so you will have to actually run a server to host this. localhost is fine. I have hosted it myself here for you to see: http://framba.ch/opener.html

Categories : Javascript

Is it possible to receive messages from a parent window which is NOT the main window?
If a control is a child of a tab (or any other control) then it's the tab that will get notification messages like WM_COMMAND. It's easiest to make your controls all children of your main window and just fix the z-order to make them appear in front of the tab (you already have WS_CLIPSIBLINGS set on the tab control, which you would also need). If you leave the controls as children of the tab then the only way to get notification messages is to sub-class the tab. Or, you can do this the way property sheets do it, and use child dialogs (a dialog with the DS_CONTROL style set) to host the tab content. Then you can have a separate dialog procedure that handles messages from the child controls, and it makes it easy to show/hide a whole page of controls rather than handling them all individual

Categories : C++

How to redirect to parent window after logging in from iframe window?
As long as the links (within the iFrame) are part of the other page, you can't "hijack" their target. You would have to have the means and ability to modify the target attribute of each link to point to _parent or use javascript to reference the window.parent. Based on what you're saying (you're logging in to a different domain and the page is not part of your site) this wouldn't be possible without implementing some kind of proxy where you could modify the contents between page visits.

Categories : Javascript

Updating wpf parent window after some action on another window
Do insert operations inside main window (UserManagmentWindow): UserManagmentWindow.cs: // Inside add button handler open adduser window as dialog box... var result = adduser.ShowDialog(); if(result == true){ // user pressed OK button... // insert new user in database // refresh UserManagmentWindow } Post your code if you need more details...

Categories : C#



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.