
336 Server Behaviors
dwscripts.applySB()
Availability
Dreamweaver MX (this function replaces the applySB() function from earlier versions
of Dreamweaver).
Description
Inserts or updates runtime code for the server behavior. If the sbObj parameter has a null
value, it inserts new runtime code; otherwise, it updates existing runtime code that is
indicated by the
sbObj object. User settings should be set as properties on a JavaScript object
and passed in as
paramObj. These settings should match all the parameters that are declared as
@@paramName@@ in the EDML insertion text.
Arguments
paramObj, sbObj
■ The paramObj argument is the object that contains the user parameters.
■ The sbObj argument is the prior server behavior object if you are updating an existing
server behavior;
null otherwise.
Returns
Dreamweaver expects a Boolean value: true if the server behavior is added successfully to the
user’s document;
false otherwise.
Example
In the following example, you fill the paramObj object with the user’s input and call the
dwscripts.applySB() function, passing in the input and your server behavior, sbObj:
function applyServerBehaviors(sbObj) {
// get all UI values here...
paramObj = new Object();
paramObj.rs = rsName.value;
paramObj.col = colName.value;
paramObj.url = urlPath.value;
paramObj.form__tag = formObj;
dwscripts.applySB(paramObj, sbObj);
}
Komentáře k této Příručce