Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
book-of-vaadin.pdf
Скачиваний:
88
Добавлен:
24.03.2015
Размер:
13.43 Mб
Скачать

Advanced Web Application Topics

"caption": "Session Expired"

}

});//]]>

</script>

Notice that many of the parameters are normally deployment parameters, specified in the deployment descriptor, as described in Section 4.8.4, “Other Deployment Parameters”.

Summary of Div Embedding

Below is a complete example of embedding an UI in a <div> element.

<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"> <head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<meta http-equiv="X-UA-Compatible" content="IE=9;chrome=1" />

<title>Embedding a Vaadin Application in HTML Page</title>

<!-- Set up the favicon from the Vaadin theme -->

<link rel="shortcut icon" type="image/vnd.microsoft.icon" href="/VAADIN/themes/reindeer/favicon.ico" />

<link rel="icon" type="image/vnd.microsoft.icon" href="/VAADIN/themes/reindeer/favicon.ico" />

</head>

<body>

<!-- Loads the Vaadin widget set, etc. --> <script type="text/javascript"

src="VAADIN/vaadinBootstrap.js"></script>

<!-- GWT requires an invisible history frame. It is --> <!-- needed for page/fragment history in the browser. --> <iframe tabindex="-1" id="__gwt_historyFrame"

style="position: absolute; width: 0; height: 0; border: 0; overflow: hidden"

src="javascript:false"></iframe>

<h1>Embedding a Vaadin UI</h1>

<p>This is a static web page that contains an embedded Vaadin application. It's here:</p>

<!-- So here comes the div element in which the Vaadin -->

<!--

application is embedded.

-->

<div

style="width: 300px; border: 2px solid green;"

 

 

id="helloworld" class="v-app">

 

<!-- Optional placeholder for the loading indicator --> <div class=" v-app-loading"></div>

<!-- Alternative fallback text -->

<noscript>You have to enable javascript in your browser to use an application built with Vaadin.</noscript>

</div>

<script type="text/javascript">//<![CDATA[ if (!window.vaadin)

alert("Failed to load the bootstrap JavaScript: "+ "VAADIN/vaadinBootstrap.js");

284

Embedding Inside a div Element

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]