PDA

View Full Version : Bind properties in List



claudio
Jan 3rd, 2005, 07:59 AM
Hi All,

about 3 or 4 month ago i had written a little Testclass for binding properies in Lists.

A little example:


class Product {
List descriptions;
...
}

class ProductsDescription {
int languageId
String description;
....
}



Now in my Testclass i bound the property description in a Form like this:




class MyForm extends AbstractForm {
public JComponent createFormControl() {
TableFormBuilder formBuilder = new TableFormBuilder(getFormModel());
formBuilder.add("descriptions[0].description");
}
}



Now, i have tried this code with the newest spring rich version and it don't works anymore!?

I there another way to bind such scenario?
Thanks!

Claudio

claudio
Jan 4th, 2005, 02:39 AM
Hi all,

i went a little deeper in the code an saw that the class org.springframework.binding.support.DefaultBeanMet adata
seems to have this ability.



/**
* Determine the first respectively last nested property separator in the
* given property path, ignoring dots in keys (like "map[my.key]").
* @param propertyPath the property path to check
* @param last whether to return the last separator rather than the first
* @return the index of the nested property separator, or -1 if none
*/
private int getNestedPropertySeparatorIndex(String propertyPath, boolean last) {
...

But i still can't figure out how to use this within the SwingFormModel class? Anyone?

Thanks!

Claudio

Keith Donald
Jan 4th, 2005, 01:27 PM
Hmm.. I am opening up a JIRA issue for this, and should start work on it after 1/13. Thanks for the report Claudio.

TRiNiTy
Jan 16th, 2005, 02:41 PM
Is there a workaround for this problem?

claudio
Jan 17th, 2005, 06:58 AM
Hi,

i applied the patches from JIRA:
http://opensource.atlassian.com/projects/spring/browse/RCP-68

Seems to work.

siu
Claudio