Extjs - Ext.Window: Having trouble passing values to new window |
initComponent is called only once, and that's when the component is
created. And that's before you set all your properties...
You should use the form setValues method to update the form's data. So your
method should look like this:
showWithData : function(aId, message, start, end, active) {
var formPanel = this.down('form'), // get a ref to the FormPanel
component
form = formPanel.getForm();
form.setValues({
announcementId: aId,
announcement: message,
...
});
this.show();
}
|
Window message WM_SIZING sending incessantly when window resizing |
You could just process N messages before each frame.. where N is a limit
you set between 1-10. That way you can process a reasonable number of
events, then get onto your actual game logic.
It's conceivable that Windows may just generate the 'window sizing' message
continually when the queue is empty, to make sure applications are aware
the window is being resized.
(Maybe MS think applications might not know, maybe there's nothing else the
user can do.. so MS want to hammer that single message.)
|
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();
|
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();
}
|
open the link from the popup window in an external window and then close the original popup window |
Try
<input name="Apply Online" type="button" id="Apply Online" value="Apply
Online" ONCLICK="window.location.href='some_url';$.colorbox.close();">
or
<input name="Apply Online" type="button" id="Apply Online" value="Apply
Online"
ONCLICK="window.location.href='some_url';parent.$.colorbox.close();">
|
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();
|
Trouble with window.open |
The document must exist; if you're trying to access it before it exists, of
course it will not be an instance of anything. Otherwise HTMLDocument is
not the HTMLDocument that you want to check that newWindow.document is an
instanceof, you actually want to test against newWindow.HTMLDocument
newWindow.document instanceof HTMLDocument; // false
newWindow.document instanceof newWindow.HTMLDocument; // true
|
trouble passing php variable to modal window |
In your get call you have id equal to the literal varid. Instead maybe
$.get('modal_window.php?id=' + varid, function(data){
modal.open({content: data});});
e.preventDefault();
});
|
Sending a paste command to a specific X11 window |
try xte & wmctrl packages... Using wmctrl, you can focus any specific
window & using xte, you can fake keystrokes.
Based on title, you can focus any window, using wmctrl.
They add some time delay, if required
Send keystrokes using xte
Check the man-pages for syntax.
|
trouble figuring out how to open a new window in tkinter "attribute error" |
Pass root, not self when call Toplevel: Toplevel(root). Or omit argument:
Toplevel()
from tkinter import *
import random
player_dice = []
class App:
def __init__(self, master):
for i in range(1,6):
x = random.randint(1,6)
player_dice.append(x)
self.label = Label(master, text = x , fg = "red").grid(row =0,
column =i+1)
self.label = Label(master, text = "Dice:" , fg = "red").grid(row
=0, column =1)
self.hi_one = Button(master, text="one",
command=self.say_one).grid(row = 1, column = 1)
def say_one(self):
print ("1")
window = Toplevel(root) # self -> root
self.label = Label(window, text = "you selected one" , fg =
"red").grid(row =3, column =3)
root = Tk()
app = App(root)
root.mainloop()
|
JavaScript - Try & Catch - Trouble Capturing Window.postMessage() Errors |
Looks like it is outlined in the HTML5 spec that if the domain origins do
not match then no error is thrown and it should abort silently.
http://www.whatwg.org/specs/web-apps/current-work/multipage/web-messaging.html#web-messaging
10.4.3 Posting messages - Part #9
"...if the targetOrigin argument is an absolute URL, and the Document of
the Window object on which the method was invoked does not have the same
origin as targetOrigin, then abort these steps silently."
|
Sending a message to a window that belongs to another thread. Possible Deadlock? |
I don't think there is any deadlock here.
start_game = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadStartGame,
(LPVOID)&myWindow, 0, NULL);
This line passes the address of the HWND to the thread (&myWindow)
HWND w = (HWND)param;
This line uses the adress itself as HWND and the SendMessage sends the
message to this address which is not a HWND.
Try modifying to
start_game = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadStartGame,
(LPVOID)myWindow, 0, NULL);
|
Locking the size of a resizable window to the original aspect ratio of the window in Pyglet |
Although this looks a little hackish for me, but at the moment I don't
think of any other possibilities to solve you problem. Anyway, this is
working:
import pyglet
window = pyglet.window.Window( resizable=True )
@window.event
def on_resize( width, height ):
ratio = 9/16
window.set_size( width, width*ratio )
@window.event
def on_draw():
window.clear()
pyglet.app.run()
|
Why does Internet Explorer fire the window "storage" event on the window that stored the data? |
Microsoft seems to be aware of the issue, but it doesn't look like they're
going to fix it any time soon:
https://connect.microsoft.com/IE/feedback/details/774798/localstorage-event-fired-in-source-window
One option is that you can design your listeners and setters so that they
don't react or store when they get information from a storage event that's
already consistent with their state. However, this design pattern can be
more difficult than relying on the storage event only firing on other
windows.
Another option is to make local storage work the same way in IE that it
works in other browsers. I came up with an admittedly hacky but functional
solution that I tested in IE10 and expect to work in IE8 and IE9. My
javascript components don't listen to the window "storage" event directly
bu
|
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
|
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.
|
how we can restrict user to click or go on the browser window until they close the opened pop up window? |
You basically need a modal pop-up. This link should help you:
http://www.codeproject.com/Tips/589445/JavaScript-Modal-Popup-Window
|
window.URL || window.webkitURL not working with Safari browser version prior 5 |
The window.URL APIs are not supported on Safari 5. Take a look at the table
here: http://caniuse.com/#search=createObjectURL
Only the most recent versions of current browsers support the API.
|
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..
|
For Chat window.whether i go for dynamic user control or client side div tag pop up window? |
I helped write and maintain a simple chat window in ASP.Net WebForms a
while back, the way we did it was to use some simple JavaScript making some
HTTP requests to a page which had WebMethods on it.
The C# page contained a WebMethod for getting new messages from the server
which was called from JavaScript running on a setTimeout loop. It also
contained a WebMethod for adding new messages to the session.
If I recall correctly, some kind of queue was used per user involved in the
chat session and all the method for getting new messages did was to map the
user to the correct queue and take all the messages that were present at
the time.
Hopefully this helps.
|
How to call enlarge-window function depends on current window in Emacs |
Taking advantage of windmove being part of emacs, this is what you can do:
(require 'windmove)
(defun move-separator-up (arg)
(interactive "p")
(if (< (cdr (windmove-other-window-loc 'up)) 0)
(shrink-window arg)
(enlarge-window arg)))
(defun move-separator-down (arg)
(interactive "p")
(if (< (cdr (windmove-other-window-loc 'up)) 0)
(enlarge-window arg)
(shrink-window arg)))
When you have 3 windows, enlarge-window and shrink-window rules might not
do always what you want, so some further customization might be needed.
|
How do I detect if a new window has been opened? The window opens via a submit with target="_blank" |
My recommendation would be to check beforehand if the user is using the app
and then modify the behavior based on that, rather than checking if a new
window opened. I have in the past accomplished this by checking the
screen.width property (can be similarly accomplished in CSS), but you can
do it more cleanly (courtesy of this post's answer):
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera
Mini/i.test(navigator.userAgent) ) {
// some code..
}
This is cleaner, as you can determine at load time whether you'll need to
open in the current window or a new window, rather than reacting later to
something that happens for the user.
|
Keeping slide-out div flush with left side of window upon window resize |
Simply add:
$(window).resize(function(e) { if ($("#slideout").css('left') != '0px')
$("#slideout").css('left', -($("#slideout").width() - 15)); });
http://codepen.io/anon/full/rjaHD
|
How I can see the width & height of my window on the "body" when I am modifying the size of the window with jquery? |
Like that? DEMO http://jsfiddle.net/yeyene/5ANZz/1/
$('#width').val($(window).width());
$('#height').val($(window).height());
$(window).resize(function(){
$('#width').val($(window).width());
$('#height').val($(window).height());
});
|
Jquery .scroll() not working in IE with both $(window) and $(document). (issue with window.pageYOffset?) |
From the MDN docs:
For cross-browser compatibility, use window.pageYOffset instead of
window.scrollY. Additionally, older versions of Internet Explorer (<
9) do not support either property and must be worked around by
checking other non-standard properties.
You could always use jQuery's implementation of scrollTop(), it should work
for all browsers:
$(window).scroll(function() {
var y_scroll_pos = $(this).scrollTop();
var scroll_pos_test = 200;
if(y_scroll_pos > scroll_pos_test) {
$('.extratext').slideDown('slow');
}
});
|
Can I interact with the current debugging session variables using C# Interactive window or Immediate window? |
You could use linq to do anything you can do in a loop because it is
evaluated as an expression
for example
R.Where(item => item != R[0]);
Will show you all items not equal to the first item.
Here is why you can do anything with a linq expression:
Enumerable.Range(1,1).Select(one => {
// any function code you want here
//return any type of variable.
});
|
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>
|
Android Crash, java.lang.IllegalArgumentException: Window type can not be changed after the window is added |
check Androidmanifest.xml
<uses-sdk //************
android:targetSdkVersion="X"/>
X must be less than 14 Or remove this attribute.
good luck guy.
|
Close a tkinter progressbar window while matplotlib window is open |
You are getting conflicting gui-main loops between the TK you are starting
and the TK that plt is start. If you want to use matplotlib with your own
gui, you must embed it your self and you can not import pyplot. All the
behind the scenes magic that makes the pyplot interface wonderful is what
is messing you up here.
For a tutorial see here, for how mpl does the embedding see here.
Also see:
Unable to save matplotlib.figure Figure, canvas is None
Python Matplotlib runtime error upon closing the console
Matplotlib bar chart in a wx Frame instead of a new window
|
window.focus to bring main window in front of popup |
According to that post, window.focus() won't work on Chrome because it is
disabled. It might be the same for Safari.
|
how to show data store grid on ext.window.window.modal |
Remove width attributes from the modal grid. You cant specify width in %
and if your containing parent has fit layout it doesn't matter anyway.
Wrap items in an array: items: [modal_pp]
|
Window instances - how to get my main window canvas inside other class? |
Since you do not want to pass your Canvas around as a parameter, you could
try creating an Extension Method which would act on your Canvas Object.
namespace CustomExtensions
{
public static class Shapes
{
public static Ellipse SomeCircle(this Canvas dest)
{
Ellipse e = new Ellipse();
double size = 10;
e.Height = size;
e.Width = size;
e.Fill = new SolidColorBrush(Colors.Orange);
e.Fill.Opacity = 0.8;
e.Stroke = new SolidColorBrush(Colors.Black);
dest.Children.Add(e);
return e;
}
}
}
Usage remember to add the CustomExtensions Namespace to your usings.
canvas1.SomeCircle();
|
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.
|
How to find xpath of an element in a window that's inside another "frame window" |
You have to switch control to inside the iframe and then try and interact
with the webelement
iframe = driver.find_elements_by_tag_name('iframe')[0]
driver.switch_to_frame(iframe)
and to come out of the iframe back to the main window
driver.switch_to_default_content()
|
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!
|
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.
|
How to write a popup window to pass the password to main window? |
Here is a Demo of how you could proceed for a custom popup & get the
password:
HTML:
<div id="popup">
<div>Enter Password:</div>
<input id="pass" type="password"/>
<button onclick="done()">Done</button>
</div>
<button onclick="showPopup()">Show Popup</button>
STYLE:
#popup {
width:160px;
height:80px;
padding:20px;
background-color:gray;
position:absolute;
top:100px;
left:100px;
display:none;
}
SCRIPT:
function done() {
document.getElementById("popup").style.display = "none";
var password = document.getElementById("pass").value;
//DO STUFF WITH PASSWORD HERE
};
function showPopup() {
document.getElementById("popup").style.display = "block";
}
|
appending a script to head on both window.width and window.resize |
Could you tell me if this code, to place in a javascript tag, works ?
function appendScript(stickname){
var head = document.getElementsByTagName("head")[0];
var js = document.createElement("script");
js.type = "text/javascript";
js.src = "site/js/" + stickname + ".js";
head.appendChild(js);
}
(function(){
if ($(window).width() >= 768) { appendScript("stick");}
else {appendScript("stick-mobile")}
$(window).resize(function() {
if ($(window).width() >= 768) { appendScript("stick");}
else {appendScript("stick-mobile")}
});
})();
And just a question: in appendScript(), shouldn't you also removeChild(...)
the previous scripts ? And for that add a class on your script elements, to
differentiate them ?
|
How to change position of window controls relative to the window size |
Not necessarily the best way, but what I'd probably do is handle WM_SIZE
and/or WM_SIZING and then in there use :
m_Button.SetWindowPos(x, y, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
where x and y are the new co-ordinates of the top-left of where you want
your button.
|
ExtJS 4.1: Modal Window seems to return control before submitting the window |
The store load is asynchronous, you need to wait til it completes before
you can filter the data set on the client:
store.on('load', function() {
store.filter();
}, null, {single: true});
store.load();
|