I have a Grid that has a button in one of the columns for every row, I want to fetch the entire row value when the button is clicked so that I can store it somewhere else than the bean from where the grid sources it’s data.
How can I fetch the row values when the button is clicked? And after it is clicked I want to “disable” the button.
To be able to disable the button on click, you could replace the ButtonRenderer with a
ComponentRenderer with Buttons and in the ClickListener use the Button’s
API to disable the button.
Remember that when using a ComponentRenderer you should consider that using it might lead into performance problems.
It’s up to your imagination what you do in the ButtonRenderer’s RendererClickListener.click method. You can e.g. read the content of all the visible columns and create a new bean based on those:
Person clone = new Person();
clone.setFirstName(e.getItem().getFName());
clone.setLastName( e.getItem().getLName());
Service.doSomathing(clone);
Thanks for your reply, I am not trying to refresh the row. Basically, when I click the button, I want to fetch the row values and store them in a new Bean - which is not related to the Grid in any way. Will the above solution that you have sent work for what I am trying to achieve?