Author: lfryc(a)redhat.com
Date: 2011-01-11 06:33:35 -0500 (Tue, 11 Jan 2011)
New Revision: 20940
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/resources/metamer/attributes.xhtml
Log:
when many (>4) select-one attributes are present, use menu instead of radio
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-01-11
09:49:12 UTC (rev 20939)
+++
modules/tests/metamer/trunk/application/src/main/webapp/resources/metamer/attributes.xhtml 2011-01-11
11:33:35 UTC (rev 20940)
@@ -1,6 +1,7 @@
<!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:c="http://java.sun.com/jsp/jstl/core"
xmlns:composite="http://java.sun.com/jsf/composite"
xmlns:a4j="http://richfaces.org/a4j">
+
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:composite="http://java.sun.com/jsf/composite"
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:fn="http://java.sun.com/jsp/jstl/functions">
<h:body>
<composite:interface>
@@ -39,12 +40,21 @@
<f:selectItem itemValue="false"
itemLabel="false"/>
</h:selectOneRadio>
</c:when>
-
+
<c:when test="#{entry.value.selectOptions !=
null}">
- <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: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()'}">
+ <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>