I want the Linkitem to behave as a button. so instead of opening an URL I want it to listen to the Click event do some operation as in onClick just a IButton's onClick does. How can I?
Thanks
Thanks
Hyperlink googleLink = new Hyperlink("Google", "google"); googleLink.addClickListener(new ClickListener() { public void onClick(Widget sender) { // } });
final LinkItem linkItem = new LinkItem(); final Hyperlink hyperlink = new Hyperlink(); HLayout hLayout = new HLayout(); hLayout.setMembers(hyperlink, linkItem); // The method setMembers(Canvas...) in the type Layout is not applicable for the arguments (Hyperlink, LinkItem)
Layout vLayout=new VLayout(10); vLayout.setSize("100%", "100%"); DynamicForm frmSignOut=new DynamicForm(); LinkItem lnkSignOut=new LinkItem(); lnkSignOut.setShowTitle(false); lnkSignOut.setLinkTitle("Cerrar sesión"); lnkSignOut.addClickHandler(new ClickHandler(){ @Override public void onClick(ClickEvent event) { //TODO handle event } }); frmSignOut.setFields(lnkSignOut); frmSignOut.setSize("100%", "20px"); vLayout.addMember(frmSignOut); vLayout.draw();
Comment