ListFilter<T> on related entity proxy....
How to do this:
I have an entity like this one:
MyEntity
{
public String getProperty1...
public String setProperty1
public MyOtherBean getMyOtherBean...
public setMyOtherBean(MyOtherBean)
}
PropertyAccess:
public interface MyEntityProperties extends PropertyAccess<MyEntity> {
ModelKeyProvider<MyEntity> key();
ValueProvider< MyEntity, String> property1();
ValueProvider<MyEntity, MyOtherBean> myOtherBean();
}
Now, with this kind of a bean, there is no problem setting the SimpleComboBox<MyOtherBean> as editor for that column....so editing is working without problems,but how to filter it?
If I put the ListFilter<MyOtherBean>.....and fill the associated store to hold a list of MyOtherBean entities,
then in Filter I get the list of MyOtherBean entities,but it displays only their .toString() representation, which obviously is not what I want. Instead, I want it to display some field that I want it to use as display property(for example MyOtherBean.getProperty1()).
How to achieve this?
I was thinking about not using the
ValueProvider<MyEntity, MyOtherBean> myOtherBean();
in PropertyAccess, but instead, refer directly to the field I want displayed, like this:
@Path(MyOtherBean.property1)
ValueProvider<MyEntity, String> myOtherBeansProperty();
but then, what would I need to do to make editing work,because I guess it would only edit the "property1" from MyOtherBean and not update the whole MyBean.MyOtherBean entity.
I mean, maybe I can bypass this, but I just wanted to know what would be the "right" way of doing this?
Tnx.