in plugins/struts2-dojo-plugin/src/main/java/org/apache/struts2/dojo/components/Submit.java [186:260]
public void evaluateExtraParams() {
super.evaluateExtraParams();
if (href != null)
addParameter("href", findString(href));
if (errorText != null)
addParameter("errorText", findString(errorText));
if (loadingText != null)
addParameter("loadingText", findString(loadingText));
if (executeScripts != null)
addParameter("executeScripts", findValue(executeScripts, Boolean.class));
if (listenTopics != null)
addParameter("listenTopics", findString(listenTopics));
if (notifyTopics != null)
addParameter("notifyTopics", findString(notifyTopics));
if (handler != null)
addParameter("handler", findString(handler));
if (formId != null)
addParameter("formId", findString(formId));
if (formFilter != null)
addParameter("formFilter", findString(formFilter));
if (src != null)
addParameter("src", findString(src));
if (indicator != null)
addParameter("indicator", findString(indicator));
if (targets != null)
addParameter("targets", findString(targets));
if (showLoadingText != null)
addParameter("showLoadingText", findString(showLoadingText));
if (showLoadingText != null)
addParameter("showLoadingText", findString(showLoadingText));
if (beforeNotifyTopics != null)
addParameter("beforeNotifyTopics", findString(beforeNotifyTopics));
if (afterNotifyTopics != null)
addParameter("afterNotifyTopics", findString(afterNotifyTopics));
if (errorNotifyTopics != null)
addParameter("errorNotifyTopics", findString(errorNotifyTopics));
if (highlightColor != null)
addParameter("highlightColor", findString(highlightColor));
if (highlightDuration != null)
addParameter("highlightDuration", findString(highlightDuration));
if (separateScripts != null)
addParameter("separateScripts", findValue(separateScripts, Boolean.class));
if (transport != null)
addParameter("transport", findString(transport));
if (parseContent != null)
addParameter("parseContent", findValue(parseContent, Boolean.class));
Boolean validateValue = false;
if (validate != null) {
validateValue = (Boolean) findValue(validate, Boolean.class);
addParameter("validate", validateValue);
}
Form form = (Form) findAncestor(Form.class);
if (form != null)
addParameter("parentTheme", form.getTheme());
if (ajaxAfterValidation != null)
addParameter("ajaxAfterValidation", findValue(ajaxAfterValidation, Boolean.class));
// generate a random ID if not explicitly set and not parsing the content
Boolean parseContent = (Boolean)stack.getContext().get(Head.PARSE_CONTENT);
boolean generateId = (parseContent != null ? !parseContent : true);
addParameter("pushId", generateId);
if ((this.id == null || this.id.length() == 0) && generateId) {
// resolves Math.abs(Integer.MIN_VALUE) issue reported by FindBugs
// http://findbugs.sourceforge.net/bugDescriptions.html#RV_ABSOLUTE_VALUE_OF_RANDOM_INT
int nextInt = RANDOM.nextInt();
nextInt = nextInt == Integer.MIN_VALUE ? Integer.MAX_VALUE : Math.abs(nextInt);
this.id = "widget_" + String.valueOf(nextInt);
addParameter("id", this.id);
}
}