fix error in email target editor,

now it is possible to remove single targets
This commit is contained in:
Peter Hormanns 2016-07-04 18:52:14 +02:00
parent 51a4a6acf3
commit f6d628486d
3 changed files with 22 additions and 8 deletions

View File

@ -17,6 +17,7 @@
<module>persistence</module>
<module>services</module>
<module>xmlrpc</module>
<module>web</module>
</modules>
<build>

View File

@ -2,11 +2,15 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>net.hostsharing</groupId>
<artifactId>hs.hsadmin.web</artifactId>
<parent>
<groupId>de.hsadmin</groupId>
<artifactId>hsadmin-parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>admin-web</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>hs.hsadmin.web</name>
<name>HSAdmin Webapp</name>
<dependencies>

View File

@ -90,10 +90,16 @@ public class EMailTargetEditor extends CustomComponent implements IHSEditor, Val
if (child instanceof AbstractOrderedLayout) {
final Component grandChild = ((AbstractOrderedLayout) child).getComponent(1);
if (grandChild instanceof TextField) {
targetsList.add(((TextField) grandChild).getValue());
final String value = ((TextField) grandChild).getValue();
if (value != null && !value.isEmpty()) {
targetsList.add(value);
}
}
if (grandChild instanceof NativeSelect) {
targetsList.add(((NativeSelect) grandChild).getValue().toString());
final Object value = ((NativeSelect) grandChild).getValue();
if (value != null) {
targetsList.add(value.toString());
}
}
}
}
@ -166,9 +172,12 @@ public class EMailTargetEditor extends CustomComponent implements IHSEditor, Val
setWidth("100%");
setSpacing(true);
final NativeSelect targetTypeSelect = new NativeSelect();
targetTypeSelect.addItems(new Object[] { I18N.getText("emailtarget.email"), I18N.getText("emailtarget.postbox"), I18N.getText("emailtarget.alias") });
targetTypeSelect.setWidth("6.0em");
targetTypeSelect.setMultiSelect(false);
targetTypeSelect.setNullSelectionAllowed(true);
targetTypeSelect.setNullSelectionItemId(" ");
targetTypeSelect.addItems(new Object[] { " ", I18N.getText("emailtarget.email"), I18N.getText("emailtarget.postbox"), I18N.getText("emailtarget.alias") });
targetTypeSelect.setValue(" ");
targetTypeSelect.setWidth("6.0em");
addComponent(targetTypeSelect);
setComponentAlignment(targetTypeSelect, Alignment.MIDDLE_LEFT);
setExpandRatio(targetTypeSelect, 0.0f);