// main javascript containers container.
removeElement(lastNextElement);
// rewrite used buttons into right script.
Iterator iter = this.internalButtonsJavascriptContainer.keySet().iterator();
while(iter.hasNext()){
AccessibleJavaScriptContainer jsContainer =
(AccessibleJavaScriptContainer)this.internalButtonsJavascriptContainer.get(iter.next());
JavaScriptContainer newContainer =
renderer.createJavaScriptContainer(protocol);
List usedId = jsContainer.getUsedWidgetsIdList();
for(Iterator i = usedId.iterator();i.hasNext();){
newContainer.addUsedWidgetId((String)i.next());
}
List createdId = jsContainer.getCreatedWidgetsIdList();
for(Iterator i = createdId.iterator();i.hasNext();){
newContainer.addCreatedWidgetId((String)i.next());
}
try {
newContainer.getWriter().write(jsContainer.getJavaScriptContent());
} catch (IOException e) {
throw new ProtocolException();
}
}