declarative syntax (own components, functions and their mapping)


I have two issues about using declarative syntax in Vaadin:

: If you are embedding Vaadin UIs in a web page like you can see in this tutorial
, you cannot do the package mapping via the -tag. Does anybody have an idea how it could work?

In other words:

How do I realize this:

<meta name="package-mapping" content="my:com.example.myapp" /> …when embedding a Vaadin application into another application (e.g. JSF xhtml)

: I would like to extend a component by an existing or a new function that I can use it declarative - for example:

VerticalLayout myVerticalLayout = new VerticalLayout();
myVerticalLayout.setMargin(newMarginInfo(false, false, false, true));

// I know margin itself already exists, but just with all parameters “true”.
// I am interested in something like:

[/code]Anybody an idea?




If I’m understanding correctly you are trying to embed a vaadin application inside a declarative html file? That is not supported. Even though the declarative format is html it is not directly rendered in the browser. The html is just parsed on the server side, converted into a Component structure and added to the UI. In that process you will loose any custom html you have in that file.


If you want to add new tags in your extended component you need to overwrite the
methods in your component.

Hi John,

I edited my post to get more precisely. It is more about having an idea how to realize the -tag when embedding a Vaadin application into another application (e.g. JSF xhtml).

Thx for the quick response and point two.

About the margin example in point 2, I think you’re happy to hear that per-edge margins are supported starting with Vaadin 7.5 :slight_smile: (
ticket 17190