Vaadin 一对多网格绑定和扩展子实体
有客户实体与实体地址有一对多关系,因此有一个list< address> getAddress
在客户地址中有三列,街道,城市和国家。
因此,例如,您可以为一个客户提供一个客户的地址详细信息,并为您所做的
customer.getAddress.get(0).getStreet
customer.getAddress.get(0).getCity
customer.getAddress.get(0).getCountry
个地址
customer.getAddress.get(1).getStreet
customer.getAddress.get(1).getCity
customer.getAddress.get(1).getCountry
第二 做两个地址 扩展地址实体并用3列显示两个地址行?
从本质上讲,我正在看孩子并扩展孩子。
基本网格是否具有这样的功能?我看到您可以使用AddComponentColumn添加不同类型的列,但这仅适用于UI元素,例如添加按钮等吗?
There is the Customer entity which has a one to many relationship to entity Address,so there is a List<Address> getAddress
in Customer.Entity Address has three columns,Street,City and Country.
So for instance to get the address details for one customer with two addresses you do
customer.getAddress.get(0).getStreet
customer.getAddress.get(0).getCity
customer.getAddress.get(0).getCountry
For the second address you do
customer.getAddress.get(1).getStreet
customer.getAddress.get(1).getCity
customer.getAddress.get(1).getCountry
Is there a way to display one row for the Customer details and display a sub-grid or (just dump the Address object's contents) that
expands the Address entity and shows the two address rows with the 3 columns?
In essence show the parent and expand the child.I was looking at TreeGrid but it requires a single type of bean like TreeGrid and I don't know how Address would fill into the picture.
Does the basic Grid have a feature like that? I see that you can add different types of columns with addComponentColumn,but is that only for UI elements,like adding buttons etc ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以为此使用
litrenderer
,但是在网格中显示这大量数据将大大扩展一排的高度。使用
AddComponentColumn
您可以添加所需的任何组件,例如单个按钮,图像或您创建的更复杂的布局。就像塔图·隆德(Tatu Lund)建议您可以使用“ nofollow noreferrer”> itemDeteTailSrenderer 。您可以在这里实现
litrenderer
或componentRenderer
。然后,您可以显示有关客户的所有复杂信息。you could use a
LitRenderer
for that, but displaying this much data in a grid would extend the height of a row a lot.With
addComponentColumn
you can add any Component you want, like a single Button, Image or a more complex Layout that you created.Like Tatu Lund suggested you can use the ItemDetailsRenderer. There you can implement a
LitRenderer
or aComponentRenderer
. Then you can display all complex information about the customer.