in core/src/main/java/org/apache/struts2/components/OptionTransferSelect.java [137:325]
public void evaluateExtraParams() {
super.evaluateExtraParams();
Object doubleValue;
// override DoubleListUIBean's
if (doubleList != null) {
doubleValue = findValue(doubleList);
addParameter("doubleList", doubleValue);
}
if (StringUtils.isBlank(size)) {
addParameter("size", "15");
}
if (StringUtils.isBlank(doubleSize)) {
addParameter("doubleSize", "15");
}
if (StringUtils.isBlank(multiple)) {
addParameter("multiple", Boolean.TRUE);
}
if (StringUtils.isBlank(doubleMultiple)) {
addParameter("doubleMultiple", Boolean.TRUE);
}
// buttonCssClass
if (StringUtils.isNotBlank(buttonCssClass)) {
addParameter("buttonCssClass", buttonCssClass);
}
// buttonCssStyle
if (StringUtils.isNotBlank(buttonCssStyle)) {
addParameter("buttonCssStyle", buttonCssStyle);
}
// allowSelectAll
addParameter("allowSelectAll",
allowSelectAll != null ? findValue(allowSelectAll, Boolean.class) : Boolean.TRUE);
// allowAddToLeft
addParameter("allowAddToLeft",
allowAddToLeft != null ? findValue(allowAddToLeft, Boolean.class) : Boolean.TRUE);
// allowAddToRight
addParameter("allowAddToRight",
allowAddToRight != null ? findValue(allowAddToRight, Boolean.class) : Boolean.TRUE);
// allowAddAllToLeft
addParameter("allowAddAllToLeft",
allowAddAllToLeft != null ? findValue(allowAddAllToLeft, Boolean.class) : Boolean.TRUE);
// allowAddAllToRight
addParameter("allowAddAllToRight",
allowAddAllToRight != null ? findValue(allowAddAllToRight, Boolean.class) : Boolean.TRUE);
// allowUpDownOnLeft
addParameter("allowUpDownOnLeft",
allowUpDownOnLeft != null ? findValue(allowUpDownOnLeft, Boolean.class) : Boolean.TRUE);
// allowUpDownOnRight
addParameter("allowUpDownOnRight",
allowUpDownOnRight != null ? findValue(allowUpDownOnRight, Boolean.class) : Boolean.TRUE);
// leftTitle
if (leftTitle != null) {
addParameter("leftTitle", findValue(leftTitle, String.class));
}
// rightTitle
if (rightTitle != null) {
addParameter("rightTitle", findValue(rightTitle, String.class));
}
// addToLeftLabel
addParameter("addToLeftLabel",
addToLeftLabel != null ? findValue(addToLeftLabel, String.class) : "<-" );
// addToRightLabel
addParameter("addToRightLabel",
addToRightLabel != null ? findValue(addToRightLabel, String.class) : "->");
// addAllToLeftLabel
addParameter("addAllToLeftLabel",
addAllToLeftLabel != null ? findValue(addAllToLeftLabel, String.class) : "<<--");
// addAllToRightLabel
addParameter("addAllToRightLabel",
addAllToRightLabel != null ? findValue(addAllToRightLabel, String.class) : "-->>");
// selectAllLabel
addParameter("selectAllLabel",
selectAllLabel != null ? findValue(selectAllLabel, String.class) : "<*>");
// leftUpLabel
addParameter("leftUpLabel",
leftUpLabel != null ? findValue(leftUpLabel, String.class) : "^");
// leftDownLabel
addParameter("leftDownLabel",
leftDownlabel != null ? findValue(leftDownlabel, String.class) : "v");
// rightUpLabel
addParameter("rightUpLabel",
rightUpLabel != null ? findValue(rightUpLabel, String.class) : "^");
// rightDownlabel
addParameter("rightDownLabel",
rightDownLabel != null ? findValue(rightDownLabel, String.class) : "v");
// selectAllOnclick
addParameter("selectAllOnclick",
selectAllOnclick != null ? findValue(selectAllOnclick, String.class) : "");
// addToLeftOnclick
addParameter("addToLeftOnclick",
addToLeftOnclick != null ? findValue(addToLeftOnclick, String.class) : "");
// addToRightOnclick
addParameter("addToRightOnclick",
addToRightOnclick != null ? findValue(addToRightOnclick, String.class) : "");
// addAllToLeftOnclick
addParameter("addAllToLeftOnclick",
addAllToLeftOnclick != null ? findValue(addAllToLeftOnclick, String.class) : "");
// addAllToRightOnclick
addParameter("addAllToRightOnclick",
addAllToRightOnclick != null ? findValue(addAllToRightOnclick, String.class) : "");
// upDownOnLeftOnclick
addParameter("upDownOnLeftOnclick",
upDownOnLeftOnclick != null ? findValue(upDownOnLeftOnclick, String.class) : "");
// upDownOnRightOnclick
addParameter("upDownOnRightOnclick",
upDownOnRightOnclick != null ? findValue(upDownOnRightOnclick, String.class) : "");
// inform the form component our select tag infos, so they know how to select
// its elements upon onsubmit
Form formAncestor = (Form) findAncestor(Form.class);
if (formAncestor != null) {
// inform ancestor form that we are having a customOnsubmit (see form-close.ftl [simple theme])
enableAncestorFormCustomOnsubmit();
// key -> select tag id, value -> headerKey (if exists)
Map formOptiontransferselectIds = (Map) formAncestor.getAttributes().get("optiontransferselectIds");
Map formOptiontransferselectDoubleIds = (Map) formAncestor.getAttributes().get("optiontransferselectDoubleIds");
// init lists
if (formOptiontransferselectIds == null) {
formOptiontransferselectIds = new LinkedHashMap();
}
if (formOptiontransferselectDoubleIds == null) {
formOptiontransferselectDoubleIds = new LinkedHashMap();
}
// id
String tmpId = (String) getAttributes().get("id");
String tmpHeaderKey = (String) getAttributes().get("headerKey");
if (tmpId != null && (! formOptiontransferselectIds.containsKey(tmpId))) {
formOptiontransferselectIds.put(tmpId, tmpHeaderKey);
}
// doubleId
String tmpDoubleId = (String) getAttributes().get("doubleId");
String tmpDoubleHeaderKey = (String) getAttributes().get("doubleHeaderKey");
if (tmpDoubleId != null && (! formOptiontransferselectDoubleIds.containsKey(tmpDoubleId))) {
formOptiontransferselectDoubleIds.put(tmpDoubleId, tmpDoubleHeaderKey);
}
formAncestor.getAttributes().put("optiontransferselectIds", formOptiontransferselectIds);
formAncestor.getAttributes().put("optiontransferselectDoubleIds", formOptiontransferselectDoubleIds);
}
else {
if (LOG.isWarnEnabled()) {
LOG.warn("form enclosing optiontransferselect {} not found, auto select upon form submit of optiontransferselect will not work", this);
}
}
}