public HtmlComponent render(Object object, Class type) {
String prefix =
HtmlComponent.getValidIdOrName(((MetaSlot) getInputContext().getMetaObject()).getKey().toString()
.replaceAll("\\.", "_").replaceAll("\\:", "_"));
HtmlHiddenField hidden = new HtmlHiddenField(prefix + HIDDEN_NAME, "");
HtmlBlockContainer container = (HtmlBlockContainer) super.render(object, type);
HtmlHiddenField hiddenValue = null;
for (HtmlComponent childComponent : container.getChildren()) {
if ((childComponent instanceof HtmlHiddenField) && (childComponent.getId().endsWith("_AutoComplete"))) {
hiddenValue = (HtmlHiddenField) childComponent;
}
}
hiddenValue.setOnChange("this.form." + prefix + HIDDEN_NAME + ".value='true';this.form.submit();");
hiddenValue.setController(new PostBackController(hidden, getDestination()));
container.addChild(hidden);
return container;
}