MACROMEDIA DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER Dokumentacja Strona 327

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 504
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 326
How the Server Behavior API functions are called 327
Sometimes during analysis, a single tag in the users document is identified by two or more
behaviors as being an instance of that behavior. For example, the
findServerBehaviors() function for the Dynamic Attribute behavior might detect an
instance of the Dynamic Attribute behavior that is associated with an
input tag in the
user’s document. At the same time, the
findServerBehaviors() function for the
Dynamic Textfield behavior might look at the same
input tag and detect an instance of
the Dynamic Textfield behavior. As a result, the Server Behaviors panel shows the
Dynamic Attribute block and the Dynamic Textfield. To correct this problem, the
analyzeServerBehavior() functions need to delete all but one of these redundant server
behaviors.
To delete a server behavior, an
analyzeServerBehavior() function can set the deleted
property of any server behavior to the value
true. If the deleted property still has the
value
true when Dreamweaver finishes calling the analyzeServerBehavior()
functions, the behavior is deleted from the list.
When the user clicks the Plus (+) button in the Server Behaviors panel, the pop-up
menu appears.
To determine the content of the menu, Dreamweaver first looks for a ServerBehaviors.xml
file in the same folder as the behaviors. ServerBehaviors.xml references the HTML files
that should appear in the menu.
If the referenced HTML file contains a title tag, the contents of the title tag appear in the
menu. For example, if the ServerBehaviors/ASP_Js/ GetRecords.htm file contains the tag
<title>Get More Records</title>, the text Get More Records appears in the menu.
If the file does not contain a title tag, the filename appears in the menu. For example, if
GetRecords.htm does not contain a title tag, the text GetRecords appears in the menu.
If there is no ServerBehaviors.xml file or the folder contains one or more HTML files that
are not mentioned in ServerBehaviors.xml, Dreamweaver checks each file for a title tag
and uses the title tag or filename to populate the menu.
If you do not want a file that is in the ServerBehaviors folder to appear in the menu, put
the following statement on the first line in the HTML file:
<!-- MENU-LOCATION=NONE -->
When the user selects an item from the menu, the canApplyServerBehavior() function
is called. If that function returns a
true value, a dialog box appears. When the user clicks
OK, the
applyServerBehavior() function is called.
Przeglądanie stron 326
1 2 ... 322 323 324 325 326 327 328 329 330 331 332 ... 503 504

Komentarze do niniejszej Instrukcji

Brak uwag