XML Server Getting Started    
   
  insertAdjacentHTML("afterBegin", legendHTML); 
  var fieldSet = document.createElement("FIELDSET"); 
  element.applyElement(fieldSet, "inside"); 
  fieldSet.style.width= element.style.width; 
  fieldSet.style.height = element.style.height; 
  fieldSet.style.border = (element.style.border!="")?element.style.border:"2px groove" ; 
  fieldSet.style.backgroundColor=element.style.backgroundColor; 
  style.border=""; 
  element.style.display=""; 
} 
The body of the 
constructor()
 method starts with creating a LEGEND inside custom element, while making sure that 
LEGEND's style acquires font and color assigned for the instance of custom element as a whole. Please note that within HTC 
for custom control keyword 
element
 has a special meaning   it is a reference to the instance of control itself (you can treat it 
as  this  pointer in C++ ).  
  var legendHTML =  
                                   color:  + element.style.color +  ;  +     ">  + label +   ; 
  insertAdjacentHTML("afterBegin", legendHTML); 
Next, it performs the similar injection of the FIELD element, delegating to FIELD width, height, border and background 
color  assigned to element as a whole: 
  var fieldSet = document.createElement("FIELDSET"); 
  element.applyElement(fieldSet, "inside"); 
  fieldSet.style.width= element.style.width; 
  fieldSet.style.height = element.style.height; 
  fieldSet.style.border = (element.style.border!="")?element.style.border:"2px groove" ; 
  fieldSet.style.backgroundColor=element.style.backgroundColor; 
If 
STYLE attribute
 of the behavior's instance specified the border, that border can be removed now that FIELDSET is 
providing the similar one: 
  style.border=""; 
The last statement of the 
constructor()
 is turning on the visibility of the entire control. To explain why this is needed let's 
consider again how 
groupbox
 tag is supposed to be used: 
  
 
 
                .   .   .   Other HTML elements .   .  .   . 
 
Internet Explorer performs parsing of the HTML and XML tags in the natural order. Accordingly, by the time IE comes 
across closing  tag    and that is the time 
constructor()
 gets called   all controls to be grouped (and, most 
likely, resized) have already been parsed and rendered to the page. That means unpleasant blinking related to repainting of 
 2000 2002 Computer Technology Inc. All rights reserved. 
Page 18 




J2EE Web Hosting Tundra XML Server Pages J2EE Hosting




 
TotalRoute.net Business web hosting division of Vision Web Hosting Inc. All rights reserved.