I've got a form problem that I don't really now how to handle.

I've got three entities Person, PersonProperty and PropertyType.

A Person has a Set<PersonProperty>
A PersonProperty has a reference to a Person, a PropertyType and
contains a value.

What I would like to do is to edit a users dynamic properties by
showing them all on screen.
In a previous email to the list there was an example of a
Master-Detail form which seemed to be a good start. Code below:

ListView dynamicProperties = new ListView("propertiesAsList") {

                protected void populateItem(ListItem item) {

                    TextField valueField = new TextField("value");
                    FormComponentFeedbackBorder feedbackBorder = new


                    Label label = new Label("propertyType.name");
                    label.add(new AttributeModifier("for", true, new

                protected IModel getListItemModel(IModel
listViewModel, int index) {
                    return new
CompoundPropertyModel(super.getListItemModel(listViewModel, index));



This works great for editing the values of the dynamic properties a
user has already set, but what I would like to do is to iterate all
the possible ones, ie the PropertyType:s and get the values from the
PersonProperty if one exist or create one if it doesn't.
I think I need some model-trickery to achieve this but I can't really see it.

Any help would be appreciated!


Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
Wicket-user mailing list

Reply via email to