Oh I did it ...
The previous code need small changes:
Model model = new Model(new AttributeDescriptor());
addAttributeForm.setModel(model);
DropDownChoice attributeDescriptor = new
DropDownChoice("attributeDescriptors", model,
getAttributeDAO().getAllAttributeDescriptors());

and then we can use:
protected void onSubmit() {
                    AttributeDescriptor attributeDescriptor =
(AttributeDescriptor) getModel().getObject();
                    consumer.getAttributeDescriptor().add(attributeDescriptor);
                    try {

getConsumerService().changeAttributesDescr(consumer.getName(),
consumer.getAttributeDescriptor());
                    } catch (ConsumerException e) {
                        e.printStackTrace();
                    }
                }

consumer also was removed from model (removed line item.setModel(new
CompoundPropertyModel(consumer)); )
so form could its own model ...
Maybe there is better solution for this, but that is working so it
maybe helps someone  ....
Best regards,
Adr

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to