Navigation
Records in this category
- Is there a way to copy information (controls, fields, and their properties) from existing Pages into new Pages?
- Can a schema (XSD) be used at design-time to create pages and establish bindings, and then at runtime connect to a web service that uses a WSDL?
- Can an XSD be used to design pages that are communicating with a web service at runtime that actually returns a single string in the response (the contents of which is XML conforming to the XSD)?
- How do you create a dynamic table that allows the user to add rows as required?
- Is it possible to have more than one skin used in the application? Obviously, only one skin would be used at a time, but can the skin be changed based on some runtime data?
- How can you check if the user updated any fields on a form?
- How is the length of field labels configured?
- Can a page be rendered in two modes (display only and editable) depending on some runtime data?
- How can list paging be implemented? For example, paging through the results of a search query.
- Does MVC WebMaker support creating drop-down menus?
- Can a page be created using information from multiple web service calls?
- Can parameters be passed to an application using the URL query string?
- Why do I get an error stating 'Variables may not be used within this expression' when entering XPaths?
- Is it possible to dynamically change the page to display based on some runtime data?
- Can I include my own JavaScript functions in the pages generated by FormMaker?
- Is there an #Include feature in MVC WebMaker or anything similar to it?
- Can I change the External Editor that is invoked by MVC WebMaker?
- Customising the Generated AJAX Calls
- How do I use the Editable Row control?
- How do I use the Paging Table control?
- How do I use the Tree control?
- How do I access event information in custom script actions?
- How do I handle changes to data sources (SQL tables, Web Services, etc) that have already been used for page design?
Tags
WebMaker Studio » FormMaker
How do I access event information in custom script actions?
When an event has been added to a component in FormMaker, there are a number of properties made available to any 'Custom Script' actions you may define for the event.
These properties are all accessed through the objEventSource object, and are detailed in the table below. Please note that not all of these properties will apply for page level and external events.
| Property | Description |
| option | Indicates what this event was registered against. Valid values are 'field', 'label', 'group', 'grouplabel', 'page' and 'external' |
| event | The javascript event object |
| value | The id of the field or group that this event was registered against |
| repeatId |
If the component that the event is registered on is contained within a repeat (eg in a table structure) then this property will contain the id of the specific entry within the repeat (eg the row) that the event was fired for. The 'value' id needs to be prefixed with this string to get the full id of the HTML object. |
| field |
The HTML object (eg text box) that the event was defined against. This is often the component you are interested in, and can usually be accessed with the 'this' keyword. |
| component |
This is the HTML component that was the target of the event. This may or may not be the same as the 'field' due to event bubbling. For example if an onclick event is defined against a group, and the user clicks on a contained text box, this property would reference the textbox, where as the field property would contain the HTML element for the group (eg a DIV) |
Using these properties removes the cross browser complexities involved in accessing these event related details.
Examples:
To access the value of a textbox field in an onchange event:
alert(objEventSource.field.value) [or more simply: alert(this.value)]
To find the type of an event (eg onclick, onchange etc)
alert(objEventSource.event.type)
To find the mouse coordinates of an event:
hyf.util.getMouseCoords(objEventSource.event) [this returns an object with x and y properties]
Tags: event, javascript
Related entries:
- Installing behind proxy servers
- Running the Tutorial web services locally
- Is there a way to copy information (controls, fields, and their properties) from existing Pages into new Pages?
- Can a schema (XSD) be used at design-time to create pages and establish bindings, and then at runtime connect to a web service that uses a WSDL?
- How do you create a dynamic table that allows the user to add rows as required?
Last update: 2010-08-11 18:22
Author: Hyfinity support team
Revision: 1.1
You can comment this FAQ