Hi Im try to add button in a grid in vaadin but it print the reference on button object.
Grid statementEnquiriesList = new Grid();
statementEnquiriesList.addColumn("", Button.class);
statementEnquiriesList.addColumn("DATE/TIME", String.class);
statementEnquiriesList.addColumn("TRANSACTION ID", String.class);
statementEnquiriesList.addColumn("FROM", String.class);
// historyList is an array object
for (int i = 0; i < historyList.size(); i++)
{
HistoryList recordObj = historyList.get(i);
Button addBtn = new Button();
addBtn.setCaption("Add");
statementEnquiriesList.addRow(addBtn , recordObj.getDate(), recordObj.getTransactionId(), recordObj.getFrom());
}
how can i print "Add" caption on this
Vaadin 8.1 - Components in Grid. Vaadin 8.1 now has a built-in ComponentRenderer for displaying buttons or other components including your own custom components in a Grid. See first item "Components in Grid" on What's New page. Example: Add a label to a grid.
To add these ButtonFields, click on the Edit Columns link from the GridView's smart tag, select the ButtonField field type from the list in the upper left and click the Add button. Move the two ButtonFields so that they appear as the first two GridView fields.
Vaadin 8.1 now has a built-in ComponentRenderer
for displaying buttons or other components including your own custom components in a Grid.
See first item "Components in Grid" on What's New page.
Example: Add a label to a grid.
grid.addColumn(
person -> new Label( person.getFullName() ) ,
new ComponentRenderer()
).setCaption( "Full Name" )
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With