OpenLayers: value of Event parameter in OpenLayers.Event.triggerEvent - events

I'm looking at the
documentation
for triggering events in OpenLayers. It lists triggerEvent as taking in a type:String argument and a evt:Event argument. I understand what the type parameter is, but what object is the Event object? I can't find a clear example.
If it is relevant, I am working on an interface between Google Maps v3 and OpenLayers, and I'm trying to come up with a way so that I can have a the same API interface to calls to:
google.maps.event.trigger(instance:Object, eventName:String, var_args:*)
openLayersObj.events.triggerEvent(type:String, evt:Event)

Doc is wrong. It should be Event || object. Object that will be args passed to the listeners callback.
Look at the source: https://github.com/openlayers/openlayers/blob/master/lib/OpenLayers/Events.js#L820
Example of use: https://github.com/openlayers/openlayers/blob/master/lib/OpenLayers/Map.js#L1042

Related

Event Parameters List

I am trying to understand what exactly is stored in an event using the SAPUI5 documentation here. Where can I find a list of parameters that come with an Event? For example, I just found out that DatePicker has a parameter called "valid", but how would I know that? Surely I wouldn't have to use getParameters() for every entity right? Also when you define a function to be called in XML, do they all send the same Event type?
In general the parameters depend on the intention of the event, e.g. a change event which indicates that the source object has changed its value contains other parameters than an event which informs you that a file upload has failed.
You'll find the available event parameters in API documentation. To stick with your example: Check the API documentation of the DatePicker control, select the change event from the available events and check the available parameter. You will find the parameter valid with a description. To see the difference between the events you may also check the ListBase implementation, which defines a bunch of events.
It is good style to use getParameter in your event handler to access the parameters values.
onDatePickerChanged : function(event) {
let validDate = event.getParameter("valid");
}

Is it possible to pass an API Gateway variable into a Lambda Context?

I'd quite like to be able to use context.stage in a Lambda call, passed in from the API gateway context - but I can only see how to put it into the message body (event object).
Is there any way to add arbitrary information to the Lambda Context?
I believe your only option is to add it to the event. You can always extract the value at the start of your Lambda function and then delete the property.
The Rest API example from AWS does something similar:
var operation = event.operation;
delete event.operation;

How to get object specific events using Box Api

I am having difficulty getting the events for a specific object. Basically I would like to have an event collection that reprents the "Access Stats" when looking at a file's properties on box.com. The only way I can figure to do it now is to run through all events in the stream and manually build the collection. Is there not an endpoint I can use or a query filter I can put on the events endpoint to accomplish this?
Thanks
Shawn
This is something our fields parameter would help with, but it's not yet GET /events. Keep an eye on this portion of our documentation for when support for this is available. http://developers.box.com/docs/#fields

get process(e.g. TextEdit) as an object in cocoa

I am a newbie and i want to get a process or a key window as an object as i need to send message to it.In fact , i need to get them so that i can manipulate them with my input method kid(IMKit).
The corresponding method is:
-(BOOL)inputText:key:modifiers:client:
I want the key window/process receive the event as client.
I am appreciated if anyone can help.
i want to get a process or a key window as an object as i need to send message to it. … the corresponding method is
-(BOOL)inputText:key:modifiers:client:
You have it the wrong way around. As noted in the documentation, that method is one that you implement, in your input method. Your input method does not send that message; it receives it. And all you do in that method is accept or veto the input.
I think you need to post a higher-level question about whatever it is you're trying to do, asking how to do it.

YUI: adding event at the top of some event queue after page loading?

How can I put a new event at the top of all attached events linked to an object just after the page load?
Pratically I have an accordion using some YUI funcs to activate its behavior, now without modifying the YUI main function I need some new functions used to call AJAX routines.
Currently I am trying with Event.getListeners, but I don't know how to treat the returned objects.
Regards
The responses you get from Event.getListeners is all the arguments passed into the Event.addListener. According to the docs for Event.getListeners it returns
the listener. Contains the following fields:
type: (string) the type of event
fn: (function) the callback supplied to addListener
obj: (object) the custom object supplied to addListener
adjust: (boolean|object) whether or not to adjust the default context
scope: (boolean) the derived context based on the adjust parameter
index: (int) its position in the Event util listener cache
So using that object you can probably just remove the Listeners using Event.removeListener & then re-add them all in the order you want using Event.addListener. The object's properties map 1:1 with the args for Event.addListener so nothing will be lost.

Resources