< Day Day Up > |
You can use the following live data functions to mimic menu functionality:
You can use the remaining live data functions when you implement the translator API liveDataTranslateMarkup() function. dreamweaver.getLiveDataInitTags()Availability Dreamweaver UltraDev 1. Description Returns the initialization tags for the currently active document. The initialization tags are the HTML tags that the user supplies in the Live Data Settings dialog box. This function is typically called from a translator's liveDataTranslateMarkup() function, so that the translator can pass the tags to the liveDataTranslate() function. Arguments None. Returns A string that contains the initialization tags. dreamweaver.getLiveDataMode()Availability Dreamweaver UltraDev 1. Description Determines whether the Live Data window is currently visible. Arguments None. Returns A Boolean value: true if the Live Data window is visible; false otherwise. dreamweaver.getLiveDataParameters ()Availability Dreamweaver MX. Description Obtains the URL parameters that are specified as Live Data settings. Live Data mode lets you view a web page in the design stage (as if it has been translated by the application server and returned). Generating dynamic content to display in Design view lets you view your page layout with live data and adjust it, if necessary. Before you view live data, you must enter Live Data settings for any URL parameters that you reference in your document. This prevents the web server from returning errors for parameters that are otherwise undefined in the simulation. You enter the URL parameters in name-value pairs. For example, if you reference the URL variables ID and Name in server scripts in your document, you must set these URL parameters before you view live data. You can enter Live Data settings through Dreamweaver in the following ways:
For the ID and Name parameters, you can enter the following pairs: ID 22 Name Samuel In the URL, these parameters would appear as shown in the following example: http://someURL?ID=22&Name=Samuel This function lets you obtain these live data settings through JavaScript. Arguments None. Returns An array that contains the URL parameters for the current document. The array contains an even number of parameter strings. Each two elements form a URL parameter name-value pair. The even element is the parameter name and the odd element is the value. For example, getLiveDataParameters() returns the following array for the ID and Name parameters in the preceding example: ['ID,'22','Name','Samuel']. Example The following example returns the parameters that are specified as Live Data settings and stores them in the paramsArray: var paramsArray = dreamweaver.getLiveDataParameters(); dreamweaver.liveDataTranslate()Availability Dreamweaver UltraDev 1. Description Sends an entire HTML document to an application server, asks the server to execute the scripts in the document, and returns the resulting HTML document. This function can be called only from a translator's liveDataTranslateMarkup() function; if you try to call it at another time, an error occurs. The dreamweaver.liveDataTranslate() function performs the following operations:
Arguments
Returns An httpReply object. This object is the same as the value that the MMHttp.getText() function returns. If the user clicks the Stop icon, the return value's httpReply.statusCode is equal to 200 (Status OK) and its httpReply.data is equal to the empty string. For more information on the httpReply object, see Chapter 2, "The HTTP API," on page 533. dreamweaver.setLiveDataError()Availability Dreamweaver UltraDev 1. Description Specifies the error message that appears if an error occurs while the liveDataTranslateMarkup() function executes in a translator. If the document that Dreamweaver passed to liveDataTranslate() contains errors, the server passes back an error message that is formatted using HTML. If the translator (the code that called liveDataTranslate()) determines that the server returned an error message, it calls setLiveDataError() to display the error message in Dreamweaver. This message appears after the liveDataTranslateMarkup() function finishes executing; Dreamweaver displays the description in an error dialog box. The setLiveDataError() function should be called only from the liveDataTranslateMarkup() function. Arguments source
Returns Nothing. dreamweaver.setLiveDataMode()Availability Dreamweaver UltraDev 1. Description Toggles the visibility of the Live Data window. Arguments bIsVisible
Returns Nothing. dreamweaver.setLiveDataParameters()Availability Dreamweaver MX. Description Sets the URL parameters that you reference in your document for use in Live Data mode. Live Data mode lets you view a web page in the design stage (as if it has been translated by the application server and returned). Generating dynamic content to display in Design view lets you view your page layout with live data and adjust it, if necessary. Before you view live data, you must enter Live Data settings for any URL parameters that you reference in your document. This prevents the web server from returning errors for parameters that are otherwise undefined in the simulation. You enter the URL parameters in name-value pairs. For example, if you reference the URL variables ID and Name in server scripts in your document, you must set these URL parameters before you view live data. This function lets you set Live Data values through JavaScript. Arguments liveDataString
Returns Nothing. Example dreamweaver.setLiveDataParameters("ID=22&Name=Samuel") dreamweaver.showLiveDataDialog()Availability Dreamweaver UltraDev 1. Description Displays the Live Data Settings dialog box. Arguments None. Returns Nothing. |
< Day Day Up > |