Author: artdaw
Date: 2011-03-09 11:50:00 -0500 (Wed, 09 Mar 2011)
New Revision: 22115
Modified:
branches/4.0.X/examples/input-demo/src/main/webapp/examples/select.xhtml
branches/4.0.X/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelect.java
branches/4.0.X/ui/input/ui/src/main/java/org/richfaces/renderkit/SelectRendererBase.java
branches/4.0.X/ui/input/ui/src/main/templates/select.template.xml
Log:
RF-10667: rich:select: missing attributes style, styleClass and title are fixed. Reviewed
by Alex Kolonitsky.
Modified: branches/4.0.X/examples/input-demo/src/main/webapp/examples/select.xhtml
===================================================================
--- branches/4.0.X/examples/input-demo/src/main/webapp/examples/select.xhtml 2011-03-09
15:37:32 UTC (rev 22114)
+++ branches/4.0.X/examples/input-demo/src/main/webapp/examples/select.xhtml 2011-03-09
16:50:00 UTC (rev 22115)
@@ -1,4 +1,5 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!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"
@@ -9,6 +10,11 @@
<h:head>
<title>Select</title>
+ <style type="text/css">
+ .my-select-class {
+ font-weight: bold;
+ }
+ </style>
</h:head>
@@ -18,7 +24,8 @@
<fieldset>
<legend>Select Test App</legend>
<in:select id="select" openOnEdit="true"
enableManualInput="true" defaultLabel="Select Value ..."
- value="#{inputBean.value}">
+ value="#{inputBean.value}" style="font-size:
2em;" styleClass="my-select-class"
+ title="Title">
<f:selectItem itemLabel="Label#1"
itemValue="Value#1"/>
<f:selectItem itemLabel="Label#2"
itemValue="Value#2"/>
<f:selectItem itemLabel="Label#3"
itemValue="Value#3"/>
@@ -41,18 +48,16 @@
</h:commandButton>
</div>
- <ul>
- <li>
- <h:commandButton value="ShowPopup"
-
onclick="#{misc:component('select')}.showPopup(); return false;"/>
- </li>
- <li>
- <h:commandButton value="HidePopup"
-
onclick="#{misc:component('select')}.hidePopup(); return false;"/>
- </li>
-
-
- </ul>
+ <ul>
+ <li>
+ <h:commandButton value="ShowPopup"
+
onclick="#{misc:component('select')}.showPopup(); return false;"/>
+ </li>
+ <li>
+ <h:commandButton value="HidePopup"
+
onclick="#{misc:component('select')}.hidePopup(); return false;"/>
+ </li>
+ </ul>
<h:panelGroup id="out">
<h:outputText value="Selected Value: #{inputBean.value}"/>
</h:panelGroup>
Modified:
branches/4.0.X/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelect.java
===================================================================
---
branches/4.0.X/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelect.java 2011-03-09
15:37:32 UTC (rev 22114)
+++
branches/4.0.X/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelect.java 2011-03-09
16:50:00 UTC (rev 22115)
@@ -53,4 +53,12 @@
@Attribute(hidden = true)
public abstract String getDisabledStateClass();
+ @Attribute
+ public abstract String getStyle();
+
+ @Attribute
+ public abstract String getStyleClass();
+
+ @Attribute
+ public abstract String getTitle();
}
Modified:
branches/4.0.X/ui/input/ui/src/main/java/org/richfaces/renderkit/SelectRendererBase.java
===================================================================
---
branches/4.0.X/ui/input/ui/src/main/java/org/richfaces/renderkit/SelectRendererBase.java 2011-03-09
15:37:32 UTC (rev 22114)
+++
branches/4.0.X/ui/input/ui/src/main/java/org/richfaces/renderkit/SelectRendererBase.java 2011-03-09
16:50:00 UTC (rev 22115)
@@ -22,18 +22,17 @@
package org.richfaces.renderkit;
-import java.io.IOException;
-import java.util.List;
+import org.richfaces.component.AbstractSelect;
+import org.richfaces.component.AbstractSelectComponent;
+import org.richfaces.renderkit.util.HtmlDimensions;
import javax.faces.application.ResourceDependencies;
import javax.faces.application.ResourceDependency;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
+import java.io.IOException;
+import java.util.List;
-import org.richfaces.component.AbstractSelect;
-import org.richfaces.component.AbstractSelectComponent;
-import org.richfaces.renderkit.util.HtmlDimensions;
-
/**
* @author abelevich
*
@@ -64,13 +63,7 @@
public String getSelectInputLabel(FacesContext facesContext, UIComponent component)
{
return SelectHelper.getSelectInputLabel(facesContext, component);
}
-
- public String getListWidth(UIComponent component) {
- AbstractSelect select = (AbstractSelect)component;
- String width = getListWidth(select);
- return (width != null && width.trim().length() != 0) ? ("width:
" + width) : "";
- }
-
+
protected String getMinListHeight(AbstractSelect select) {
String height = HtmlDimensions.formatSize(select.getMinListHeight());
if (height == null || height.length() == 0) {
Modified: branches/4.0.X/ui/input/ui/src/main/templates/select.template.xml
===================================================================
--- branches/4.0.X/ui/input/ui/src/main/templates/select.template.xml 2011-03-09 15:37:32
UTC (rev 22114)
+++ branches/4.0.X/ui/input/ui/src/main/templates/select.template.xml 2011-03-09 16:50:00
UTC (rev 22115)
@@ -19,7 +19,7 @@
<cdk:object type="java.lang.Object" name="disabled"
value="#{component.attributes['disabled']}" />
- <div id="#{clientId}" class="rf-sel">
+ <div id="#{clientId}" class="#{concatClasses('rf-sel',
component.attributes['styleClass'])}"
style="#{component.attributes['style']}">
<span class="rf-sel-cntr">
<input id="#{clientId}selValue" name="#{clientId}"
type="hidden" value="#{getInputValue(facesContext, component)}"/>
<cdk:object type="java.lang.String" name="label"
value="#{getSelectLabel(facesContext, component)}" />