sunlabs.brazil.sunlabs

Class IdUniquificationTemplate

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".

Method Summary
booleaninit(RewriteContext hr)
voidtag_div(RewriteContext hr)
voidtag_section(RewriteContext hr)
voidtag_span(RewriteContext hr)
voidtag_table(RewriteContext hr)

Method Detail

init

public boolean init(RewriteContext hr)

tag_div

public void tag_div(RewriteContext hr)

tag_section

public void tag_section(RewriteContext hr)

tag_span

public void tag_span(RewriteContext hr)

tag_table

public void tag_table(RewriteContext hr)