I am creating custom widgets, which is containing checkbox, firstname, lastname labels, which I am calling PersonItem.
<g:HorizontalPanel verticalAlignment="middle">
<g:CheckBox ui:field="isSelected" />
<g:Label ui:field="firstName" text="placeholder" />
<g:Label ui:field="lastName" text="placeholder" />
</g:HorizontalPanel>
And what I would like to do is create another widget called PersonList,
which will contain all PersonItems as List<PersonItem>
PersonList view would contain
@UiField
List<PersonItem> personItems;
But unfortunatelly I have no idea how to make uiBinder xml file for this kind of field in PersonList.ui.xml file. Is it even possible?
In addition to the question asked in comment: I would like to use PersonList just as a tag
<p:PersonList ui:field="list" />
and the PersonList would by provided with data when main presenter is loaded.
As @Marc Ströbel suggested, you can use
CellListto manage your data list. As a future improvement you can easily add, for example, a pager to such a list.And you can use any container for
CellList. You just need to overwrite the cell's (AbstractCell's)render()method.Example code (as a container I've used
VerticalPanel):I've assumed that person data (firstName, lastName, etc.) is stored in
PersonDataclass.Now you can use the
PersonListwidget inUiBinderjust as you wanted: