declarative syntax (own components, functions and their mapping)

Hi!

I have two issues about using declarative syntax in Vaadin:


One
: If you are embedding Vaadin UIs in a web page like you can see in this tutorial
https://vaadin.com/book/-/page/advanced.embedding.html
, 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)


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

[code]
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?

thx

Tom

One:

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.

Two:

If you want to add new tags in your extended component you need to overwrite the
AbstractComponent.writeDesign()
and
AbstractComponent.readDesign()
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
)