try something like this from the presenter:
view.setHandler(ViewHandler handler);
interface ViewHandler {
void onView(Category c);
void onRemove(Category c);
}
whatever any one say to you, DO NOT USE GETTERS ON THE VIEW INTERFACE :)
2010/7/11 nacho <[email protected]>
> Hi, i'm trying to make a view like the following that i paste. But i
> need to add click handlers to the links in the presenter. How could i
> do. I was looking the method getClickedCell in the mvp presentation
> but the problem is that my links are inside a FlowPanel that is inside
> a Vertical that is inside a Cell.
>
> What i need to do is to fire an event when the links are clicked, for
> example, when i press in the View link i need to populate the
> pnlCategoryImages with the result of my rpc.
>
> The only thing that i figure to do is to call the event bus from the
> view itself, but it doesn't look so pretty.
>
> Anyone have some ideas?
>
> This is part of my code in the setData() method.
>
> for(Category category: categories){
> int tblCategoriesNumRow = tblCategories.getRowCount();
>
> VerticalPanel pnlCategory = new VerticalPanel();
>
> Hyperlink lnkAdd = new Hyperlink("Add", "");
> Hyperlink lnkRemove = new Hyperlink("Remove", "");
> Hyperlink lnkView = new Hyperlink("View", "");
>
> FlowPanel pnlCategoryButtons = new FlowPanel();
> pnlCategoryButtons.add(lnkAdd);
> pnlCategoryButtons.add(lnkRemove);
> pnlCategoryButtons.add(lnkView);
> pnlCategory.add(pnlCategoryButtons);
>
> tblCategories.setWidget(tblCategoriesNumRow, 0,
> chkCategory);
> tblCategories.setWidget(tblCategoriesNumRow, 1,
> pnlCategory);
>
> tblCategoriesNumRow = tblCategories.getRowCount();
>
> ScrollPanel pnlCategoryImages = new ScrollPanel();
> tblCategories.setWidget(tblCategoriesNumRow, 0,
> pnlCategoryImages);
> }
> ...
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-web-toolkit%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>
>
--
http://gwtupdates.blogspot.com/
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.