I am using MVP architecture and am trying to track the click event on a GWT cellTAble.
1.I have one ConfigureViewImpl class which has ConfigurePlace as a Place.
2.ValidationViewImpl class which has ValidationPlace as a Place.
I have One table in ConfigueViewImpl.On the click of one of its columns , another place(ValidationPlace) should arrive in order to navigate to other page.But I have to track the click event of the particular row.
For this I am trying to pass the Bean but without any sucess.
final CellTable<UserBean> configGrid= new CellTable<UserBean>(5,(Resources) GWT.create(TableResources.class));
final SingleSelectionModel<UserBean> selectionModel = new SingleSelectionModel<UserBean>();
claimsGrid.setSelectionModel(selectionModel,
DefaultSelectionEventManager.<UserBean> createDefaultManager());
Column<UserBean, String> action = new Column<UserBean, String>(new ButtonCell()) {
@Override
public String getValue(UserBean object) {
// Get the value from the selection model.
return"images/edit.png";
}
};
configGrid.addColumn(action,"Action");
action.setFieldUpdater(new FieldUpdater<UserBean, String>() {
public void update(int index, UserBean object, String value) {
//need to pass the bean 'object'
listener.goTo(new ValidationPlace());
}
});
I need to pass ‘UserBean object’ as an argument to ValidationPlace() but GWT is not allowing to pass the bean parameters as it allows only String as tokens.Is there a way through which I can track the click event and pass the info to next page.Any suggestions appreciated.Thanks in advance.
You’re almost there – you simply need to pass your beans into your place and then generate a token from those.
Something like this
The parameter parsing is very naive and doesn’t handle escaping, &., = etc but generally suffices.