Questions tagged [events]

22734 questions
1

votes
2

answer
2.3k

Views

How to Programmatically Trigger 'Click' Event in Angular 6?

Essentially, I want to trigger the input button in the page using TypeScript
RedOne
1

votes
1

answer
1k

Views

Angular 6: Send click event in child to parent

EDIT: It still don't work and not throw any errors. I edited the code and added partial code from parent.component.ts I have parent component of a side nav-bar and child component which is nested in parent component's body and contains iframe. I want that when there's a click event on the iframe, I'...
Ofir Sasson
0

votes
2

answer
13

Views

How do I add onChange events to a list of elements, that will update the HTML with current values?

I want to (programmatically, of course) add an event listener to a list (array of objects) of HTML input fields that will fire a change event but provide the value that is currently in the input and not what was in the input fields at the time the function that does the adding of events, runs. After...
BlackRece
0

votes
1

answer
130

Views

Android Push notifications not working when app is closed

I'm using OkSse to subscribe to my Server Sent Events. Whenever a new message is sent by the server, a notification should appear whether the app is in foreground,minimized or fully closed. The notifications work as expected when minimized or in foreground but when fully closed, this only works on s...
esteban rincon
1

votes
1

answer
39

Views

Vaadin wizard addon event fire twice

I am using Vaadin wizard addon and I have a problem with the following case: When the user only presses forward/next step, there is no problem. However, if the user wants to go to the previous step, I am accidentally adding a Button click listener to the same event(That is my assumption. I have debu...
Huskilq1
1

votes
1

answer
9.2k

Views

PyQt's QMainWindow closeEvent is never called

I'm using pyqt4 in python. When I close the QMainWindow window , its not handled by closeEvent method. Please someone tell me what is wrong with this code: from PyQt4 import QtCore, QtGui class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName('MainWindow') MainWindow.r...
Zeb
1

votes
1

answer
3.9k

Views

Event handler function to wxButton with Bind() - wxWidgets 3.0

I am trying to create a simple, basic application to start off with wxWidgets. I can already set up a frame and put menu, menu items and buttons on it and it all displays properly. However I have troubles using Bind() to attach an event handler to the button. To strip the code a bit, I have this :...
James C
1

votes
1

answer
907

Views

Event loop in Tcl

I am a beginnner in Tcl. I am trying to learn Tcl without getting involved in Tk. I came across commands like vwait and after but I was confused as most explanations involved the notion of event loop and further mostly demonstrated the concept by using Tk. I would like to understand the notion of ev...
DurgaDatta
1

votes
1

answer
654

Views

Non-blocking synchronization of streams in CUDA?

Is it possible to synchronize two CUDA streams without blocking the host? I know there's cudaStreamWaitEvent, which is non-blocking. But what about the creation and destruction of the events using cudaEventCreate and cudaEventDestroy. The documentation for cudaEventDestroy says: In case event has be...
spfrnd
0

votes
1

answer
16

Views

Issue in IE11 want flex-content-item to occupy full width same as table

Issue in IE11; I want flex-content-item to occupy width same as table with scroll bar. I tried using some flex concept but did not work. To understand where is flex-content-item I have added a red border. Now this border is available till 100%, I want it to wrap the entire table. This is working in...
Vishal Patil
1

votes
1

answer
1.3k

Views

Binding events to window in Vue.js

I am quite new to Vue.js. Recently, I have encountered an issue with attaching/detaching keyboard events to window inside one of my components. Here are my methods: created() { this.initHotkeys(); }, beforeDestroy() { this.discardListeners(); }, methods: { initHotkeys() { window.addEventListener('ke...
Goehybrid
1

votes
2

answer
27

Views

Hey! How can i solve my code which apparently isnt properly taking .key property from KeyboardEvent from browser?

KeyboardEvent has its 'predefined' value = .key depending of what key you press on keyboard but even when mine console says that i clicked certain key i cannot 'define' key value.... i tried googling solutions & defining key value on its own but nothing worked im a bit clueless at this point let can...
Michal Platko
1

votes
3

answer
38

Views

How to detect a scroll / wheel event only once in a certain period of time?

Let's say I have a scroll/wheel event like this: container.addEventListener('wheel', (e) => { const isScrollingDown = Math.sign(e.wheelDeltaY); // call some function once, don't listen for wheel event anymore // then listen for event again when done } Based on deltaY, I detect whether a user is scro...
Fabian Tjoe A On
1

votes
2

answer
51

Views

Display a div using a radio buttons

To reduce the number of lines of code I simplified my code to display three divs instead. What I want is to have a particular div displayed while hiding the other two divs depending on which radio button is checked. I'm actually following these two links Adding event listeners to multiple elements...
Spanish beginner
1

votes
2

answer
37

Views

Xamarin iOS send commands/events to other apps

Is it technically possible to send commands/events to other apps on iOS? Is there something like a system bus on iOS? Specifically, I'm interested in triggering the release button of the camera app, while open/running in order to take a shot. My thought was, maybe it's possible to generate the event...
mefiX
0

votes
0

answer
6

Views

How to detect a click outside elements when 'click' event for elements existed

I am creating a Angular directive, please help me how can detect each event for 'click' elements and 'click' outside elements in Angular(7). @Hostlistener ('click', ['$event']) onClick(){} for clicking elements(button here) @Hostlistener ('document:click', ['$event'] outClick(){} for click anyway in...
patrick
1

votes
2

answer
389

Views

How to write this crawler in javascript?

The idea is very simple: Imagine a simple white page with a form with a single input tag ( like google homepage ). When I insert a link of a blogpost in this form, then the javascript-crawler search the first image in the webpage of the blogpost ( through ajax ), show it in the white page and save i...
xRobot
1

votes
3

answer
2.1k

Views

Can you fire events with automatic properties?

I was wondering if I can use automatic properties and still be able to fire events on property changed. Here are my current classes. (The actual User class got way more properties/fields of course). public delegate void UserEventHandler(object sender, EventArgs e); public class User { public event U...
Tipx
0

votes
0

answer
6

Views

EventEmitter event not received

I have 3 files a.js the shared EventEmitter module const EventEmitter = require('events'); const myEmitter = new EventEmitter(); module.exports = myEmitter; b.js the publisher const myEmitter = require('./a'); // Perform the registration steps let user = 1; setInterval(() => { myEmitter.emit('user-r...
PirateApp
1

votes
3

answer
5.7k

Views

jquery form event listener

it is possible to make an event listener for a form, so that if one did not make an action (select any element from a list for example), the form WILL NOT submit, and eventually display an alert? thank you!
dana
1

votes
1

answer
2.5k

Views

C# - Subscribing to a ETW event channel?

I can use C#'s EventLogReader to retrieve all of the ETW events logged within a particular operational channel, using code similar to the example on this page: http://msdn.microsoft.com/en-us/library/bb671197(v=vs.90).aspx All I need to do is modify the logname string to instead point to the operati...
DaveUK
1

votes
1

answer
658

Views

Laravel-5.5 Event-Listener not working

I want to create rows in carts table for new users When they registered. For this reason, I created UserRegistered (event) and CreateNewCart(listener) classes. I read docs and watch some youtube videos then I tried what they did. But didin't work for me.. Event; public $user; public function __cons...
1

votes
0

answer
187

Views

Google analytics events showing in real-time view, but not archived

I'm using Google Analytics in Appengine. I'm tracking events server side with this code: Map map = new LinkedHashMap(); map.put('v', '1'); // Version. map.put('tid', gaTrackingId); map.put('cid', '555'); map.put('t', 'event'); // Event hit type. map.put('ec', encode(category, tru...
Giovesoft
1

votes
1

answer
221

Views

How to debug request-promise MaxListenersExceededWarning

I've been working on a set-up script for a database and this evening I began getting some MaxListenersExceededWarning warnings in my console. I debugged the warnings to be coming from specific request-promise-native calls. I initially thought it may have something to do with payload size; however th...
E.Arrowood
1

votes
1

answer
300

Views

how to unsubscribe an event with parameter(s)?

In my WPF program, I need to set aircraft failure for a flight simulation software. For example, if I click 'Fire Engine 1' button on MainWindow, private DispatcherTimer DT; private void button_Engine_1_On_Fire(object sender, RoutedEventArgs e) { SettingFailureCondition('Fire engine 1'); } Then a p...
Jeff
1

votes
0

answer
274

Views

JavaFX: detect when Node is rendered

How can I detect when a Node is rendered? I tried with this code in the controller: private boolean isRendered = false; @Override protected void layoutChildren() { super.layoutChildren(); if(!isRendered){ do_something(); } isRendered = true; } And it works quite good, but there is a bit of lag betwe...
GinoC
1

votes
1

answer
42

Views

javascript event targeting a list item but not it's elements

I have this dom and JS: var searchInput = document.getElementById('searchInp'); var suggestions = document.getElementById('suggest'); suggestions.addEventListener('click', function(evt) { var pressed = evt.target.textContent; searchInput.value = pressed; }, false); examplesomething test senten...
Tadas Blinda
1

votes
1

answer
60

Views

Good way to handle global commands with Redux?

I've got a React/Redux application where I have a number of global commands that can be called in various ways - via context menu, via shortcut, or by clicking on a button. These commands are then handled in the place relevant to the command (for example if the command is 'save', it is handled by t...
laurent
1

votes
0

answer
30

Views

FileSystemWatcher: Created event didn't fire on file creation

I have one Window service, which is watching (Subscribing) a shared location on some other server as below (Using FileSystemWatcher): _fileSystemWatcher = new FileSystemWatcher(filePath); _fileSystemWatcher.Created += FileSystemWatcher_Created; _fileSystemWatcher.IncludeSubdirectories = true; _fileS...
Karan Singh
1

votes
1

answer
119

Views

Stopping clicks on object on one stage going through to the nextStage in EaselJS / CreateJS

I have two canvases and two stages in CreateJS / EaselJS. The first stage has autoClear set to false and I am doing dynamic drawing on it starting with a stagemousedown event. The second stage uses nextStage to send mouse events to the first stage. The second stage has interface such as a Bitmap t...
Dan Zen
1

votes
0

answer
30

Views

How to send longpressed KeyEvent with Java code?

How to send longpressed KeyEvent with Java code ? I have seen some examples where they use shell commands to achieve that goal, but I want to know is there a way to do it only by Java. The idea is to send longpressed KeyEvent from the remote controller application to Android Box.
abrutsze
1

votes
1

answer
302

Views

ANGULAR - What event to detect if on pressing a key out of an input [duplicate]

This question already has an answer here: Angular 2 Global Key detection 1 answer I use Angular and i don't found who detect if on pressing key out of an input... I try this : But it does not work If you can help me! :p (Sorry for my bad english)
Kérian Pelat
1

votes
2

answer
618

Views

Should Laravel Eloquent Model observer events return the object?

For example namespace App\Observers; use App\Models\User; class UserObserver { public function saving(User $user) { $user->epoch = time(); $user->save(); // or even this return $user; // should I do this or not? } } I cannot find any good documentation about the model events when they are called...
Thomas
1

votes
1

answer
30

Views

Displaying which list item was clicked

I've been trying to wrap my head around closures in Javascript and how things are executed (or rather - in which order they are executed). Here is my example: lets say I have an unordered list of items and when I click on one of them I want to print out which item was clicked. I know the solution bu...
wasteland_
1

votes
1

answer
187

Views

Button Pass Onclick Event

I have a button.tsx with a onClick property. import * as React from 'react'; interface Props { className?: string; text: string; onClick?(event: React.MouseEvent): void; type?: string; } const submitButton = (event: React.MouseEvent , props: Props) => { event.preventDefault(); props.onClick(event);...
1

votes
1

answer
429

Views

insert event in google calender using php

I am trying to add event in Google Calendar using PHP. Following is my code: $event = new Google_Event(); $event->setSummary('Halloween'); $event->setLocation('The Neighbourhood'); $start = new Google_EventDateTime(); $start->setDateTime('2018-1-19T10:00:00.000-05:00'); $event->setStart($start)...
laurel
1

votes
1

answer
173

Views

Testing assertDispatched only works when using event helper

Registering service provider: public function register() { $this->app->singleton(CartInterface::class, function ($app) { return new SessionCart($app['session'], $app['events']); }); } Firing events within the service above: $this->events->fire('cart.added', $item); Testing the service: public functi...
rzb
1

votes
4

answer
351

Views

Zoom only when Ctrl + scrolling

I've been messing with the D3JS source code. What I want to achieve is only allow zooming with the Scrolling (Just like Google Maps), if CTRL is pressed too. I've been messing with the complete D3: https://d3js.org/d3.v4.js I was trying to achieve this around line 16556: function wheeled() { if (!fi...
CAJ69I
1

votes
1

answer
178

Views

Tooltip with own event listeners

Sorry if this is partially duplicate, couldn't find any satisfactory answer. I have a d3 graph that consists of a line with points. My points have events that make a tooltip appear/disappear, see below: var div = d3.select('body') .append('div') .attr('class', 'tooltip') .style('opacity', 0); var po...
ddsLeonardo
1

votes
0

answer
1.1k

Views

Disable or remove service worker

Hi I would like to stop or unregister the service worker in my server. Upon checking our server through chrome browser its running a service worker. I would like to stop any execution of this script or stop it on the server itself. Is there any way to stop this without renaming the service worker sc...
MadzQuestioning

View additional questions