blob: df1b157d5f5f97a7ba1b073579492bcac50d3982 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<!-- XXX This is an old page. Content might not be up to date. Needs to be refactored, or just deleted. -->
<f:view xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:tc="http://myfaces.apache.org/tobago/component"
xmlns:c="http://java.sun.com/jsp/jstl/core">
<tc:page width="800px" height="800px" label="Dynamic Include">
<tc:box label="Dynamic Included Panels">
<tc:panel>
<p>
This example demonstrates dynamic includes with Facelets.
</p>
<p>
<b>Important:</b> Use the "panel" variable only in Facelet Tags like ui:include, not in Components!
</p>
<p>
<b>Important:</b> The action has to return a view-id, and not null,
So you ensure you get a new view, and no problems with ids.
</p>
<p>
TODO: Automatic test with Selenium!
</p>
</tc:panel>
<tc:messages/>
<c:forEach var="panel" items="#{dynamicController.panels}">
<ui:include src="#{panel.name}"/>
</c:forEach>
<tc:flowLayout textAlign="right">
<tc:button label="Next" action="#{dynamicController.addPanel}"/>
<tc:button label="Reset" immediate="true" action="#{dynamicController.reset}"/>
</tc:flowLayout>
</tc:box>
</tc:page>
</f:view>