blob: e943e2f04b439dd586dca0f16deccb51861bd53a [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.
-->
<ui:composition template="/main.xhtml"
xmlns:tc="http://myfaces.apache.org/tobago/component"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:f="http://xmlns.jcp.org/jsf/core">
<ui:param name="title" value="Non-Faces-Request Demo: Fish Pont"/>
<ui:define name="metadata">
<f:metadata>
<f:viewParam name="fishId" value="#{fishPond.selectedFishId}"/>
<f:viewAction action="#{fishPond.viewAction}"/>
<f:event type="preRenderView" listener="#{fishPond.action}"/>
</f:metadata>
</ui:define>
<tc:panel id="pond">
<tc:in label="Selected:" value="#{fishPond.selectedFish}" readonly="true"/>
<tc:buttons>
<tc:button label="random" action="#{fishPond.random}">
<f:ajax render="pond :page:header:headerInfo" execute="pond"/>
</tc:button>
<tc:button label="back to start"
action="/content/30-concept/90-non-faces-request/Non_Faces_Request.xhtml?faces-redirect=true"/>
</tc:buttons>
<!-- todo: space between buttons and in -->
<tc:in label="Id:" value="#{fishPond.selectedFishId}">
<f:facet name="after">
<tc:link label="Go"
action="/content/30-concept/90-non-faces-request/x-fish-pond.xhtml?faces-redirect=true&amp;includeViewParams=true"/>
</f:facet>
</tc:in>
<tc:panel>
This example uses
<code class="language-markup">&lt;f:viewParam/></code> (since JSF 2.0) and
<code class="language-markup">&lt;f:viewAction/></code> (since JSF 2.2).
</tc:panel>
</tc:panel>
</ui:composition>