Hey,

I'm trying to create a form with a CompoundPropertyModel to fill a
java.util.Properties object dynamically.

Form<Properties> form = new Form<>("form", new
CompoundPropertyModel<>(properties));
form.add(new TextField<String>("host"));
form.add(new TextField<String>("port"));

This works correct when I start from an empty java.util.Properties object.
If I have an existing java.util.Properties object (with filled data)
and I remove the value in the html page, I want the key-value pair to be
deleted from the Properties object.

With my current implementation I get a stacktrace (because it tries to
write a null value in the java.util.Properties object)

java.lang.NullPointerException
     at java.util.Hashtable.put(Hashtable.java:432)
     at
org.apache.wicket.core.util.lang.PropertyResolver$MapGetSet.setValue(PropertyResolver.java:803)
     at
org.apache.wicket.core.util.lang.PropertyResolver$ObjectAndGetSetter.setValue(PropertyResolver.java:644)
     at
org.apache.wicket.core.util.lang.PropertyResolver.setValue(PropertyResolver.java:144)


Has anybody have an idea how best to create this behaviour?
Thanks in advance for your help!

Reply via email to