// check to see if this is an instance of a HTML Control
boolean ctrlState = (state instanceof AbstractHtmlControlState);
// form keeps track of this so that it can add this control to it's focus map
if (parentForm != null && ctrlState) {
AbstractHtmlControlState hcs = (AbstractHtmlControlState) state;
if (hcs.name == null && parentForm.isFocusSet())
hcs.name = state.id;
parentForm.addTagID(state.id, ((AbstractHtmlControlState) state).name);
}
// rewrite the id, save the original value so it can be used in maps
String id = state.id;
state.id = getIdForTagId(id);
// Legacy Java Script support -- This writes out a single table with both the id and names
// mixed. This is legacy support to match the pre beehive behavior.
String idScript = null;
if (TagConfig.isLegacyJavaScript()) {
ScriptRequestState srs = ScriptRequestState.getScriptRequestState(request);
if (!ctrlState) {
idScript = srs.mapLegacyTagId(getScriptReporter(), id, state.id);
}
else {
AbstractHtmlControlState cState = (AbstractHtmlControlState) state;
if (cState.name != null)
idScript = srs.mapLegacyTagId(getScriptReporter(), id, cState.name);
else
idScript = srs.mapLegacyTagId(getScriptReporter(), id, state.id);
}
}
// map the tagId to the real id
String name = null;
if (ctrlState) {
AbstractHtmlControlState cState = (AbstractHtmlControlState) state;
name = cState.name;
}
String script = renderDefaultNameAndId((HttpServletRequest) pageContext.getRequest(), state, id, name);
if (script != null) {