It appears, that most things in component layouting in the toolkit I prefer to do with the CustomLayout. It is easier and more convenient for me to describe positioning stuff using html snippet rather than growing lines of code, I do also like to locate any static content in the layout file to get rid of lots of new Label() components, reserving a room for further UI design changes without touching the code, in other words, I like this layout very much
So does CustomLayout have any drawbacks when used in the toolkit applications in comparison to other layouts ? A larger traffic (depends on CustomLayout contents) that is sent once from server to terminal client comes to my mind, maybe anything else ?
My main concern - is am I right with the chosen strategy or should I revise it and avoid CustomLayouting in some circumstances ?
I also prefer to use CustomLayout and also to me it feels more convenient and also more understandable coming from web development background (I hate Swing programming, btw). I also use Wicket and it exclusively uses HTML layouting, so it’s easier to move between Toolkit and Wicket projects
Cannot say much about drawbacks, though. At least the IT Mill guys instructed us to use CL, but that might be specific to our use-cases.
Using CustomLayout is fine, and has those benefits you mentioned.
The only drawbacks I can think of is
It requires a bit of setup (a directory in the right place), which n00bs don’t like
Some of the advanced layouting stuff, like expand ratios, and dynamically changing the layout, can be hard - depending on your layout. You may also run into trouble if you make a really advanced html-layout and try to use some other layout with advanced features inside it.
The bottom line is that as long as you’re able to make the layout you need using only html, it’s very convenient and allows you to move stuff around quickly.
Also, many teams have a separate design guy/department, and using CustomLayout will enable those to update the layout without touching Java - or perhaps designing the whole thing in Dreamweaver or whatever.
I’ll add my views here as well, I feel a bit obligated to
In my view, CustomLayouts are great, when you’re doing basic layouts, like the one you would be doing with normal webpages.
But as soon as you want to create a more “application style” layout, like the iTunes layout example I did, I’d advise you to turn to the internal layouts. You’ll save yourself a lot of work and frustration not messing around with pure JavaScript and box-model hacks. That’s unless you don’t need to support all browsers, IE in particular, since modern browsers are quite efficient with CSS nowadays.
And dynamic layouts are of course another issue, since you can’t really modify the template of a CustomLayout on the fly very easily.