sunlabs.brazil.sunlabs
Class IdUniquificationTemplate

java.lang.Object
  extended by sunlabs.brazil.template.Template
      extended by sunlabs.brazil.sunlabs.IdUniquificationTemplate
All Implemented Interfaces:
TemplateInterface

public class IdUniquificationTemplate
extends Template

Template to assign div and span id's that are unique for each browser window. Html Tag id's are supposed to be unique. However, if there are multiple browser windows, the server often ends of generating the same id for each window that is displaying the same url. This template fixes this by automatically incorporating a unique identifier into every "id" attribute based on the value of the "subst" request property. The first "%" character in the value of "subst" is replaced by the specified "id" value.

This template looks at all "span", "div", and "section" tags and rewrites all id attributes. ("section" is a non-standard tag that may be used by the server for automatic "id" uniquification.)

It is up to the developer to make sure there is a request property that is unique for each window that is part us the "subst" value (e.g.

subst=%_${window_id}
to append the window id onto the id).

If the boolean attribute "norewrite" is specified, the id will not be rewritten.

If the request property "title." exists, it is added as the title attribute for this section or div, which will make it show-up on the "balloon help"

NOTE:
This template may be useful primarily in debugging multi browser window AJAC applications, and shouldn't be needed in "production".


Field Summary
 
Fields inherited from class sunlabs.brazil.template.Template
debug
 
Constructor Summary
IdUniquificationTemplate()
           
 
Method Summary
 boolean init(RewriteContext hr)
          Called before this template processes any tags.
 void tag_div(RewriteContext hr)
           
 void tag_section(RewriteContext hr)
           
 void tag_span(RewriteContext hr)
           
 void tag_table(RewriteContext hr)
           
 
Methods inherited from class sunlabs.brazil.template.Template
debug, debug, done
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdUniquificationTemplate

public IdUniquificationTemplate()
Method Detail

init

public boolean init(RewriteContext hr)
Description copied from class: Template
Called before this template processes any tags.

Specified by:
init in interface TemplateInterface
Overrides:
init in class Template

tag_span

public void tag_span(RewriteContext hr)

tag_div

public void tag_div(RewriteContext hr)

tag_table

public void tag_table(RewriteContext hr)

tag_section

public void tag_section(RewriteContext hr)