How to display the Link with click Listener in table data is populated by B

I have create a java class with string properties, i have get the dynamic data from database
and added this class to BeanItemContainer and attach to table data source.
here is the following code I have used to display the data in table.

public class Sample implements Serializable {
private String billOfladingNo;
private String containerNo;
//setters and getters
}

List result = executionPlanDelegate.getDatbleData();
Table table = new Table();
final BeanItemContainer container = new BeanItemContainer(ExecutionPlanVO.class, executionPlanVOs);
container.addBean(new Sample());
table.setContainerDataSource(container);
}

here table with two columns as strings displayed in UI,
here I would like to change the first column (billOfladingNo) as Link in table and populate the dynamic data which is coming from data base.
and when I click this link I want to search with same billOfladingNo name in the table like filters.

could someone help me how can I achieve this with vaadin ?

I have tried with other way like

table.addGeneratedColumn(“BillOfLading”, new Table.ColumnGenerator() {
public Component generateCell(Table source, Object itemId,
Object columnId) {
if (columnId.equals(“BillOfLading”)) {
Link bol = new Link(container.getItem(itemId).getBean().getBillOfladingNo(),null);
container.addItem(bol);
return bol;
}
return null;
}
});

but it is added another new column in table, and is there a way to replacethe column type as link?

Thanks & Regards
Kiran.

Why dont you use indexedcontaner.?

container.addContainerProperty(“link”, Link.class, null);

Link combo = new Link(“To appease both literal and visual”,
new ExternalResource(“http://vaadin.com/”));
item.getItemProperty(“link”).setValue(combo);

Yes, I have tried the pice of code with IdexedContainer insted BeanItemContainer, I am getting error…

IndexedContainer container = new IndexedContainer();
container.addContainerProperty(“billOfladingNo”, String.class, null);
container.addContainerProperty(“containerNo”, String.class, null);

for (ExecutionPlanVO ep: executionPlanVOs) { Item newItem = container.getItem(container.addItem()); newItem.getItemProperty(“billOfladingNo”).setValue(ep.getBillOfladingNo()); newItem.getItemProperty(“containerNo”).setValue(ep.getContainerNo()); } Table table = new Table();
//BeanItemContainer container = new BeanItemContainer(ExecutionPlanVO.class, executionPlanVOs);
//container.addBean(new ExecutionPlanVO());
table.setContainerDataSource(container);
table.setStyleName(“ep-list-table”);


ERROR:

java.lang.IllegalArgumentException: Value is of invalid type, got java.lang.String but com.vaadin.ui.Link was expected

so could you expaina bit further, how can i place a link in table, the data im getting from java bean dynamically.
and the link will work like filter. with the same string value.
Thanks
Kiran.

its container.addContainerProperty(“billOfladingNo”, Link.class, null);

not .container.addContainerProperty(“billOfladingNo”, String.class, null);

Yes, i have placed Link.class then only i got this error.

and I have tried in differend way to place the link in table and

public Component getMainContent(ViewChangeListener.ViewChangeEvent event) { List<ExecutionPlanVO> executionPlanVOs = executionPlanDelegate.getExecutionPlans(getSearchVO()); Table table = new Table(); table.addContainerProperty("Bill Of Leading", Link.class, null); table.addContainerProperty("Container No.", String.class, null); for (int i = 0 ; i < executionPlanVOs.size() ; i++) { table.addItem(new Object[] { new Link(executionPlanVOs.get(i).getBillOfladingNo(), null) , new String(executionPlanVOs.get(i).getContainerNo()) }, new Integer(i)); } return table; and now I am trying to implement the filter on the BillOfLading column, to show the same billof lading name rows like search functionality, is it possible to implement ?

and for other column im implmenting tooltip which should shoe the dynamic data?
I doubt how to add the listners and tooltip data to this columns? because the objects are created in array like

table.addItem(new Object[] { new Link(executionPlanVOs.get(i).getBillOfladingNo(), null) , new String(executionPlanVOs.get(i).getContainerNo()) }, new Integer(i)); please share some ideas how can we do it in efficetive way.

For tooltip yu can set description I guess … yu want to have listeners to the columns or rows ?

Yes, description works for me, I wanted to place a tooltip for a perticual column.

table.setItemDescriptionGenerator(new AbstractSelect.ItemDescriptionGenerator() {
public String generateDescription(Component source, Object itemId, Object propertyId) {
if (propertyId == STATUS) {
return "Cell description " + itemId + "," + propertyId;
} return null;
} });

but I would want to populate the data from the bean (ExecutionPlanVO object), which is specific for each row item.

listner in thhe sence,I am looking for a filter functionality in biilof ladingNo Column, like if i click billOf lading number column value ‘abd’ i shoud be able to display the rows which has the billofLading number abc. that is i wanted to try.

and small question, I saw some forums for filter they have used a text field in the header, when we type there it will show the filterd result, so wich is the best way to use filters?

Have a search button on the top .Let it open a window .In that window add texfield or combox that yu want to search and submit button.