CustomLayout & evaluation


I just started to evaluate vaadin as a replacement for our current component framework.

As we currently have an extensive set of UI components written in jquery/css/html including a template, my first task was to get this as an extensible component that other developers could use out of the box.

Which lead me to the CustomLayout.

Here’s what I have so far

public class HomePage extends UI
	protected void init(final VaadinRequest request)
		final VerticalLayout mainLayout = new VerticalLayout();

		final CustomLayout layout = new CustomLayout("my_layout");

		final Panel panel = new Panel("app_content");

		final Button button = new Button("Click Me");
		button.addClickListener(new Button.ClickListener()
			public void buttonClick(final ClickEvent event)
				layout.addComponent(new Label("Thank you for clicking"));

and here’s my layout

<!DOCTYPE html>
<html lang="en-us">
    <link href="/my.css" type="text/css" rel="stylesheet"/>
    <script src="/my.js" type="text/javascript"></script>
<div class="template>
    Some Content
    <div location="app_content"></div>

I get the layout - none of my js/css - and the app_content is not tag is not replaced with the components in the Panel.

I’m probably doing something silly and not adding the components in the right order.

All right after a bit of experimentation and unable to get our html template working which should be fairly simple, it appears to me that vaadin is probably not the droid I’m looking for.

It appears to a be a good fit for

  • you don’t already have a existing component suite. We have an extensive set of UI components built on top jquery/jquery-ui.
  • you don’t have a corporate theme that you have to use for UI’s and their associated components.
  • Swing/Java is your thing. CSS/HTML/JS is scary to your developers.

One of the main issues I was looking to solve with our current server side framework, Wicket, was the issue of session expiration and multi-window support. I would like app teams to easily have control over whether session expiration is seamless to the user.

You can do it with Wicket but it requires a lot of digging into the internals.

Comments/suggestions are welcome

I haven’t used CustomLayout for a while, but it seems to me that you should use CustomLayout.addComponent(component, “slotName”) instead of addComponent(component), which adds the component to a default slot that your template does not seem to have.

Based on what you wrote, though, it might be that some other framework fits your needs better, although e.g. integrating JavaScript components is much easier in Vaadin 7 than previous versions. With Vaadin, you would probably need quite a bit of work to adapt your corporate theme for Vaadin (perhaps even writing your own theme on top of the Vaadin “base” theme for full customization). On the other hand, much of the theme related work might be a one-time job rather than something application specific.