url() == null) ? "javascript:void(0);" : url();
}
public String onClick ()
{
AWResponse response = response();
ActionHandler handler = handler();
AWRequestContext requestContext = requestContext();
String target = handler.target(requestContext);
response.appendContent(Constants.Space);
response.appendContent(Constants.OnClick);
response.appendContent(Constants.Equals);
response.appendContent(Constants.Quote);
if (handler.isExternal(requestContext) &&
handler.onClick(requestContext) != null) {
response.appendContent(handler.onClick(requestContext));
}
else if (_submitForm && target == null && handler.submitFormToUrl()) {
// This is the case where we are provided a url (eg from jsp) and are within
// a form. We do not support submitting a form and opening a new window.
// If the target is provided, we will simply do a GET and display results
// in that window.
response.appendContent("document.forms[0].action='");
response.appendContent(url());
response.appendContent("';ariba.Request.submitForm(document.forms[0]);return false");
}
else {
if (target != null) {
response.appendContent(Constants.Return);
response.appendContent(Constants.Space);
response.appendContent(Constants.OpenWindow);
response.appendContent(Constants.OpenParen);
response.appendContent(Constants.SingleQuote);
response.appendContent(url());
response.appendContent(Constants.SingleQuote);
response.appendContent(Constants.Comma);
response.appendContent(Constants.Space);
response.appendContent(Constants.SingleQuote);
response.appendContent(target);
response.appendContent(Constants.SingleQuote);
response.appendContent(Constants.Comma);
response.appendContent(Constants.Space);
response.appendContent(Constants.SingleQuote);
response.appendContent(handler.windowAttributes(requestContext));
response.appendContent(Constants.SingleQuote);
response.appendContent(Constants.CloseParen);
}
else {
response.appendContent(Constants.Return);
response.appendContent(Constants.Space);
response.appendContent("ariba.Request.setDocumentLocation");
response.appendContent(Constants.OpenParen);
response.appendContent(Constants.SingleQuote);
response.appendContent(url());
response.appendContent(Constants.SingleQuote);
response.appendContent(Constants.Comma);
response.appendContent(Constants.Space);
response.appendContent(Constants.Null);
response.appendContent(Constants.CloseParen);
}
}
response.appendContent(Constants.Semicolon);
response.appendContent(Constants.Quote);
return null;
}