Click or drag to resize

isLocked Method

Gets a value indicating whether the object represented by this PdfObject instance is a locked (pre-existing) form field or a locked (pre-existing) annotation.

Syntax
JavaScript
function isLocked();

Parameters

None

Return Value

Type: Boolean

Returns true if this object is locked; otherwise false.

Remarks

This method should be used to test if an unknown object is a pre-existing form field (and hence can not have some properties changed).

Examples
The following example uses the ObjectEventArgs Class to handle the "objectAdded" event of the PdfWebControlApi Class.
JavaScript
//declare event handler function (which accepts an object of type ObjectSelectedEventArgs as an argument)
function objectSelectedHandler(evt)
{
    //if this is not locked
    if( !evt.obj.isLocked() )
    {
        //move object to top fo page
        evt.obj.setProperties({"top" : 0});
    }
}

//get API class
var myApi = new PdfWebControlApi("PdfWebControl1"); // where "PdfWebControl1" is the ID (ClientID) assigned to the PdfWebControl instance

//attach event handler to objectSelected event
myApi.addEventListener("objectSelected", objectAddedHandler);
See Also