XML Server Getting Started    
         "//x:band[@name= Detail ]/x:col[@name= state  and text()= " + state + " ]/parent::*" 
 (see 
XMLControl Data Layout
 for explanation of how XMLControl data is being stored in XML format. Also see on line 
MSDN reference to 
XPath Syntax
.) Then, after selecting all matching rows in the loop the function ends by making visible 
the first one. 
Now, let's assume that few  customer lists  (as well as  vendors list or  employee list  all containing  state  column) are 
used on several pages in our application. On every page of those we need a  by state selection  capability. However, we 
would like to avoid replicating code, like the one above, all over the place. In other words, we would like to extend the 
functionality of the standard XMLControl with a business method 
selectStateCustomers()
. How can we do it?  
DHTML behaviors to the rescue! The following is the complete HTC to implement  by state selection  extension of the 
standard XMLControl functionality (/Examples/Tutorial/step8.htc): 
 
 
 
 
 
As you can see, 
step8.htc
 declares and implements 
selectStateCustomers()
 method the same way we implemented handler 
btn_select::onClick() 
above. Please note the use of the 
element
 keyword   it is a reference to the element the behavior is 
attached to   in our case we anticipate that to be an instance of 
. 
Accordingly, 
selectRow(), findRows() 
and 
scrollToRow()
 become correctly resolved function names at the run time. 
Having completed the extension HTC we can now apply it (
/Examples/Tutorial/step8.jsp
): 
 
 
 
 
  Type state code and click "Select" button: 
   
   
  
  
style="
behavior:url(/Examples/Tutorial/step8.htc)
; border:2px inset;"/> 
    
 
 2000 2002 Computer Technology Inc. All rights reserved. 
Page 22 




J2EE Web Hosting Tundra XML Server Pages J2EE Hosting




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