Package sunlabs.brazil.sunlabs
Class IdUniquificationTemplate
- java.lang.Object
-
- sunlabs.brazil.template.Template
-
- 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".
-
-
Constructor Summary
Constructors Constructor Description IdUniquificationTemplate()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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)
-
-
-
Method Detail
-
init
public boolean init(RewriteContext hr)
Description copied from class:Template
Called before this template processes any tags.- Specified by:
init
in interfaceTemplateInterface
- Overrides:
init
in classTemplate
-
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)
-
-