Building Tag Editors
179
Using OPTIONLinearLayout
Here is a version of the mytag layout template that responds to user preferences for
single line or indented layout:
<taglayout>
<WIZIF OPTIONLinearLayout EQ ’true’>
<WIZSET Spacer = ’ ’>
<WIZELSE>
<WIZSET Spacer = Chr(13) & Chr(10) & ’ ’>
</WIZIF>
<mytag color="$${clrBGColor}"$${Spacer}face="$${fontFace}
"$${Spacer}size="$${txtSize}">
</taglayout>
The template would generate a tag based on the following user layout preference:
LINEAR:
<mytag color="White" face="Arial" SIZE="10">
NONLINEAR:
<mytag color="White"
face="Arial"
size="10">
Using TAGDATAUnknownAttributes
The
TagDataUnknownAttributes
tag contains the list of attributes that are contained
in the original tag string but are not supported by the editor. For example, you can
write an editor for the HTML tag
input
. that provides editing capabilities for all basic
attributes, however, the editor will not cover JavaScript event attributes such as,
onCLick
). To prevent loss of what are in effect unknown attributes during the editing
process, the editor engine creates the TagDataUnknownAttributes variable
containing a list of unknown attributes together with their original values. You can
use this variable to “stamp” all the unsupported attributes at the end of the tag you
are generating.
<taglayout>
<mytag color="$${colorBGColor}">
<wizif TagDataUnknownAttributes NEQ’’> $$TagDataUnknownAttributes
</wizif>
</taglayout>
If you edit a tag
<mytag color="Blue" onClick="CallThis">
, the above template
preserves the
onClick
attribute even though it is not supported in the editor.
Содержание ColdFusion Server 5
Страница 18: ...xviii About This Book...
Страница 26: ...8 Chapter 1 Setting Up the Product...
Страница 42: ...24 Chapter 2 Configuring Browsers and Servers...
Страница 60: ...42 Chapter 3 Exploring the Workspace...
Страница 100: ...82 Chapter 6 Editing Pages...
Страница 126: ...108 Chapter 7 Using Web Development Languages...
Страница 212: ...194 Chapter 13 Customizing the Development Environment...
Страница 320: ...302 Glossary...