Author: lfryc(a)redhat.com
Date: 2010-07-10 14:13:32 -0400 (Sat, 10 Jul 2010)
New Revision: 17819
Added:
root/tests/metamer/trunk/src/main/webapp/resources/testapp/
root/tests/metamer/trunk/src/main/webapp/resources/testapp/attributes.xhtml
Log:
https://jira.jboss.org/jira/browse/RFPL-466
* created composite component for attributes, cannot be used for now because of a bug in
JBoss
Added: root/tests/metamer/trunk/src/main/webapp/resources/testapp/attributes.xhtml
===================================================================
--- root/tests/metamer/trunk/src/main/webapp/resources/testapp/attributes.xhtml
(rev 0)
+++ root/tests/metamer/trunk/src/main/webapp/resources/testapp/attributes.xhtml 2010-07-10
18:13:32 UTC (rev 17819)
@@ -0,0 +1,54 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:rich="http://java.sun.com/jsf/composite/rich"
+
xmlns:a4j="http://richfaces.org/a4j"
xmlns:c="http://java.sun.com/jsp/jstl/core"
+
xmlns:composite="http://java.sun.com/jsf/composite">
+
+<h:body>
+ <composite:interface>
+ <composite:attribute name="id" type="java.util.String"
/>
+ <composite:attribute name="value"
type="org.richfaces.testapp.Attributes" required="true"
+ shortDescription="Representation of attributes of a component."
/>
+ <composite:attribute name="render" />
+ <composite:attribute name="columns" default="2"
type="int" shortDescription="some description for columns" />
+ </composite:interface>
+
+ <composite:implementation>
+ <h:panelGrid id="#{cc.attrs.id}" columns="#{cc.attrs.columns *
2}" styleClass="attributes"
+ columnClasses="attributes-first-column, attributes-second-column,
attributes-first-column, attributes-second-column">
+ <c:forEach items="#{cc.attrs.value}" var="entry">
+
+ <h:panelGroup layout="block">
+ <h:outputLabel id="#{entry.key}Label"
value="#{entry.key}" style="margin-right: 5px;" />
+ <h:graphicImage value="/resources/images/help.png"
title="#{cc.attrs.value.getHelp(entry.key)}"
+ rendered="#{cc.attrs.value.getHelp(entry.key) != null}"
height="28px;"
+ style="vertical-align: middle;"
styleClass="attribute-help" />
+ </h:panelGroup>
+
+ <c:choose>
+ <c:when
test="#{cc.attrs.value.isBoolean(entry.key)}">
+ <h:selectBooleanCheckbox id="#{entry.key}Input"
value="#{cc.attrs.value[entry.key]}">
+ <a4j:ajax event="change"
render="#{cc.attrs.render}" />
+ </h:selectBooleanCheckbox>
+ </c:when>
+
+ <c:when
test="#{cc.attrs.value.hasSelectOptions(entry.key)}">
+ <h:selectOneRadio id="#{entry.key}Input"
value="#{cc.attrs.value[entry.key]}"
+ layout="pageDirection">
+ <f:selectItems
value="#{cc.attrs.value.getSelectOptions(entry.key)}" />
+ <a4j:ajax event="change"
render="#{cc.attrs.render}" />
+ </h:selectOneRadio>
+ </c:when>
+
+ <c:otherwise>
+ <h:inputText id="#{entry.key}Input"
value="#{cc.attrs.value[entry.key]}" style="width: 200px;">
+ <a4j:ajax event="blur"
render="#{cc.attrs.render}" />
+ </h:inputText>
+ </c:otherwise>
+ </c:choose>
+
+ </c:forEach>
+ </h:panelGrid>
+ </composite:implementation>
+</h:body>
+</html>
\ No newline at end of file