Getcodeviewdropcode() - MACROMEDIA DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER Manual

Extending dreamweaver
Hide thumbs Also See for DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER:
Table of Contents

Advertisement

getCodeViewDropCode()

Availability
Dreamweaver MX.
Description
This function gets the code that is dragged and dropped in Code view from the Component
panel or the code that is cut, copied, or pasted from the Component panel.
Arguments
componentRec
The
componentRec
Returns
The string that contains the code for the component.
Example
The following example identifies the code for a common web service:
function getCodeViewDropCode(componentRec)
{
var codeToDrop="";
if (componentRec)
{
if (componentRec.objectType=="Class")
{
codeToDrop =¬
dw.getExtDataValue("webservices_constructor","insertText");
codeToDrop =¬
codeToDrop.replace(RegExp("@@Id@@","g"),componentRec.name);
codeToDrop =¬
codeToDrop.replace(RegExp("@@Class@@","g"),componentRec.name);
}
else if (componentRec.objectType=="Method")
{
codeToDrop = componentRec.dropCode;
}
if(componentRec.dropCode)
{
codeToDrop = componentRec.dropCode;
}
else
{
codeToDrop = componentRec.name;
}
}
return codeToDrop;
}
318
Chapter 18: Components
argument is an object.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Dreamweaver mx 2004

Table of Contents