onbeforebind Event |
Fires each time before a tuple is bound to HTML.
Syntax
Inline HTML |
<ELEMENT class="buscontrol" id=elementID onbeforebind="handler()"...> |
Event property |
elementID.onbeforebind = handler |
Event Information
To invoke |
Render the data retrieved from busdataisland using buscontrol. |
Default Action |
Fires the onbind event which binds the HTML to the XML data, and initiates any action associated with this event. |
Event Object Properties
Although event handlers in the DHTML Object Model do not receive parameters directly, a handler can query an event object for data.
Property |
Description |
|---|---|
busObject |
Read-only. Appropriate business element inside the tuple. |
htmlTemplate |
Read-only. Object that denotes the HTML element that functions as a template to bind the data of the busdataisland. |
returnValue |
Read/Write. Boolean that indicates whether data is to be bound to the HTML element or not.
|
tuple |
Read-only. Object that denotes the actual tuple that is to be bound to the HTML element. |
Example
This sample code demonstrates how the event can be used.
<!-- HTML definition for main table data (diEmployees - ID of the data island) -->
<div class="buscontrol" onbeforebind="blockBinding()" style="display:none">
<div BusDataIsland="diEmployees" xql=".">
<!-- HTML Content -->
</div>
</div>
//Function called on onbeforebind event of the buscontrol.
function blockBinding()
{
//Get the business element
var businessElmt = window.application.event.busObject;
//Check if "Employees" is present in the tuple. If present, the return, else don't bind the data
if (businessElmt.selectSingleNode(".//Employees"))
{
//Return if present
window.application.event.returnValue = true;
}
else
{
window.application.event.returnValue = false;
}
}