beautypg.com

Applyserverbehavior(), Canapplyserverbehavior() – Adobe Extending Dreamweaver CS4 User Manual

Page 258

background image

252

EXTENDING DREAMWEAVER CS4

Server behaviors

object that belongs to Recordset1 cannot be found, the

incomplete

property is set to the value

true

so that an

exclamation point appears in the Server Behaviors panel, which alerts the user that a problem exists. Similarly, when
the

analyzeServerBehavior()

function is called for DynamicText2, the function searches for the object that belongs

to Recordset1. Because Recordset1 does not depend on other server behaviors, it does not need to define the

analyzeServerBehavior()

function in this example.

Arguments
serverBehavior, {serverBehaviorArray}

The serverBehavior argument is a JavaScript object that represents the behavior to analyze.

The

{serverBehaviorArray}

argument is an array of JavaScript objects that represents all the server behaviors

that are found on a page.

Returns
Dreamweaver expects nothing.

applyServerBehavior()

Availability
Dreamweaver UltraDev 1.

Description
Reads values from the form elements in the dialog box and adds the behavior to the user’s document. Dreamweaver
calls this function when the user clicks OK in the Server Behaviors dialog box. If this function returns successfully, the
Server Behaviors dialog box closes. If this function fails, it displays an error message without closing the Server
Behaviors dialog box. This function can edit a user’s document.

For more information, see “

dwscripts.applySB()

” on page 256.

Arguments
serverBehavior

The serverBehavior JavaScript object represents the server behavior; it is necessary to modify an existing behavior. If
this is a new behavior, the argument is

null

.

Returns
Dreamweaver expects an empty string if successful or an error message if this function fails.

canApplyServerBehavior()

Availability
Dreamweaver UltraDev 1.

Description
Determines whether a behavior can be applied. Dreamweaver calls this function before the Server Behaviors dialog box
appears. If this function returns a

true

value, the Server Behaviors dialog box appears. If this function returns a

false

value, the Server Behaviors dialog box does not appear and the attempt to add a server behavior stops.

This manual is related to the following products: