473,803 Members | 3,095 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

User-Defined and/or User-Triggered Events

Hi,

Here I mean "User" in the Programmer or Javascript sense. I merely wish to
programmaticall y trigger an Event. It would be absolutely fantastic if there
was a (Form level?) ONUSEREVENT() and a setEvent() function but, in the
absence of this, is it not possible to use DOM to change an object's
properties resulting in a state-change event?

I have tried with ONCHANGE() and that only seems to work if the
"interactiv e" user changes the contents (i.e.
document.form.f ield.value="bla h"; does not resuly in an ONCHANGE event.
Before I go through each event and property can someone tell me if it is at
all possible to use .select()/onselect or .focus()/onfocus (or anything!) to
queue an Event for processing?

Cheers Richard Maher


Mar 2 '07 #1
5 4383
Hi,

FWIW, If you use an object's .focus() method then it's ONFOCUS() event will
be triggered when you return from your current event processing. Any others?

Cheers Richard Maher

"Richard Maher" <ma******@hotsp amnotmail.comwr ote in message
news:es******** **@news-01.bur.connect. com.au...
Hi,

Here I mean "User" in the Programmer or Javascript sense. I merely wish to
programmaticall y trigger an Event. It would be absolutely fantastic if
there
was a (Form level?) ONUSEREVENT() and a setEvent() function but, in the
absence of this, is it not possible to use DOM to change an object's
properties resulting in a state-change event?

I have tried with ONCHANGE() and that only seems to work if the
"interactiv e" user changes the contents (i.e.
document.form.f ield.value="bla h"; does not resuly in an ONCHANGE event.
Before I go through each event and property can someone tell me if it is
at
all possible to use .select()/onselect or .focus()/onfocus (or anything!)
to
queue an Event for processing?

Cheers Richard Maher


Mar 3 '07 #2
VK
On Mar 3, 3:09 am, "Richard Maher" <maher...@hotsp amnotmail.com>
wrote:
Hi,

Here I mean "User" in the Programmer or Javascript sense. I merely wish to
programmaticall y trigger an Event. It would be absolutely fantastic if there
was a (Form level?) ONUSEREVENT() and a setEvent() function but, in the
absence of this, is it not possible to use DOM to change an object's
properties resulting in a state-change event?

I have tried with ONCHANGE() and that only seems to work if the
"interactiv e" user changes the contents (i.e.
document.form.f ield.value="bla h"; does not resuly in an ONCHANGE event.
Before I go through each event and property can someone tell me if it is at
all possible to use .select()/onselect or .focus()/onfocus (or anything!) to
queue an Event for processing?
Firefox: createEvent / dispatchEvent
IE: createEventObje ct / fireEvent

Mar 3 '07 #3
VK wrote :
On Mar 3, 3:09 am, "Richard Maher" <maher...@hotsp amnotmail.com>
wrote:
>Hi,

Here I mean "User" in the Programmer or Javascript sense. I merely wish to
programmatical ly trigger an Event. It would be absolutely fantastic if there
was a (Form level?) ONUSEREVENT() and a setEvent() function but, in the
absence of this, is it not possible to use DOM to change an object's
properties resulting in a state-change event?

I have tried with ONCHANGE() and that only seems to work if the
"interactive " user changes the contents (i.e.
document.form. field.value="bl ah"; does not resuly in an ONCHANGE event.
Before I go through each event and property can someone tell me if it is at
all possible to use .select()/onselect or .focus()/onfocus (or anything!) to
queue an Event for processing?

Firefox: createEvent / dispatchEvent
dispatchEvent is just to dispatch the event to the target element.
http://www.w3.org/TR/2000/REC-DOM-Le...-dispatchEvent

DOM 2 Events initMouseEvent, createEvent and initEvent are what the OP
might (not sure) be looking for.

http://www.w3.org/TR/2000/REC-DOM-Le...vent-initEvent

http://www.w3.org/TR/2000/REC-DOM-Le...nt-createEvent

http://www.w3.org/TR/2000/REC-DOM-Le...nt-initUIEvent

Gérard
--
Using Web Standards in your Web Pages (Updated Dec. 2006)
http://developer.mozilla.org/en/docs...your_Web_Pages
Mar 4 '07 #4
Richard Maher wrote :
Hi,

Here I mean "User" in the Programmer or Javascript sense. I merely wish to
programmaticall y trigger an Event. It would be absolutely fantastic if there
was a (Form level?) ONUSEREVENT()
It depends. You have not given a lot of details here. Which form
control? Which user action? What kind of behavior? It could be, just a
guess, that you are looking for DOMActivate event.

and a setEvent() function but, in the
absence of this, is it not possible to use DOM to change an object's
properties resulting in a state-change event?

No details. No specifics. No url. No general description of what you are
actually looking to accomplish in a given webpage, having a specific
issue or something.
I have tried with ONCHANGE() and that only seems to work if the
"interactiv e" user changes the contents
change the contents: it could be that you are looking for mutation
events here.

(i.e.
document.form.f ield.value="bla h"; does not resuly in an ONCHANGE event.
Before I go through each event and property can someone tell me if it is at
all possible to use .select()/onselect or .focus()/onfocus
onselect can be used only on input text form control and on textarea. If
you want to highlight a particular string on a webpage, that's a
different story. onfocus on a lot of element but not on any/all HTML
elements.
(or anything!) to
queue an Event for processing?
Not possible to queue an event really. Again, some of your questions
would be easier to answer if we knew exactly what you are trying to do:
general description, overview, which form control, what user action, etc.

Gérard
--
Using Web Standards in your Web Pages (Updated Dec. 2006)
http://developer.mozilla.org/en/docs...your_Web_Pages
Mar 4 '07 #5
Hi VK, Gerard,

Thanks for the replies. Please see below.

"Gérard Talbot" <ne***********@ gtalbot.orgwrot e in message
news:12******** *****@corp.supe rnews.com...
Richard Maher wrote :
Hi,

Here I mean "User" in the Programmer or Javascript sense. I merely wish
to
programmaticall y trigger an Event. It would be absolutely fantastic if
there
was a (Form level?) ONUSEREVENT()

It depends. You have not given a lot of details here. Which form
control? Which user action? What kind of behavior? It could be, just a
guess, that you are looking for DOMActivate event.

and a setEvent() function but, in the
absence of this, is it not possible to use DOM to change an object's
properties resulting in a state-change event?


No details. No specifics. No url. No general description of what you are
actually looking to accomplish in a given webpage, having a specific
issue or something.
I have tried with ONCHANGE() and that only seems to work if the
"interactiv e" user changes the contents

change the contents: it could be that you are looking for mutation
events here.

(i.e.
document.form.f ield.value="bla h"; does not resuly in an ONCHANGE event.
Before I go through each event and property can someone tell me if it is
at
all possible to use .select()/onselect or .focus()/onfocus

onselect can be used only on input text form control and on textarea. If
you want to highlight a particular string on a webpage, that's a
different story. onfocus on a lot of element but not on any/all HTML
elements.
(or anything!) to
queue an Event for processing?

Not possible to queue an event really. Again, some of your questions
would be easier to answer if we knew exactly what you are trying to do:
general description, overview, which form control, what user action, etc.

Gérard
--
Using Web Standards in your Web Pages (Updated Dec. 2006)
http://developer.mozilla.org/en/docs...your_Web_Pages
Let me try to explain; painful experience coupled with the lack of responses
to my other "Stop! Button" thread has led me to the belief that it is simply
not possible (within the constrains of a Web Browser html,Javascrip, DOM) to
implement a a hot-abort or "Stop!" button that could interrupt, or bypass,
an ONevent long enough to use an Applet method to send an OOB character down
the socket, so that my server knows to stop what it's doing.

[Actually, it's a lot worse than that! The ludicrous state of affairs
witnessed just now on my IE6 Windows2000 session is that, whilst an ONevent
is currently executing my JS function, not only can I not press one of *my*
form buttons but the Global IE STOP button is also disabled and whatsmore is
if I try to close the bloody browser, Windows says "The program is not
responding" do I wish to kill it :-( And yes I have induced extended delays
with timed waits; elapsed-time is not the norm or expected behaviour.]

So, in desperate search of Plan B, I decided to look at the idea of
surrendering the event thread as often as possible so as to give all the
other events a window of opportunity to get on the event
stack/que/whateveryoucall it. This is how I'd imagine it "working": -

I send the work request down the socket via my applet. Now, instead of just
blocking on the Read I create a new applet method that does a
inputstream.ava ilable() and if I don't have enough bytes then I
fireEvent(this) and RETURN. If there are enough bytes then I continue with
the Read and process the server message then go again till EOF. Would it
work?

The main problem I have with it is the whole idea of polling is completely
anathema to me! I know PC people (and especially many web pages) do it all
the time, but it is simply badness. Having said that, would it work? Would
other events get through that tight little loop?

OK, I give up! Randy was right; just do it all in Java. When the user get's
the dialog box for username/password I'll stick another tick box that asks
if they want "CornuCopiaeCon trol". I suppose this could result in that
dangling dialog box with, in addition to a Stop button (that could change
color when it was active) I could put "Bytes sent, Bytes received, Connect
time, Username, HostName etc etc". Or I could forget the whole hot-abort
idea. Shit it was only meant to be a nice-to-have 'cos the server took
interrupts :-)

Alles klar?

Regards Richard Maher
Mar 4 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1664
by: parez | last post by:
Hi All! This is the first time i am tryin to write a sql server 2000 function. I need to clean up some of my stored procedures.. Can any one please give me skeleton for a userdefined function or correct my function. I get the following error. Select statements included within a function cannot return data to a client.
3
2039
by: Sasha | last post by:
Hi everyone, Here is my problem: I have the following classes: - DataNode - this class is designed to hold some data and will be contained in a tree like data structure DataTree. When DataNode is changed, it raises "Changed" event. The class has a reference to the DataNode it is being contained in: - DataTree - tree like data structure that contains DataNodes; When
6
13246
by: Saso Zagoranski | last post by:
Hi! How can I unregister all the events registered to a control? I have seen a piece of code in another thread, which gets all the registered handlers for a specific event. Let's say I have a CustomTextBox : TextBox, which has quite a lot of events... Do I put unregistering code for all the possible events in the Dispose method? Or is there another way?
4
22892
by: LP | last post by:
Hello! I am still transitioning from VB.NET to C#. I undertand the basic concepts of Delegates, more so of Events and somewhat understand AsyncCallback methods. But I need some clarification on when to use one over another? If anyone could provide any additional info, your comments, best practices, any good articles, specific examples, etc. Thank you
6
3174
by: newlearner | last post by:
Hi, i know we can wirte a userdefined callback function.. I had a try for a long time though i feel im near but not able to coin out the exact thing. can any body tell me about a user defined callback function... and a sample on how to write it... looking forward for a reply.. Thanks in advance for your reply...
0
3069
by: =?Utf-8?B?a3Jpc2huYQ==?= | last post by:
Hi i am getting the following error while using XMLSerializer XmlSerializer ser = new XmlSerializer(typeof(Person)); ERROR: Unable to generate a temporary class (result=1). error CS0266: Cannot implicitly convert type 'XSD.BiodataGender?' to 'XSD.BiodataRace?'. An explicit conversion exists (are you missing a cast?) I am getting the above error when my xsd has multiple nillable elements of userdefined type. If I change the type of...
14
2224
by: xoozlez | last post by:
Hi there, I have a registration form where I like to filter out the past events of 2007. This is the code I am using : strSQL = "SELECT EventID, EventName, EventDateBegin, EventDateEnd, EventTimeBegin, Category FROM Events WHERE EventDateBegin >'01/01/2008' AND Events.Category LIKE '3' OR Events.Category LIKE '4' OR Events.Category LIKE '5' OR Events.Category LIKE '6' OR Events.Category LIKE '7' OR Events.Category LIKE '8' OR...
5
2792
by: =?ISO-8859-1?Q?Norbert_P=FCrringer?= | last post by:
Hello, does anyone have for me a sample how to create an object, which has access to any form of data and can be used as a data source for data bound data grids. In my case I've got a com object (GRecordset) which should become a data source for a data grid. Thank you,
1
4911
by: swethak | last post by:
Hi, I am desiging the calendar application for that purpose i used the below code. But it is for only displys calendar. And also i want to add the events to calendar. In that code displys the events when click on that date that perticular event displyed in a text box.But my requirement is to when click on that date that related event displyed in same td row not the text box. and also i add the events to that calendar.plz advice how to...
2
1691
by: SnehaAgrawal | last post by:
Does anyone know how to call a UserDefined Function written in SQL 2000 from program(I mean I am writing code in VB.net)..I know how to call it from a stored proc. but don't know how to call from my prog. Like we call stored proc. Thnks
0
9703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9565
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10550
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10317
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10295
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7604
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6844
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4275
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2972
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.