Sunday, January 30, 2005

Featured Tutorial Series - Client Side Tag Libs

Client Side Tag Libraries (CSTL) are a JavaScript based infrastructure that enables web developers and designers to employ custom tags into a (X)HTML page. Custom tags are mainly used to have easy access to sophisticated UI components. Underneath CSTLs are based on JavaScript classes that provide object oriented features like inheritance, polymorphism etc. and on top of that are easily distributable and redistributable across even across domains.

A TagLib enhanced (X)HTML document needs to loads the so called TagLibProcessor, as an external JavaScript file. The processor then looks for TagLibs registered in the <head> section of the document. After loading the TagLibs, the DOM is traversed finding and processing all custom tags – which should be XML namespaced.

A custom tag brings with it a convenient manner to create UI components in a JavaScript class, by either direct and eased DOM modification or even easier (X)HTML generation. Also you can bind variables to custom tag attributes that may refer to JavaScript variables, objects and functions, which are resolved into their real values behind on demand. Also every tag can be independently refreshed, either on a timed basis or in reaction to events, always serving you the current variable situation. This is the base for great flicker free user experiences.

<html>
  <head>
     <script type="text/javascript" src="cstl.js"></script>
     <cstl:taglib classPath="com.inspirationlabs.taglib.std.StdTagLib" ns="std"/>
     <script type="text/javascript">
        function date() {
           return new Date();
        }
     </script>
  </head>
  <body>
     <std:print var="${date}" refreshRate="1000">
        N/A
     </std:print>
  </body>
</html>

full article download files

0 comments: