writer.startElement(HTML.a_ELEMENT,component);
getUtils().encodeId(context,component);
getUtils().encodeAttributesFromArray(context,component,HTML.PASS_THRU_STYLES);
getUtils().encodePassThruWithExclusionsArray(context,component,LINK_EXCLUSIONS);
writer.writeAttribute("href","#",null);
UIForm form = getUtils().getNestingForm(context,component);
String clientId = component.getClientId(context);
if(null == form){
if(_log.isWarnEnabled()){
_log.warn(Messages.getMessage(Messages.COMMAND_LINK_NOT_IN_FORM_WARNING, clientId));
}
return;
}
// Encode onclick attribute.
Object click = component.getAttributes().get("onclick");
StringBuffer onclick = new StringBuffer(256);
if(null != click){
onclick.append(click).append(';');
}
JSFunction submit = new JSFunction(AjaxFormRenderer.FORM_SUBMIT_FUNCTION_NAME);
submit.addParameter(clientId);
submit.addParameter(form.getClientId(context));
submit.addParameter(component.getAttributes().get("target"));
Map parameters = new HashMap();
for (Iterator iter = component.getChildren().iterator(); iter.hasNext();) {
Object child = iter.next();
if (child instanceof UIParameter) {