Mercurial > dive4elements > gnv-client
diff gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionBase.java @ 78:969faa37a11b
Added Multiselectsupport for InputValues
gnv-artifacts/trunk@94 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Wed, 16 Sep 2009 12:38:24 +0000 |
parents | 0e38f512f7e4 |
children | e33c61735a4e |
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionBase.java Wed Sep 16 07:49:46 2009 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionBase.java Wed Sep 16 12:38:24 2009 +0000 @@ -124,7 +124,7 @@ this.inputValueNames = new ArrayList<String>(inputValuesNodes.getLength()); for (int i = 0 ; i < inputValuesNodes.getLength(); i++){ Node inputValueNode = inputValuesNodes.item(i); - InputValue inputValue = new DefaultInputValue(Config.getStringXPath(inputValueNode,"@name"), Config.getStringXPath(inputValueNode,"@type")); + InputValue inputValue = new DefaultInputValue(Config.getStringXPath(inputValueNode,"@name"), Config.getStringXPath(inputValueNode,"@type"), Boolean.parseBoolean(Config.getStringXPath(inputValueNode,"@multiselect"))); log.debug(inputValue.toString()); this.inputValues.put(inputValue.getName(),inputValue); this.inputValueNames.add(inputValue.getName()); @@ -248,12 +248,13 @@ Object o = it.next(); if (!it.hasNext()){ if (o instanceof Collection<?>){ - Element selectNode = xmlutilities.createXFormElement(document,"select"); // TODO: HACK: // BESSERE LÖSUNG FINDEN Object[] names = this.inputValueNames.toArray(); String name = names[names.length-1].toString(); + boolean multiselect = this.inputValues.get(name).isMultiselect(); + Element selectNode = xmlutilities.createXFormElement(document,multiselect ? "select" : "select1"); selectNode.setAttribute("ref", name); Element lableNode = xmlutilities.createXFormElement(document, "label");