Author: lfryc(a)redhat.com
Date: 2011-02-05 09:50:20 -0500 (Sat, 05 Feb 2011)
New Revision: 21480
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/resources/metamer/attributes.xhtml
Log:
metamer:attributes - added @exclude parameter to be able exclude some attributes from page
(e.g. if they doesn't make sense in given scenario)
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/resources/metamer/attributes.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/resources/metamer/attributes.xhtml 2011-02-05
14:49:51 UTC (rev 21479)
+++
modules/tests/metamer/trunk/application/src/main/webapp/resources/metamer/attributes.xhtml 2011-02-05
14:50:20 UTC (rev 21480)
@@ -12,6 +12,7 @@
<composite:attribute name="execute" default="@form"
/>
<composite:attribute name="columns" default="2"
type="int" shortDescription="The number of columns into which list of
attributes will be rendered" />
<composite:attribute name="type" default="server"
type="java.lang.String" shortDescription="The type of request done for
changing the attribute (server/ajax)" />
+ <composite:attribute name="exclude" default="" />
</composite:interface>
<composite:implementation>
@@ -24,47 +25,49 @@
<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;"
for="#{entry.key}Input"/>
- <h:graphicImage
value="/resources/images/help.png" title="#{entry.value.help}"
- rendered="#{entry.value.help !=
null}" height="18px;"
- style="vertical-align: middle;"
styleClass="attribute-help" >
- </h:graphicImage>
- </h:panelGroup>
+ <c:if test="#{not fn:contains(cc.attrs.exclude,
entry.key)}">
+ <h:panelGroup layout="block">
+ <h:outputLabel id="#{entry.key}Label"
value="#{entry.key}" style="margin-right: 5px;"
for="#{entry.key}Input"/>
+ <h:graphicImage
value="/resources/images/help.png" title="#{entry.value.help}"
+ rendered="#{entry.value.help !=
null}" height="18px;"
+ style="vertical-align: middle;"
styleClass="attribute-help" >
+ </h:graphicImage>
+ </h:panelGroup>
+
+ <c:choose>
+ <c:when test="#{entry.value.bool}">
+ <h:selectOneRadio id="#{entry.key}Input"
value="#{entry.value.value}" onchange="#{cc.attrs.type == 'server'
? 'submit()' : 'submitAjax()'}">
+ <f:selectItem itemValue="null"
itemLabel="null"/>
+ <f:selectItem itemValue="true"
itemLabel="true"/>
+ <f:selectItem itemValue="false"
itemLabel="false"/>
+ </h:selectOneRadio>
+ </c:when>
+
+ <c:when test="#{entry.value.selectOptions !=
null}">
+ <c:choose>
+ <c:when
test="#{fn:length(entry.value.selectOptions) > 4}">
+ <h:selectOneMenu
id="#{entry.key}Input" value="#{entry.value.value}"
+ onchange="#{cc.attrs.type
== 'server' ? 'submit()' : 'submitAjax()'}"
+ style="width:
100%">
+ <f:selectItems
value="#{entry.value.selectOptions}" noSelectionValue="null" />
+ </h:selectOneMenu>
+ </c:when>
+ <c:otherwise>
+ <h:selectOneRadio
id="#{entry.key}Input" value="#{entry.value.value}"
+ onchange="#{cc.attrs.type
== 'server' ? 'submit()' : 'submitAjax()'}"
+
layout="pageDirection">
+ <f:selectItems
value="#{entry.value.selectOptions}" />
+ </h:selectOneRadio>
+ </c:otherwise>
+ </c:choose>
+ </c:when>
+
+ <c:otherwise>
+ <h:inputText id="#{entry.key}Input"
value="#{entry.value.value}" style="width: 200px;"
onchange="#{cc.attrs.type == 'server' ? 'submit()' :
'submitAjax()'}" />
+ </c:otherwise>
+ </c:choose>
+ </c:if>
- <c:choose>
- <c:when test="#{entry.value.bool}">
- <h:selectOneRadio id="#{entry.key}Input"
value="#{entry.value.value}" onchange="#{cc.attrs.type == 'server'
? 'submit()' : 'submitAjax()'}">
- <f:selectItem itemValue="null"
itemLabel="null"/>
- <f:selectItem itemValue="true"
itemLabel="true"/>
- <f:selectItem itemValue="false"
itemLabel="false"/>
- </h:selectOneRadio>
- </c:when>
-
- <c:when test="#{entry.value.selectOptions !=
null}">
- <c:choose>
- <c:when
test="#{fn:length(entry.value.selectOptions) > 4}">
- <h:selectOneMenu
id="#{entry.key}Input" value="#{entry.value.value}"
- onchange="#{cc.attrs.type
== 'server' ? 'submit()' : 'submitAjax()'}"
- style="width:
100%">
- <f:selectItems
value="#{entry.value.selectOptions}" noSelectionValue="null" />
- </h:selectOneMenu>
- </c:when>
- <c:otherwise>
- <h:selectOneRadio
id="#{entry.key}Input" value="#{entry.value.value}"
- onchange="#{cc.attrs.type
== 'server' ? 'submit()' : 'submitAjax()'}"
-
layout="pageDirection">
- <f:selectItems
value="#{entry.value.selectOptions}" />
- </h:selectOneRadio>
- </c:otherwise>
- </c:choose>
- </c:when>
-
- <c:otherwise>
- <h:inputText id="#{entry.key}Input"
value="#{entry.value.value}" style="width: 200px;"
onchange="#{cc.attrs.type == 'server' ? 'submit()' :
'submitAjax()'}" />
- </c:otherwise>
- </c:choose>
-
</c:forEach>
</h:panelGrid>
</a4j:outputPanel>
Show replies by date