Hi,
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");
valueField.setOutputMarkupId(true);
FormComponentFeedbackBorder feedbackBorder = new
FormComponentFeedbackBorder("feedback");
feedbackBorder.setRenderBodyOnly(true);
feedbackBorder.add(valueField);
item.add(feedbackBorder);
Label label = new Label("propertyType.name");
label.add(new AttributeModifier("for", true, new
Model(item.getId())));
item.add(label);
}
protected IModel getListItemModel(IModel
listViewModel, int index) {
return new
CompoundPropertyModel(super.getListItemModel(listViewModel, index));
}
}.setReuseItems(true);
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!
//Mats
-------------------------------------------------------------------------
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
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user