Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Passing more than one parameter on button click.
Hi,
We need a solution for one of the scenario where we have to pass more than one parameter on button click.
eg:
on clicking of employee instead of passing only emp_id now we need to pass emp_id,emp_name,emp_joindate,emp_salary
Normally we use event.getButton().getCaption() to fetch emp_id if it is just one parameter but in our case we are looking for a way to pass more than one parameter.
Thanks.
event.getButton().getCaption() to fetch emp_id
seems like a very bad way.
You could do something like this:
public class MyButtonListener implements Clicklistener{
private final Employee employee;
public MyButtonListener( Employee employee){
this.employee = employee;
}
.....
button.addListener(new MyClickListener(currentEmployee));
or if the employee is based on the current value in a table just to a Employee e = (Employee)table.getValue();
Danny Roest: or if the employee is based on the current value in a table just to a Employee e = (Employee)table.getValue();
... remembering that the value of the table is an item identifier and needs to be mapped to the Employee if not using a BeanItemContainer where the ID is the bean itself.