Wednesday, February 29, 2012

TextEditor and ClickHandlers

Today was able to completely implement the text editor!!!! woooottt! I was a little stoked. Mostly because its the first component that we won't need to go back and add functionality to, which is very exciting. I also updated the menu, before it was created using LinkItems, now it is populated with Buttons! Buttons I tell you! not the biggest change, but it does lend its self to looking much more professional. Next step for me is the integration process. As it stands now, while all the components display themselves in one window, the problem is that they are, to some extent disconnected from each other. So, I will need to get them all to talk to each other and be able to place things on different windows and so on and so forth.

     On a different note though, I had a grand ol' time tonight working with smartGwt's event handlers. They are a lovely thing prone to all kinds of nonsense. Tonight what I found out is that you can't have multiple kinds of click handlers in one class. You might be asking yourself, isn't there just one kind of click handler? nope. not in smartGWT. here we have lots of click handlers. and what I found is that if you want to be able to use multiple kinds of click handlers. You can import the main kind like this :
Import ..form.fields.events.ClickEvent;
Import .. form.fields.events.ClickHandler;

But you'd also like to use one of these: 

widgets.events.ClickEvent;
widgets.events.ClickHandler; 
You can't do it. 
Eclipse gets grumpy at you and so the solution is to do something horrendously gross like this:
blah.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() { @Override public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) { }  
});
Isn't that wonderful?
welcome to the world I am living in. 

Anyways I am off. Too many things to do.. not enough time. 
Peace. 

No comments:

Post a Comment