How participants are matched
participants must be identified in the user's document and matched. If the user applies
multiple instances of the server behavior to a document, each group of participants must be
matched accordingly. To ensure participants are matched correctly, you might need to change
or add parameters and construct participants so they can be uniquely identified.
Matching requires some rules. Participants are matched when all parameters with the same
name have the same value. Above and below the
participant with a given set of parameter values. Within the
are also matched by their position relative to the selection or to common nodes that are used
for insertion.
Participants without parameters are automatically matched, as shown in the following
example of a server behavior with group file:
<group serverBehavior="test.htm">
<title>Test</title>
<groupParticipants>
<groupParticipant name="test_p1" partType="identifier" />
<groupParticipant name="test_p2" partType="identifier" />
</groupParticipants>
</group>
The following example inserts two simple participants above the
<% //test_p1 %>
<% //test_p2 %>
<html>
These participants are found and matched, and Test appears once in the Server Behaviors
panel. If you add the server behavior again, nothing is added because the participants already
exist.
If the participants have unique parameters, multiple instances can be inserted above the
tag. For example, by adding a name parameter to the participant, a user can enter a unique
name in the Test Server Behavior dialog box. If the user enters name
participants are inserted:
<% //test_p1 name="aaa" %>
<% //test_p2 name="aaa" %>
<html>
If you add the server behavior again with a different name, such as
looks like the following example:
<% //test_p1 name="aaa" %>
<% //test_p2 name="aaa" %>
<% //test_p1 name="bbb" %>
<% //test_p2 name="bbb" %>
<html>
If a server behavior has more than one participant, the
tag, there can be only one instance of a
html
tags, participants
html.../html
tag:
html
, the following
"aaa"
, the document now
"bbb"
Server behavior techniques
html
371
Need help?
Do you have a question about the DREAMWEAVER 8-EXTENDING DREAMWEAVER and is the answer not in the manual?