IE and Column Widths March 8, 2011Posted by Phill in Presentation Layer.
Uh… hi. It’s been a looooong time since I last wrote here. I’m sorry. I’ve been very busy on a project which uses GWT and Smart GWT. We’ve come across a lot of problems, some of which I hope to blog about.
But what I want to talk about today is something pretty simple: Internet Explorer and column widths. We’ve written a custom component which replaces Smart GWT’s ListGrid – essentially it uses a standard HTML table instead of using DIVs.
Part of the issue we were having is that the column widths were essentially being ignored: IE was just drawing all the columns as equal width. (The CSS on the TABLE element was set as table-layout: fixed).
We were using the HTML COL tag to set the width for each column – all this was added in dynamically via GWT.
As it turns out, the reason IE was ignoring this was because you need to add it to a COLGROUP first. If you add in a COLGROUP, and then add the COL elements to that group, it works.
Fun with Spring, GWT and Annotations March 4, 2010Posted by Phill in Frameworks, Spring.
Tags: annotations, gwt, gwt-widgets, icefaces, Spring
Recently I’ve been porting across some of our monolithic IceFaces application to a more modular GWT application. (There’s nothing wrong with IceFaces as such, but for several reasons I don’t think it’s the right fit for us any more).
It’s been going pretty well so far, although I’ve only been working on it for a few days. I’ve got the GWT-Widget server library up and running as well, which integrates nicely with Spring for RPC. (It basically means you don’t have to define a new servlet in web.xml for each RPC server you want, you can just define them as Spring beans).
However, it does mean that you have to create a mapping for each Spring bean that you want to publish and define it in the application context XML, which isn’t really ideal for modular applications: I’d quite like them to be detected automatically with annotations, that way if you have another module on the classpath it will automatically be picked up.
So, I created another annotation (@RPCService) and annotated my RPC endpoints with it. The annotation, as its value, had the URL of that endpoint (i.e. “/user” for the users RPC service)
Then, my initial thought was to use Spring to scan the classpath and load each one up. I’ll cut a long story short here and say that was all unecessary: if your RPC classes are defined in the application context (via XML or annotations, it doesn’t matter), all you need to do is get an instance of the Application Context and call getBeansWithAnnotation.
This makes things really simple: I have a bean set up which has an initialise method that uses that method to get all classes annotated with my RPCService annotation, finds out their URLs, and then configures the GWTHandler servlet to map those beans.
Dead easy! And very useful to do, if you’re using the GWT-Widgets library.
Edit: After reading the documentation it seems that what I’ve done is essentially re-implement what’s already available in the library. Still, hopefully it will come in useful if you need to do something similar for another usage…
Google Web Toolkit March 18, 2008Posted by Phill in Frameworks.
First off, in the “other news” department, I’ve started a new job recently. The main application here is based around Java Swing, however we are porting certain parts of it to the web and so I will continue to blog about JEE based things as and when they come up!
From my experiences recently it seems like a very useful tool for certain types of application. I will try and organise my thoughts and blog about it in the near future!