JBoss Rich Faces SVN: r5916 - in trunk/ui/pickList/src/main: java/org/richfaces/component and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-02-07 10:16:33 -0500 (Thu, 07 Feb 2008)
New Revision: 5916
Modified:
trunk/ui/pickList/src/main/config/component/picklist.xml
trunk/ui/pickList/src/main/java/org/richfaces/component/UIPickList.java
trunk/ui/pickList/src/main/templates/htmlPickList.jspx
Log:
add rendering of the contolClass, hide unnecessary attributes (RF-2185)
Modified: trunk/ui/pickList/src/main/config/component/picklist.xml
===================================================================
--- trunk/ui/pickList/src/main/config/component/picklist.xml 2008-02-07 15:14:10 UTC (rev 5915)
+++ trunk/ui/pickList/src/main/config/component/picklist.xml 2008-02-07 15:16:33 UTC (rev 5916)
@@ -76,15 +76,8 @@
<classname>java.lang.String</classname>
<defaultvalue>""</defaultvalue>
</property>
-
+
<property>
- <name>listClass</name>
- <classname>java.lang.String</classname>
- <description>CSS class for a list</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
-
- <property>
<name>switchByClick</name>
<classname>boolean</classname>
<description>If "true", dragging between lists realized by click </description>
@@ -123,25 +116,34 @@
&html_control_events;
<property>
- <name>enabledStyleClass</name>
- <classname>java.lang.String</classname>
- </property>
-
- <property>
- <name>enabledStyle</name>
- <classname>java.lang.String</classname>
- </property>
-
- <property>
- <name>disabledStyleClass</name>
- <classname>java.lang.String</classname>
- </property>
-
- <property>
- <name>disabledStyle</name>
- <classname>java.lang.String</classname>
- </property>
-
+ <name>listClass</name>
+ <classname>java.lang.String</classname>
+ <description>CSS class for a list</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+
+ <property>
+ <name>controlClass</name>
+ <classname>java.lang.String</classname>
+ <description>CSS class for a list</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+
+ <property hidden="true">
+ <name>valid </name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property hidden="true">
+ <name>lang</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property hidden="true">
+ <name>localValueSet </name>
+ <classname>java.lang.String</classname>
+ </property>
+
</properties>
</component>
Modified: trunk/ui/pickList/src/main/java/org/richfaces/component/UIPickList.java
===================================================================
--- trunk/ui/pickList/src/main/java/org/richfaces/component/UIPickList.java 2008-02-07 15:14:10 UTC (rev 5915)
+++ trunk/ui/pickList/src/main/java/org/richfaces/component/UIPickList.java 2008-02-07 15:16:33 UTC (rev 5916)
@@ -7,6 +7,7 @@
public abstract class UIPickList extends UISelectMany{
private String listClass;
+ private String controlClass;
private String moveControlsVerticalAlign;
public abstract String getMoveControlsVerticalAlign();
@@ -50,8 +51,11 @@
}
private String _baseClientId = null;
+
+ public abstract String getControlClass();
+ public abstract void setControlClass(String controlClass);
+
public abstract String getListClass();
+ public abstract void setListClass(String listClass);
- public abstract void setListClass(String listClass);
-
}
Modified: trunk/ui/pickList/src/main/templates/htmlPickList.jspx
===================================================================
--- trunk/ui/pickList/src/main/templates/htmlPickList.jspx 2008-02-07 15:14:10 UTC (rev 5915)
+++ trunk/ui/pickList/src/main/templates/htmlPickList.jspx 2008-02-07 15:16:33 UTC (rev 5916)
@@ -97,7 +97,7 @@
</div>
</td>
<td style="vertical-align: #{component.moveControlsVerticalAlign};" >
- <div class="rich-picklist-controls">
+ <div class="rich-picklist-controls #{component.controlClass}" >
<jsp:scriptlet><![CDATA[
encodePickListControlsFacets(context, component);
]]></jsp:scriptlet>
18 years, 2 months
JBoss Rich Faces SVN: r5915 - in trunk/samples/pickList-sample/src/main: webapp/pages and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-02-07 10:14:10 -0500 (Thu, 07 Feb 2008)
New Revision: 5915
Modified:
trunk/samples/pickList-sample/src/main/java/org/richfaces/Bean.java
trunk/samples/pickList-sample/src/main/webapp/pages/index.jsp
Log:
Modified: trunk/samples/pickList-sample/src/main/java/org/richfaces/Bean.java
===================================================================
--- trunk/samples/pickList-sample/src/main/java/org/richfaces/Bean.java 2008-02-07 14:59:47 UTC (rev 5914)
+++ trunk/samples/pickList-sample/src/main/java/org/richfaces/Bean.java 2008-02-07 15:14:10 UTC (rev 5915)
@@ -14,6 +14,11 @@
private String targetListWidth="140px";
private String sourceListWidth="140px";
private String listsHeight="100px";
+ private String copyAllLabel;
+ private String copyLabel;
+ private String removeLabel;
+ private String removeAllLabel;
+
private String [] values = new String[]{"polecat","suricate"};
private List listValues = new ArrayList();
@@ -88,4 +93,48 @@
this.values = values;
}
+ public String getCopyAllLabel() {
+ return copyAllLabel;
+ }
+
+ public void setCopyAllLabel(String copyAllLabel) {
+ this.copyAllLabel = copyAllLabel;
+ }
+
+ public String getCopyLabel() {
+ return copyLabel;
+ }
+
+ public void setCopyLabel(String copyLabel) {
+ this.copyLabel = copyLabel;
+ }
+
+ public String getRemoveLabel() {
+ return removeLabel;
+ }
+
+ public void setRemoveLabel(String removeLabel) {
+ this.removeLabel = removeLabel;
+ }
+
+ public String getRemoveAllLabel() {
+ return removeAllLabel;
+ }
+
+ public void setRemoveAllLabel(String removeAllLabel) {
+ this.removeAllLabel = removeAllLabel;
+ }
+
+ public List getListValues() {
+ return listValues;
+ }
+
+ public void setListValues(List listValues) {
+ this.listValues = listValues;
+ }
+
+ public void setSelectedInfo(String selectedInfo) {
+ this.selectedInfo = selectedInfo;
+ }
+
}
\ No newline at end of file
Modified: trunk/samples/pickList-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/samples/pickList-sample/src/main/webapp/pages/index.jsp 2008-02-07 14:59:47 UTC (rev 5914)
+++ trunk/samples/pickList-sample/src/main/webapp/pages/index.jsp 2008-02-07 15:14:10 UTC (rev 5915)
@@ -25,6 +25,20 @@
<h:outputText value="set list heights: "></h:outputText>
<h:inputText value="#{pickBean.listsHeight}"></h:inputText>
+
+ <h:outputText value="set 'CopyAll' control label: "></h:outputText>
+ <h:inputText value="#{pickBean.copyAllLabel}"></h:inputText>
+
+ <h:outputText value="set 'Copy' control label: "></h:outputText>
+ <h:inputText value="#{pickBean.copyLabel}"></h:inputText>
+
+ <h:outputText value="set 'Remove' control label: "></h:outputText>
+ <h:inputText value="#{pickBean.removeLabel}"></h:inputText>
+
+ <h:outputText value="set 'RemoveAll' control label: "></h:outputText>
+ <h:inputText value="#{pickBean.removeAllLabel}"></h:inputText>
+
+
</h:panelGrid>
<br/>
@@ -38,8 +52,11 @@
listsHeight="#{pickBean.listsHeight}"
sourceListWidth="#{pickBean.sourceListWidth}"
targetListWidth="#{pickBean.targetListWidth}"
- value="#{pickBean.values}"
- >
+ copyAllControlLabel = "#{pickBean.copyAllLabel}"
+ copyControlLabel = "#{pickBean.copyLabel}"
+ removeControlLabel = "#{pickBean.removeLabel}"
+ removeAllControlLabel ="#{pickBean.removeLabel}"
+ value="#{pickBean.listValues}">
<f:selectItem itemValue="cat" itemLabel="cat"/>
<f:selectItem itemValue="dog" itemLabel="dog"/>
<f:selectItems value="#{pickBean.testList}"/>
18 years, 2 months
JBoss Rich Faces SVN: r5914 - trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-02-07 09:59:47 -0500 (Thu, 07 Feb 2008)
New Revision: 5914
Modified:
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
Log:
resize of list
Modified: trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
===================================================================
--- trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2008-02-07 14:48:14 UTC (rev 5913)
+++ trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2008-02-07 14:59:47 UTC (rev 5914)
@@ -426,10 +426,9 @@
this.fieldDimensions = Richfaces.ComboBoxList.getElemXY(this.fieldElem);
this.fieldDimensions.height = this.fieldElem.parentNode.offsetHeight;
+ this.setSize();
this.setPosition(this.fieldDimensions.top, this.fieldDimensions.left, this.fieldDimensions.height);
- this.setSize();
-
if (this.selectedItem) {
//was created new item list, so necessary to recreate selectedItem
this.doSelectItem(this.findItemBySubstr(this.selectedItem.innerHTML));
@@ -485,8 +484,10 @@
this.listParent.show();
var itemHeight = item.offsetHeight;
+
this.listParent.hide();
this.listParent.style.visibility = "visible";
+
rowsAmount = this.getItems().length;
currentItemsHeight = itemHeight * rowsAmount;
}
@@ -504,6 +505,7 @@
if (Prototype.Browser.IE) {
height = parseInt(height) + this.LAYOUT_BORDER_V + this.LAYOUT_PADDING_V;
}
+ height = parseInt(height) + "px";
this.list.style.height = height;
if (this.iframe) {
this.iframe.style.height = height;
18 years, 2 months
JBoss Rich Faces SVN: r5913 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: smukhina
Date: 2008-02-07 09:48:14 -0500 (Thu, 07 Feb 2008)
New Revision: 5913
Modified:
trunk/docs/userguide/en/src/main/docbook/included/actionparam.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/ajaxListener.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/draggable.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/dropZone.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/keepAlive.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/listener.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/loadBundle.desc.xml
Log:
http://jira.jboss.com/jira/browse/RF-2169 -desc section is created
Modified: trunk/docs/userguide/en/src/main/docbook/included/actionparam.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/actionparam.desc.xml 2008-02-07 14:41:35 UTC (rev 5912)
+++ trunk/docs/userguide/en/src/main/docbook/included/actionparam.desc.xml 2008-02-07 14:48:14 UTC (rev 5913)
@@ -1,5 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<section>
+ <title>Description</title>
<para>The <emphasis role="bold">
<property><a4j:actionParam></property>
</emphasis> component combines the functionality of both JSF components: <emphasis role="bold">
Modified: trunk/docs/userguide/en/src/main/docbook/included/ajaxListener.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/ajaxListener.desc.xml 2008-02-07 14:41:35 UTC (rev 5912)
+++ trunk/docs/userguide/en/src/main/docbook/included/ajaxListener.desc.xml 2008-02-07 14:48:14 UTC (rev 5913)
@@ -1,5 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<section>
+ <title>Description</title>
<para>The <emphasis role="bold"><property><a4j:ajaxListener></property></emphasis>
component is the same one as <emphasis role="bold"><property><f:actionListener></property></emphasis>
or <emphasis role="bold"><property><f:valueChangeListener></property></emphasis>, but for an Ajax container.</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/draggable.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/draggable.desc.xml 2008-02-07 14:41:35 UTC (rev 5912)
+++ trunk/docs/userguide/en/src/main/docbook/included/draggable.desc.xml 2008-02-07 14:48:14 UTC (rev 5913)
@@ -6,6 +6,7 @@
</keywordset>
</sectioninfo>
<section>
+ <title>Description</title>
<para>A <property>draggable</property> zone of page, where it's possible to press a mouse
button on the content and drag it to any drop zone. It encodes all necessary JavaScript
code for supporting drag operations.</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/dropZone.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/dropZone.desc.xml 2008-02-07 14:41:35 UTC (rev 5912)
+++ trunk/docs/userguide/en/src/main/docbook/included/dropZone.desc.xml 2008-02-07 14:48:14 UTC (rev 5913)
@@ -6,6 +6,7 @@
</keywordset>
</sectioninfo>
<section>
+ <title>Description</title>
<para>The "target zone" for a drag operation. When a draggable element is moved and
dropped onto the area of this component, <property>dropZone</property> performs an Ajax request
processing this event.</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/keepAlive.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/keepAlive.desc.xml 2008-02-07 14:41:35 UTC (rev 5912)
+++ trunk/docs/userguide/en/src/main/docbook/included/keepAlive.desc.xml 2008-02-07 14:48:14 UTC (rev 5913)
@@ -1,5 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<section>
+ <title>Description</title>
<para>The <emphasis role="bold">
<property><a4j:keepAlive></property>
</emphasis> component allows to keep a state of each bean between requests.</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/listener.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/listener.desc.xml 2008-02-07 14:41:35 UTC (rev 5912)
+++ trunk/docs/userguide/en/src/main/docbook/included/listener.desc.xml 2008-02-07 14:48:14 UTC (rev 5913)
@@ -1,5 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<section>
+ <title>Description</title>
<para> The <emphasis role="bold">
<property><a4j:ajaxListener></property>
</emphasis> component is the same one as <emphasis role="bold">
Modified: trunk/docs/userguide/en/src/main/docbook/included/loadBundle.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/loadBundle.desc.xml 2008-02-07 14:41:35 UTC (rev 5912)
+++ trunk/docs/userguide/en/src/main/docbook/included/loadBundle.desc.xml 2008-02-07 14:48:14 UTC (rev 5913)
@@ -1,5 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<section>
+ <title>Description</title>
<para>The <emphasis role="bold">
<property><a4j:loadBundle></property>
</emphasis> component is similar to the same component from the JSF Core library. The component loads a resource bundle
18 years, 2 months
JBoss Rich Faces SVN: r5912 - trunk/sandbox/samples/progressBarDemo/src/main/webapp/pages.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-02-07 09:41:35 -0500 (Thu, 07 Feb 2008)
New Revision: 5912
Modified:
trunk/sandbox/samples/progressBarDemo/src/main/webapp/pages/index.jsp
Log:
Modified: trunk/sandbox/samples/progressBarDemo/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/sandbox/samples/progressBarDemo/src/main/webapp/pages/index.jsp 2008-02-07 14:41:27 UTC (rev 5911)
+++ trunk/sandbox/samples/progressBarDemo/src/main/webapp/pages/index.jsp 2008-02-07 14:41:35 UTC (rev 5912)
@@ -33,7 +33,7 @@
<h:outputText value="Progress value: " />
<h:inputText value="#{bean.value}" />
- <h:commandButton action="#{bean.action}" value="Set" />
+ <h:commandButton value="Set" />
</h:panelGrid>
</h:form>
@@ -48,7 +48,7 @@
progressVar="percent"
parameters="text:'crack'"
style="width: 300px; height: 15px;"
- >
+ action="#{bean.action}">
<f:facet name="initial">
<h:outputText value="Process not started"></h:outputText>
</f:facet>
18 years, 2 months
JBoss Rich Faces SVN: r5911 - in trunk/sandbox/ui/progressBAR/src/main: java/org/richfaces/component and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-02-07 09:41:27 -0500 (Thu, 07 Feb 2008)
New Revision: 5911
Modified:
trunk/sandbox/ui/progressBAR/src/main/config/component/progressBar.xml
trunk/sandbox/ui/progressBAR/src/main/java/org/richfaces/component/UIProgressBar.java
trunk/sandbox/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java
trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/css/progressBar.xcss
trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js
trunk/sandbox/ui/progressBAR/src/main/templates/org/richfaces/progressBar.jspx
Log:
refactroring of client mode, fix some problems
Modified: trunk/sandbox/ui/progressBAR/src/main/config/component/progressBar.xml
===================================================================
--- trunk/sandbox/ui/progressBAR/src/main/config/component/progressBar.xml 2008-02-07 13:55:03 UTC (rev 5910)
+++ trunk/sandbox/ui/progressBAR/src/main/config/component/progressBar.xml 2008-02-07 14:41:27 UTC (rev 5911)
@@ -26,6 +26,7 @@
<classname>org.ajax4jsf.webapp.taglib.AjaxComponentHandler</classname>
</taghandler>
&ui_component_attributes;
+ &ui_command_attributes;
&html_universal_attributes;
&html_events;
<property>
@@ -40,6 +41,12 @@
<description>Parameters for macrosubstitution in label</description>
</property>
<property>
+ <name>dualColoredLabel</name>
+ <classname>java.lang.Boolean</classname>
+ <description>Defines if component renderes as simple markup</description>
+ <defaultvalue>false</defaultvalue>
+ </property>
+ <property>
<name>minValue</name>
<classname>java.lang.Object</classname>
<description>Min value when initial state should be rendered</description>
Modified: trunk/sandbox/ui/progressBAR/src/main/java/org/richfaces/component/UIProgressBar.java
===================================================================
--- trunk/sandbox/ui/progressBAR/src/main/java/org/richfaces/component/UIProgressBar.java 2008-02-07 13:55:03 UTC (rev 5910)
+++ trunk/sandbox/ui/progressBAR/src/main/java/org/richfaces/component/UIProgressBar.java 2008-02-07 14:41:27 UTC (rev 5911)
@@ -41,13 +41,14 @@
/** Request parameter name containing component state to render */
public static final String FORCE_PERCENT_PARAM = "forcePercent";
+
+ private static final String PERCENT_PARAM = "percent";
/* (non-Javadoc)
* @see org.ajax4jsf.component.AjaxActionComponent#broadcast(javax.faces.event.FacesEvent)
*/
public void broadcast(FacesEvent event) throws AbortProcessingException {
- // TODO Auto-generated method stub
if (event instanceof AjaxEvent) {
FacesContext facesContext = FacesContext.getCurrentInstance();
AjaxContext ajaxContext = AjaxContextImpl
@@ -55,18 +56,10 @@
HttpServletRequest request = (HttpServletRequest) facesContext
.getExternalContext().getRequest();
-
+ Map params = request.getParameterMap();
+ if (!params.containsKey(FORCE_PERCENT_PARAM)
+ && params.containsKey(PERCENT_PARAM)) {
Number percent = getNumber(this.getAttributes().get("value"));
- Number maxValue = getNumber(this.getAttributes().get("maxValue"));
- Map params = request.getParameterMap();
- if (params.containsKey(FORCE_PERCENT_PARAM)) {
- ajaxContext.addComponentToAjaxRender(this);
- String[] str = (String[]) params.get(FORCE_PERCENT_PARAM);
- for (String s : str) {
- this.getAttributes().put(FORCE_PERCENT_PARAM, s);
- }
- } else if (percent.doubleValue() < maxValue.doubleValue()
- && params.containsKey("percent")) {
ajaxContext.removeRenderedArea(this.getClientId(facesContext));
ajaxContext.setResponseData(getResponseData(percent,
facesContext));
@@ -113,10 +106,11 @@
boolean enabled = (Boolean) this.getAttributes().get("enabled");
map.put("enabled", Boolean.toString(enabled));
- map.put("markup", getMarkup(facesContext, renderer));
+ if (!isSimple()) {
+ map.put("markup", getMarkup(facesContext, renderer));
+ map.put("context", getContext(renderer, percent));
+ }
- map.put("context", getContext(renderer, percent));
-
addStyles2Responce(map, "completeClass", this.getAttributes().get(
"completeClass"));
addStyles2Responce(map, "remainClass", this.getAttributes().get(
@@ -149,6 +143,14 @@
buffer.append("}");
return new JSLiteral(buffer.toString());
}
+
+ /**
+ * Return true if markup is simple
+ * @return
+ */
+ private boolean isSimple() {
+ return this.getChildCount() == 0;
+ }
/**
* Returns label markup
Modified: trunk/sandbox/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java
===================================================================
--- trunk/sandbox/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java 2008-02-07 13:55:03 UTC (rev 5910)
+++ trunk/sandbox/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java 2008-02-07 14:41:27 UTC (rev 5911)
@@ -18,6 +18,7 @@
import javax.faces.context.ResponseWriter;
import javax.faces.render.RenderKit;
import javax.faces.render.RenderKitFactory;
+import javax.servlet.http.HttpServletRequest;
import org.ajax4jsf.context.AjaxContext;
import org.ajax4jsf.event.AjaxEvent;
@@ -64,12 +65,12 @@
*/
public void renderForcedState(String state, FacesContext context,
UIComponent component) throws IOException {
- if ("initial".equals(state)) {
- encodeInitialState(context, component);
- } else if ("progress".equals(state)) {
- encodeProgressState(context, component);
- } else if ("complete".equals(state)) {
- encodeCompletedState(context, component);
+ if ("initialState".equals(state)) {
+ encodeInitialState(context, component, true);
+ } else if ("progressState".equals(state)) {
+ encodeProgressState(context, component, true);
+ } else if ("completeState".equals(state)) {
+ encodeCompletedState(context, component, true);
}
component.getAttributes().remove(UIProgressBar.FORCE_PERCENT_PARAM);
}
@@ -80,31 +81,13 @@
* @param component
* @return
*/
- public String getForcedState(UIComponent component) {
+ public String getForcedState(FacesContext context, UIComponent component) {
String forcedState = null;
- if (component.getAttributes().containsKey(UIProgressBar.FORCE_PERCENT_PARAM)) {
- ComponentVariables variables = ComponentsVariableResolver
- .getVariables(this, component);
- Number maxValue = getNumber(component.getAttributes().get(
- "maxValue"));
- Number minValue = getNumber(component.getAttributes().get(
- "minValue"));
- String percent = (String) component.getAttributes().get(
- UIProgressBar.FORCE_PERCENT_PARAM);
- Number p = null;
- try {
- p = getNumber(percent);
- if (p.doubleValue() < minValue.doubleValue()) {
- forcedState = "initial";
- } else if (p.doubleValue() > maxValue.doubleValue()) {
- forcedState = "complete";
- } else {
- forcedState = "progress";
- }
- variables.setVariable("percent", p);
- } catch (Exception e) {
- e.getMessage();
- }
+ HttpServletRequest request = (HttpServletRequest)context.getExternalContext().getRequest();
+ Map params = request.getParameterMap();
+ if (params.containsKey(UIProgressBar.FORCE_PERCENT_PARAM)) {
+ String[] str = (String[]) params.get(UIProgressBar.FORCE_PERCENT_PARAM);
+ forcedState = str[0];
}
return forcedState;
}
@@ -164,10 +147,6 @@
ResponseWriter writer = context.getResponseWriter();
UIProgressBar progressBar = (UIProgressBar) component;
String clientId = component.getClientId(context);
- writer.startElement(HTML.SPAN_ELEM, component);
- writer.writeAttribute(HTML.style_ATTRIBUTE, "display:none;", null);
- writer.startElement(HTML.SCRIPT_ELEM, component);
- writer.writeAttribute(HTML.TYPE_ATTR, "text/javascript", null);
StringBuffer pollScript = new StringBuffer("\n");
StringBuffer script = new StringBuffer("\n");
if (isAjaxMode(component) && progressBar.isEnabled()) {
@@ -184,9 +163,24 @@
}
pollScript.append(";\n");
writer.writeText(pollScript.toString(), null);
- writer.endElement(HTML.SCRIPT_ELEM);
- writer.endElement(HTML.SPAN_ELEM);
}
+
+
+ /**
+ * Encodes script for state rendering in client mode
+ * @param context
+ * @param component
+ * @param state
+ * @throws IOException
+ */
+ public void encodeRenderStateScript (FacesContext context, UIComponent component, String state) throws IOException {
+ ResponseWriter writer = context.getResponseWriter();
+ StringBuffer script = new StringBuffer("\n");
+ script.append(
+ "$('" + component.getClientId(context)
+ + "').component.renderState('").append(state).append("');");
+ writer.write(script.toString());
+ }
/**
* Encodes script for label rendering in client
@@ -198,16 +192,12 @@
public void encodeLabelScript(FacesContext context, UIComponent component)
throws IOException {
ResponseWriter writer = context.getResponseWriter();
- StringBuffer script = new StringBuffer();
- writer.startElement(HTML.SPAN_ELEM, component);
- writer.startElement(HTML.SCRIPT_ELEM, component);
+ StringBuffer script = new StringBuffer("\n");
script.append(
"$('" + component.getClientId(context)
+ "').component.renderLabel(").append(
getMarkup(context, component)).append(",null);\n");
writer.append(script.toString());
- writer.endElement(HTML.SCRIPT_ELEM);
- writer.endElement(HTML.SPAN_ELEM);
}
@@ -223,10 +213,6 @@
ResponseWriter writer = context.getResponseWriter();
UIProgressBar progressBar = (UIProgressBar) component;
ComponentVariables variables = ComponentsVariableResolver.getVariables(this, component);
- writer.startElement(HTML.SPAN_ELEM, component);
- writer.writeAttribute(HTML.style_ATTRIBUTE, "display: none;", null);
- writer.startElement(HTML.SCRIPT_ELEM, component);
-
StringBuffer script = new StringBuffer();
String clientId = component.getClientId(context);
String containerId = ((UIComponent) AjaxRendererUtils
@@ -266,9 +252,6 @@
script.append(value.toString());
script.append(");\n");
writer.write(script.toString());
-
- writer.endElement(HTML.SCRIPT_ELEM);
- writer.endElement(HTML.SPAN_ELEM);
}
/**
@@ -302,6 +285,32 @@
String mode = (String) component.getAttributes().get("mode");
return "ajax".equalsIgnoreCase(mode);
}
+
+ /**
+ * Encodes client mode
+ * @param context
+ * @param component
+ * @param value
+ * @param min
+ * @param max
+ * @throws IOException
+ */
+ public void encodeClientMode (FacesContext context, UIComponent component, Number value, Number min, Number max) throws IOException {
+ ResponseWriter writer = context.getResponseWriter();
+ String clientId = component.getClientId(context);
+ String state = (value.doubleValue() <= min.doubleValue()) ? "initialState" : ((value.doubleValue() >= max.doubleValue()) ? "completeState" : "progressState");
+ writer.startElement(HTML.DIV_ELEM, component);
+ writer.writeAttribute(HTML.id_ATTRIBUTE, clientId , null);
+ encodeInitialState(context, component, false);
+ encodeProgressState(context, component, false);
+ encodeCompletedState(context, component, false);
+ startScript(writer, component);
+ encodeInitialScript(context, component, state);
+ encodeLabelScript(context, component);
+ encodeRenderStateScript(context, component, state);
+ endScript(writer, component);
+ writer.endElement(HTML.DIV_ELEM);
+ }
/**
* Methods encodes start facet of progress bar component
@@ -313,7 +322,7 @@
* @throws IOException -
* IOException
*/
- public void encodeInitialState(FacesContext context, UIComponent component)
+ public void encodeInitialState(FacesContext context, UIComponent component, boolean isAjaxMode)
throws IOException {
String clientId = component.getClientId(context);
String initialClass = (String) component.getAttributes().get(
@@ -322,15 +331,17 @@
ResponseWriter writer = context.getResponseWriter();
writer.startElement(HTML.DIV_ELEM, component);
getUtils().writeAttribute(writer, HTML.class_ATTRIBUTE, initialClass);
- getUtils().writeAttribute(writer, "style", style);
- writer.writeAttribute(HTML.id_ATTRIBUTE, clientId, null);
+ getUtils().writeAttribute(writer, "style", style + (!isAjaxMode ? "display: none" : ""));
+ writer.writeAttribute(HTML.id_ATTRIBUTE, (isAjaxMode) ? clientId : clientId + ":initialState", null);
UIComponent initial = component.getFacet("initial");
if (initial != null) {
renderChild(context, initial);
}
- encodeInitialScript(context, component,"initial");
- if (isAjaxMode(component)) {
+ if (isAjaxMode) {
+ startScript(writer, component);
+ encodeInitialScript(context, component,"initialState");
encodePollScript(context, component);
+ endScript(writer, component);
}
writer.endElement(HTML.DIV_ELEM);
@@ -343,25 +354,32 @@
* @param component
* @throws IOException
*/
- public void encodeProgressState(FacesContext context, UIComponent component)
+ public void encodeProgressState(FacesContext context, UIComponent component, boolean isAjaxMode)
throws IOException {
ResponseWriter writer = context.getResponseWriter();
ComponentVariables variables = ComponentsVariableResolver.getVariables(
this, component);
String clientId = component.getClientId(context);
String styleClass = (String) variables.getVariable("styleClass");
+ boolean isSimple = isSimpleMarkup(component);
+ String shellClass = (!isSimple) ? "rich-progress-bar-shell-dig " : "rich-progress-bar-shell ";
writer.startElement("div", component);
getUtils().writeAttribute(
writer,
"class",
- "rich-progress-bar-block rich-progress-bar-width rich-progress-bar-shell"
+ "rich-progress-bar-block rich-progress-bar-width " + shellClass
+ (styleClass != null ? styleClass : ""));
- getUtils().writeAttribute(writer, "id", clientId);
+ getUtils().writeAttribute(writer, HTML.id_ATTRIBUTE, (isAjaxMode) ? clientId : clientId + ":progressState");
getUtils().writeAttribute(writer, "style",
- variables.getVariable("style"));
- encodeInitialScript(context, component,"progress");
- encodeProgressBar(context, component);
- encodeLabelScript(context, component);
+ variables.getVariable("style") + (!isAjaxMode ? "display: none" : ""));
+ encodeProgressBar(context, component, isSimple);
+ if (isAjaxMode) {
+ startScript(writer, component);
+ encodeInitialScript(context, component,"progressState");
+ encodeLabelScript(context, component);
+ encodePollScript(context, component);
+ endScript(writer, component);
+ }
writer.endElement("div");
}
@@ -374,7 +392,7 @@
* component instance
* @throws IOException
*/
- public void encodeProgressBar(FacesContext context, UIComponent component)
+ public void encodeProgressBar(FacesContext context, UIComponent component, boolean isSimple)
throws IOException {
ResponseWriter writer = context.getResponseWriter();
String clientId = component.getClientId(context);
@@ -390,36 +408,42 @@
String remainClass = (String) component.getAttributes().get(
"remainClass");
-
- // <div class='remainClass' id='clientId:remain' style='style'></div>
- writer.startElement("div", component);
- getUtils().writeAttribute(writer, "class",
- "rich-progress-bar-width rich-progress-bar-remained rich-progress-bar-padding " + remainClass);
- getUtils().writeAttribute(writer, "id", clientId + ":remain");
- getUtils().writeAttribute(writer, "style", style);
- writer.endElement("div");
- // <div class='rich-progress-bar-uploaded' id='clientId:upload' style='style'>
- writer.startElement("div", component);
- getUtils()
- .writeAttribute(writer, "class", "rich-progress-bar-uploaded");
- getUtils().writeAttribute(writer, "id", clientId + ":upload");
- getUtils().writeAttribute(writer, "style",
- (style != null ? style + ";" : "") + " width: " + width + "%;");
-
- // <div class='completeClass' id='clientId:complete' style='style'></div>
- writer.startElement("div", component);
- getUtils().writeAttribute(writer, "class",
- "rich-progress-bar-height rich-progress-bar-width rich-progress-bar-completed rich-progress-bar-padding " + completeClass);
- getUtils().writeAttribute(writer, "id", clientId + ":complete");
- getUtils().writeAttribute(writer, "style", style);
- writer.endElement("div");
-
- // </div>
- writer.endElement("div");
-
- if (isAjaxMode(component)) {
- encodePollScript(context, component);
+ if (!isSimple) {
+ // <div class='remainClass' id='clientId:remain' style='style'></div>
+ writer.startElement("div", component);
+ getUtils().writeAttribute(writer, "class",
+ "rich-progress-bar-width rich-progress-bar-remained rich-progress-bar-padding " + remainClass);
+ getUtils().writeAttribute(writer, "id", clientId + ":remain");
+ getUtils().writeAttribute(writer, "style", style);
+ writer.endElement("div");
+
+ // <div class='rich-progress-bar-uploaded-dig' id='clientId:upload' style='style'>
+ writer.startElement("div", component);
+ getUtils()
+ .writeAttribute(writer, "class", "rich-progress-bar-uploaded-dig");
+ getUtils().writeAttribute(writer, "id", clientId + ":upload");
+ getUtils().writeAttribute(writer, "style",
+ (style != null ? style + ";" : "") + " width: " + width + "%;");
+
+ // <div class='completeClass' id='clientId:complete' style='style'></div>
+ writer.startElement("div", component);
+ getUtils().writeAttribute(writer, "class",
+ "rich-progress-bar-height rich-progress-bar-width rich-progress-bar-completed rich-progress-bar-padding " + completeClass);
+ getUtils().writeAttribute(writer, "id", clientId + ":complete");
+ getUtils().writeAttribute(writer, "style", style);
+ writer.endElement("div");
+
+ // </div>
+ writer.endElement("div");
+ } else {
+ writer.startElement("div", component);
+ getUtils().writeAttribute(writer, "class",
+ "rich-progress-bar-height rich-progress-bar-uploaded " + completeClass);
+ getUtils().writeAttribute(writer, "id", clientId + ":upload");
+ getUtils().writeAttribute(writer, "style",
+ (style != null ? style + ";" : "") + " width: " + width + "%;");
+ writer.endElement("div");
}
}
@@ -440,6 +464,30 @@
/**
+ * Writes start script element
+ * @param writer
+ * @param component
+ * @throws IOException
+ */
+ private void startScript(ResponseWriter writer, UIComponent component)throws IOException {
+ writer.startElement(HTML.SPAN_ELEM, component);
+ writer.writeAttribute(HTML.style_ATTRIBUTE, "display: none;", null);
+ writer.startElement(HTML.SCRIPT_ELEM, component);
+ }
+
+ /**
+ * Writes end script element
+ * @param writer
+ * @param component
+ * @throws IOException
+ */
+ private void endScript(ResponseWriter writer, UIComponent component)throws IOException {
+ writer.endElement(HTML.SCRIPT_ELEM);
+ writer.endElement(HTML.SPAN_ELEM);
+ }
+
+
+ /**
* Returns context for macrosubstitution
* @param component
* @return
@@ -456,6 +504,15 @@
}
return literal;
}
+
+ /**
+ * Returns true if markup should rendered as simple 2 divs
+ * @param component
+ * @return
+ */
+ private boolean isSimpleMarkup(UIComponent component) {
+ return (component.getChildCount() == 0);
+ }
/**
* Methods encodes finish facet of progress bar component
@@ -467,44 +524,41 @@
* @throws IOException -
* IOException
*/
- public void encodeCompletedState(FacesContext context, UIComponent component)
+ public void encodeCompletedState(FacesContext context, UIComponent component, boolean isAjaxMode)
throws IOException {
- boolean isAjax = isAjaxMode(component);
- Object rerenderAfterComplete = component.getAttributes().get(
- "reRenderAfterComplete");
- Set ajaxRegions = AjaxRendererUtils.asSet(rerenderAfterComplete);
+ if (isAjaxMode) {
+ Object rerenderAfterComplete = component.getAttributes().get(
+ "reRenderAfterComplete");
+ Set ajaxRegions = AjaxRendererUtils.asSet(rerenderAfterComplete);
- if (ajaxRegions != null) {
- for (Iterator iter = ajaxRegions.iterator(); iter.hasNext();) {
- String id = iter.next().toString();
- AjaxContext ajaxContext = AjaxContext
- .getCurrentInstance(context);
- ajaxContext.addComponentToAjaxRender(component, id);
+ if (ajaxRegions != null) {
+ for (Iterator iter = ajaxRegions.iterator(); iter.hasNext();) {
+ String id = iter.next().toString();
+ AjaxContext ajaxContext = AjaxContext
+ .getCurrentInstance(context);
+ ajaxContext.addComponentToAjaxRender(component, id);
+ }
}
}
-
String clientId = component.getClientId(context);
String finishClass = (String) component.getAttributes().get(
"finishClass");
String style = (String) component.getAttributes().get("style");
ResponseWriter writer = context.getResponseWriter();
writer.startElement(HTML.DIV_ELEM, component);
- writer.writeAttribute(HTML.id_ATTRIBUTE, clientId, null);
+ writer.writeAttribute(HTML.id_ATTRIBUTE, (isAjaxMode) ? clientId : clientId + ":completeState", null);
getUtils().writeAttribute(writer, HTML.class_ATTRIBUTE, finishClass);
- getUtils().writeAttribute(writer, "style", style);
+ getUtils().writeAttribute(writer, "style", style + (!isAjaxMode ? "display: none" : ""));
UIComponent completed = component.getFacet("complete");
if (completed != null) {
renderChild(context, completed);
}
- encodeInitialScript(context, component,"completed");
- if (isAjax) {
- writer.startElement(HTML.SPAN_ELEM, component);
- writer.writeAttribute(HTML.style_ATTRIBUTE, "display: none;", null);
- writer.startElement(HTML.SCRIPT_ELEM, component);
+ if (isAjaxMode) {
+ startScript(writer, component);
+ encodeInitialScript(context, component,"completeState");
writer.write(getStopPollScript(clientId).toString());
- writer.endElement(HTML.SCRIPT_ELEM);
- writer.endElement(HTML.SPAN_ELEM);
+ endScript(writer, component);
}
writer.endElement(HTML.DIV_ELEM);
Modified: trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/css/progressBar.xcss
===================================================================
--- trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/css/progressBar.xcss 2008-02-07 13:55:03 UTC (rev 5910)
+++ trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/css/progressBar.xcss 2008-02-07 14:41:27 UTC (rev 5911)
@@ -13,24 +13,39 @@
.rich-progress-bar-height{height : 13px;}
.rich-progress-bar-width{width : 200px}
.rich-progress-bar-block{white-space : nowrap;}
-.rich-progress-bar-uploaded{overflow : hidden; position : absolute; top : 0px; left : 0px;}
-.rich-progress-bar-shell{position : relative; margin-bottom : 2px; border : 1px solid;}
+.rich-progress-bar-uploaded{background-repeat : repeat-x;}
+.rich-progress-bar-uploaded-dig{overflow : hidden; position : absolute; top : 0px; left : 0px;}
+.rich-progress-bar-shell{margin-bottom : 2px; border : 1px solid;}
+.rich-progress-bar-shell-dig{position : relative; margin-bottom : 2px; border : 1px solid;}
.rich-progress-bar-remained{text-align : center; font-weight : bold; position : relative;}
.rich-progress-bar-completed{text-align : center; font-weight : bold; background-repeat : repeat-x;}
.rich-progress-bar-padding{padding: 0px}
</f:verbatim>
- <u:selector name=".rich-progress-bar-shell">
+ <u:selector name=".rich-progress-bar-shell-dig">
+ <u:style name="background-color" skin="controlBackgroundColor" />
<u:style name="border-color" skin="panelBorderColor" />
</u:selector>
+ <u:selector name=".rich-progress-bar-shell-dig">
+ <u:style name="border-color" skin="panelBorderColor" />
+ </u:selector>
+
<u:selector name=".rich-progress-bar-remained">
<u:style name="background-color" skin="controlBackgroundColor" />
<u:style name="text-color" skin="controlTextColor" />
</u:selector>
<u:selector name=".rich-progress-bar-uploaded">
+ <u:style name="background-image">
+ <f:resource f:key="org.richfaces.renderkit.html.images.ProgressBarAnimatedBg" />
+ </u:style>
+ <u:style name="background-color" skin="selectControlColor" />
+ <u:style name="border-color" skin="panelBorderColor" />
+ </u:selector>
+
+ <u:selector name=".rich-progress-bar-uploaded-dig">
<u:style name="border-color" skin="panelBorderColor" />
</u:selector>
Modified: trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js
===================================================================
--- trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js 2008-02-07 13:55:03 UTC (rev 5910)
+++ trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js 2008-02-07 14:41:27 UTC (rev 5911)
@@ -31,14 +31,19 @@
if (!$(this.id)) { return; }
if (data) {
this.value = data['percent'];
- if (this.state == "progress") {
+ if (this.state == "progressState") {
this.updateComponent(data);
this.renderLabel(data['markup'], data['context']);
- } else if (this.state == "initial" && this.value >= this.getMinValue()) {
- this.state = "progress";
- this.forceState(this.value, function () { this.poll() }.bind(this));
+ if (this.value >= this.getMaxValue()) {
+ this.forceState("complete",null);
+ return;
+ }
+ } else if (this.state == "initialState" && this.value >= this.getMinValue()) {
+ this.state = "progressState";
+ this.forceState("progressState", function () { this.poll() }.bind(this));
+ return;
}
- this.poll();
+ this.poll();
}
},
@@ -99,7 +104,7 @@
return context;
},
renderLabel: function (markup, context) {
- if (!markup || this.state != "progress") {
+ if (!markup || this.state != "progressState") {
return;
}
if (!context) {
@@ -117,11 +122,13 @@
return placeholders;
},
setLabel: function (str) {
- if (this.state != "progress") { return; }
+ if (this.state != "progressState") { return; }
+ var d = $(this.id + ":remain");
+ if (!d) { return; }
var lbl = this.interpolate(str, this.getContext());
if (lbl)
- $(this.id + ":remain").innerHTML = $(this.id + ":complete").innerHTML = lbl;
- this.markup = null;
+ d.innerHTML = $(this.id + ":complete").innerHTML = lbl;
+ this.markup = null;
},
getMode: function () {
return this.mode;
@@ -143,17 +150,17 @@
if (val.indexOf("%") < 0)
val = val + "%";
}
- if ( parseFloat(p) < parseFloat(this.getMinValue())) {
- if (!this.isAjaxMode()) {
- this.forceState(p, null);
- return;
+
+ if (!this.isAjaxMode()) {
+ if ( parseFloat(p) <= parseFloat(this.getMinValue())) {
+ this.switchState("initialState");
+ }else if ( parseFloat(p) >= parseFloat(this.getMaxValue())) {
+ this.switchState("completeState");
+ }else {
+ this.switchState("progressState");
}
- } else if ( parseFloat(p) > parseFloat(this.getMaxValue())) {
- if (!this.isAjaxMode()) {
- this.forceState(p, null);
- return;
- }
}
+ if (!this.isAjaxMode() && this.state != "progressState") return;
if (this.markup) {
this.renderLabel(this.markup, this.getContext());
@@ -161,13 +168,14 @@
//this.setLabel("{value}%");
}
- d = $(this.id + ":upload");
+ var d = $(this.id + ":upload");
if (d != null) d.style.width = val;
},
enable: function (ev) {
if (!this.isAjaxMode()) {
- this.forceState("0", null);
+ this.switchState("progressState");
+ this.setValue(0);
}else {
this.disable();
this.poll();
@@ -179,11 +187,25 @@
finish: function () {
//this.switchMode("completed");
},
- forceState: function (percent, oncomplete) {
+ hideAll: function () {
+ Element.hide($(this.id + ":progressState"));
+ Element.hide($(this.id + ":completeState"));
+ Element.hide($(this.id + ":initialState"));
+ },
+ switchState: function (state) {
+ this.state = state;
+ this.hideAll();
+ Element.show($(this.id + ":" + state));
+ },
+ renderState: function (state) {
+ this.state = state;
+ Element.show($(this.id + ":" + state));
+ },
+ forceState: function (state, oncomplete) {
var options = {};
options['parameters'] = {};
options['parameters'][this.id] = this.id;
- options['parameters']['forcePercent'] = percent;
+ options['parameters']['forcePercent'] = state;
options['actionUrl'] = this.options.actionUrl;
if (oncomplete) {
options['oncomplete'] = oncomplete;
Modified: trunk/sandbox/ui/progressBAR/src/main/templates/org/richfaces/progressBar.jspx
===================================================================
--- trunk/sandbox/ui/progressBAR/src/main/templates/org/richfaces/progressBar.jspx 2008-02-07 13:55:03 UTC (rev 5910)
+++ trunk/sandbox/ui/progressBAR/src/main/templates/org/richfaces/progressBar.jspx 2008-02-07 14:41:27 UTC (rev 5911)
@@ -31,7 +31,7 @@
variables.setVariable("percent",value);
variables.setVariable("style",(String)component.getAttributes().get("style"));
variables.setVariable("styleClass",(String)component.getAttributes().get("styleClass"));
- String forcedState = getForcedState(component);
+ String forcedState = getForcedState(context,component);
]]>
</jsp:scriptlet>
@@ -40,12 +40,14 @@
<![CDATA[
if (forcedState != null) {
renderForcedState(forcedState,context,component);
-}else if (value.doubleValue() <= minValue.doubleValue()) {
- encodeInitialState(context, component);
+} if (!isAjax) {
+ encodeClientMode(context,component,value,minValue,maxValue);
+} else if (value.doubleValue() <= minValue.doubleValue()) {
+ encodeInitialState(context, component, true);
} else if (value.doubleValue() >= maxValue.doubleValue()) {
- encodeCompletedState(context, component);
+ encodeCompletedState(context, component, true);
} else {
- encodeProgressState(context, component);
+ encodeProgressState(context, component, true);
}
]]>
</jsp:scriptlet>
18 years, 2 months
JBoss Rich Faces SVN: r5910 - trunk/samples/pickList-sample.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-02-07 08:55:03 -0500 (Thu, 07 Feb 2008)
New Revision: 5910
Modified:
trunk/samples/pickList-sample/pom.xml
Log:
Modified: trunk/samples/pickList-sample/pom.xml
===================================================================
--- trunk/samples/pickList-sample/pom.xml 2008-02-07 13:55:01 UTC (rev 5909)
+++ trunk/samples/pickList-sample/pom.xml 2008-02-07 13:55:03 UTC (rev 5910)
@@ -45,19 +45,19 @@
<dependency>
<groupId>org.richfaces.samples</groupId>
<artifactId>skins</artifactId>
- <version>3.2.0-SNAPSHOT</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.richfaces.ui</groupId>
<artifactId>core</artifactId>
- <version>3.2.0-SNAPSHOT</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.richfaces.ui</groupId>
<artifactId>pickList</artifactId>
- <version>3.2.0-SNAPSHOT</version>
+ <version>${project.version}</version>
</dependency>
</dependencies>
18 years, 2 months
JBoss Rich Faces SVN: r5909 - in trunk/ui: dataTable/src/main/config/component and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: smukhina
Date: 2008-02-07 08:55:01 -0500 (Thu, 07 Feb 2008)
New Revision: 5909
Modified:
trunk/ui/core/src/main/config/component/repeat.xml
trunk/ui/dataTable/src/main/config/component/dataGrid.xml
trunk/ui/dataTable/src/main/config/component/dataList.xml
trunk/ui/dataTable/src/main/config/component/dataTable.xml
trunk/ui/dataTable/src/main/config/component/subTable.xml
trunk/ui/listShuttle/src/main/config/component/listShuttle.xml
trunk/ui/orderingList/src/main/config/component/orderinglist.xml
trunk/ui/scrollableDataTable/src/main/config/component/scrollable-data-table.xml
Log:
http://jira.jboss.com/jira/browse/RF-2168 ajaxKeys attribute description changed in attribute tables
Modified: trunk/ui/core/src/main/config/component/repeat.xml
===================================================================
--- trunk/ui/core/src/main/config/component/repeat.xml 2008-02-07 13:54:44 UTC (rev 5908)
+++ trunk/ui/core/src/main/config/component/repeat.xml 2008-02-07 13:55:01 UTC (rev 5909)
@@ -55,14 +55,14 @@
<description>The attribute provides access to a component state on the client side.</description>
</property>
<property>
- <name>value</name>
+ <name>value</name>
<classname>java.lang.Object</classname>
<description>The current value for this component.</description>
</property>
<property>
<name>ajaxKeys</name>
<classname>java.util.Set</classname>
- <description>This attribute defines strings that are updated after an AJAX request.</description>
+ <description>This attribute defines row keys that are updated after an AJAX request.</description>
</property>
<property el="false">
<name>rowKeyVar</name>
Modified: trunk/ui/dataTable/src/main/config/component/dataGrid.xml
===================================================================
--- trunk/ui/dataTable/src/main/config/component/dataGrid.xml 2008-02-07 13:54:44 UTC (rev 5908)
+++ trunk/ui/dataTable/src/main/config/component/dataGrid.xml 2008-02-07 13:55:01 UTC (rev 5909)
@@ -39,7 +39,7 @@
<property>
<name>ajaxKeys</name>
<classname>java.util.Set</classname>
- <description>This attribute defines rows that are updated after an AJAX request</description>
+ <description>This attribute defines row keys that are updated after an AJAX request</description>
</property>
<property>
<name>elements</name>
Modified: trunk/ui/dataTable/src/main/config/component/dataList.xml
===================================================================
--- trunk/ui/dataTable/src/main/config/component/dataList.xml 2008-02-07 13:54:44 UTC (rev 5908)
+++ trunk/ui/dataTable/src/main/config/component/dataList.xml 2008-02-07 13:55:01 UTC (rev 5909)
@@ -40,7 +40,7 @@
<property>
<name>ajaxKeys</name>
<classname>java.util.Set</classname>
- <description>This attribute defines rows that are updated after an AJAX request</description>
+ <description>This attribute defines row keys that are updated after an AJAX request</description>
</property>
<property>
<name>rowKey</name>
@@ -118,7 +118,7 @@
<property>
<name>ajaxKeys</name>
<classname>java.util.Set</classname>
- <description>This attribute defines rows that are updated after an AJAX request</description>
+ <description>This attribute defines row keys that are updated after an AJAX request</description>
</property>
<property>
<name>value</name>
@@ -192,7 +192,7 @@
<property>
<name>ajaxKeys</name>
<classname>java.util.Set</classname>
- <description>This attribute defines rows that are updated after an AJAX request</description>
+ <description>This attribute defines row keys that are updated after an AJAX request</description>
</property>
<property>
Modified: trunk/ui/dataTable/src/main/config/component/dataTable.xml
===================================================================
--- trunk/ui/dataTable/src/main/config/component/dataTable.xml 2008-02-07 13:54:44 UTC (rev 5908)
+++ trunk/ui/dataTable/src/main/config/component/dataTable.xml 2008-02-07 13:55:01 UTC (rev 5909)
@@ -36,7 +36,7 @@
<property>
<name>ajaxKeys</name>
<classname>java.util.Set</classname>
- <description>This attribute defines rows that are updated after an AJAX request</description>
+ <description>This attribute defines row keys that are updated after an AJAX request</description>
</property>
<property>
<name>columns</name>
Modified: trunk/ui/dataTable/src/main/config/component/subTable.xml
===================================================================
--- trunk/ui/dataTable/src/main/config/component/subTable.xml 2008-02-07 13:54:44 UTC (rev 5908)
+++ trunk/ui/dataTable/src/main/config/component/subTable.xml 2008-02-07 13:55:01 UTC (rev 5909)
@@ -35,7 +35,7 @@
<property>
<name>ajaxKeys</name>
<classname>java.util.Set</classname>
- <description>This attribute defines rows that are updated after an AJAX request</description>
+ <description>This attribute defines row keys that are updated after an AJAX request</description>
</property>
<property disabled="true" hidden="true">
<name>breakBefore</name>
Modified: trunk/ui/listShuttle/src/main/config/component/listShuttle.xml
===================================================================
--- trunk/ui/listShuttle/src/main/config/component/listShuttle.xml 2008-02-07 13:54:44 UTC (rev 5908)
+++ trunk/ui/listShuttle/src/main/config/component/listShuttle.xml 2008-02-07 13:55:01 UTC (rev 5909)
@@ -23,7 +23,7 @@
</tag>
&ui_input_attributes;
- &html_style_attributes;
+ &html_style_attributes;
&ui_data_attributes;
<property>
<name>columnClasses</name>
@@ -132,7 +132,7 @@
<name>onorderchanged</name>
<classname>java.lang.String</classname>
<description>HTML: script expression; called after ordering action</description>
- </property>
+ </property>
<property>
<name>showButtonLabels</name>
@@ -237,7 +237,7 @@
<property>
<name>ajaxKeys</name>
<classname>java.util.Set</classname>
- <description>Defines strings that are updated after an Ajax request</description>
+ <description>Defines row keys that are updated after an Ajax request</description>
</property>
<property>
<name>rowClasses</name>
@@ -396,79 +396,79 @@
<classname>java.lang.String</classname>
<description>HTML: a script expression; a pointer is moved onto</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
-
- <property>
- <name>moveControlsVerticalAlign</name>
- <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>moveControlsVerticalAlign</name>
+ <classname>java.lang.String</classname>
<description>Customizes vertically a position of move/copy controls relatively to lists</description>
- <defaultvalue><![CDATA["middle"]]></defaultvalue>
- </property>
- <property>
- <name>orderControlsVerticalAlign</name>
- <classname>java.lang.String</classname>
+ <defaultvalue><![CDATA["middle"]]></defaultvalue>
+ </property>
+ <property>
+ <name>orderControlsVerticalAlign</name>
+ <classname>java.lang.String</classname>
<description>Customizes vertically a position of order controls relatively to lists</description>
- <defaultvalue><![CDATA["middle"]]></defaultvalue>
- </property>
- <property>
- <name>listClass</name>
- <classname>java.lang.String</classname>
- <description>CSS class for a list</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>disabledControlClass</name>
- <classname>java.lang.String</classname>
- <description>CSS class for a disabled control</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>topControlClass</name>
- <classname>java.lang.String</classname>
- <description>CSS class for top control</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>bottomControlClass</name>
- <classname>java.lang.String</classname>
- <description>CSS class for bottom control</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>upControlClass</name>
- <classname>java.lang.String</classname>
- <description>CSS class for up control</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>downControlClass</name>
- <classname>java.lang.String</classname>
- <description>CSS class for down control</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>copyAllControlClass</name>
- <classname>java.lang.String</classname>
+ <defaultvalue><![CDATA["middle"]]></defaultvalue>
+ </property>
+ <property>
+ <name>listClass</name>
+ <classname>java.lang.String</classname>
+ <description>CSS class for a list</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>disabledControlClass</name>
+ <classname>java.lang.String</classname>
+ <description>CSS class for a disabled control</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>topControlClass</name>
+ <classname>java.lang.String</classname>
+ <description>CSS class for top control</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>bottomControlClass</name>
+ <classname>java.lang.String</classname>
+ <description>CSS class for bottom control</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>upControlClass</name>
+ <classname>java.lang.String</classname>
+ <description>CSS class for up control</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>downControlClass</name>
+ <classname>java.lang.String</classname>
+ <description>CSS class for down control</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>copyAllControlClass</name>
+ <classname>java.lang.String</classname>
<description>CSS class for copy all control</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>removeAllControlClass</name>
- <classname>java.lang.String</classname>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>removeAllControlClass</name>
+ <classname>java.lang.String</classname>
<description>CSS class for remove all control</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>copyControlClass</name>
- <classname>java.lang.String</classname>
- <description>CSS class for copy control</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
- <property>
- <name>removeControlClass</name>
- <classname>java.lang.String</classname>
- <description>CSS class for remove control</description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
</property>
+ <property>
+ <name>copyControlClass</name>
+ <classname>java.lang.String</classname>
+ <description>CSS class for copy control</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>removeControlClass</name>
+ <classname>java.lang.String</classname>
+ <description>CSS class for remove control</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
</component>
</components>
Modified: trunk/ui/orderingList/src/main/config/component/orderinglist.xml
===================================================================
--- trunk/ui/orderingList/src/main/config/component/orderinglist.xml 2008-02-07 13:54:44 UTC (rev 5908)
+++ trunk/ui/orderingList/src/main/config/component/orderinglist.xml 2008-02-07 13:55:01 UTC (rev 5909)
@@ -35,7 +35,7 @@
<property>
<name>ajaxKeys</name>
<classname>java.util.Set</classname>
- <description>Defines strings that are updated after an Ajax request</description>
+ <description>Defines row keys that are updated after an Ajax request</description>
</property>
<property>
<name>componentState</name>
Modified: trunk/ui/scrollableDataTable/src/main/config/component/scrollable-data-table.xml
===================================================================
--- trunk/ui/scrollableDataTable/src/main/config/component/scrollable-data-table.xml 2008-02-07 13:54:44 UTC (rev 5908)
+++ trunk/ui/scrollableDataTable/src/main/config/component/scrollable-data-table.xml 2008-02-07 13:55:01 UTC (rev 5909)
@@ -235,7 +235,7 @@
<property>
<name>ajaxKeys</name>
<classname>java.util.Set</classname>
- <description>This attribute defines rows that are updated after an AJAX request</description>
+ <description>This attribute defines row keys that are updated after an AJAX request</description>
</property>
<property hidden="true">
18 years, 2 months
JBoss Rich Faces SVN: r5908 - in trunk/samples/pickList-sample/src/main: webapp/pages and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-02-07 08:54:44 -0500 (Thu, 07 Feb 2008)
New Revision: 5908
Modified:
trunk/samples/pickList-sample/src/main/java/org/richfaces/Bean.java
trunk/samples/pickList-sample/src/main/webapp/pages/index.jsp
Log:
Modified: trunk/samples/pickList-sample/src/main/java/org/richfaces/Bean.java
===================================================================
--- trunk/samples/pickList-sample/src/main/java/org/richfaces/Bean.java 2008-02-07 12:47:37 UTC (rev 5907)
+++ trunk/samples/pickList-sample/src/main/java/org/richfaces/Bean.java 2008-02-07 13:54:44 UTC (rev 5908)
@@ -1,6 +1,8 @@
package org.richfaces;
import java.util.ArrayList;
+import java.util.List;
+
import javax.faces.event.ValueChangeEvent;
import javax.faces.model.SelectItem;
@@ -9,15 +11,20 @@
private ArrayList testList = new ArrayList();
private String selectedInfo;
- private String targetListWidth="";
- private String sourceListWidth="";
- private String listsHeight="";
+ private String targetListWidth="140px";
+ private String sourceListWidth="140px";
+ private String listsHeight="100px";
private String [] values = new String[]{"polecat","suricate"};
+ private List listValues = new ArrayList();
public Bean() {
testList.add(new SelectItem("polecat", "polecat"));
testList.add(new SelectItem("suricate", "suricate"));
testList.add(new SelectItem("marshotter", "marshotter"));
+
+ listValues.add("polecat");
+ listValues.add("suricate");
+
}
public void selectionChanged(ValueChangeEvent evt) {
Modified: trunk/samples/pickList-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/samples/pickList-sample/src/main/webapp/pages/index.jsp 2008-02-07 12:47:37 UTC (rev 5907)
+++ trunk/samples/pickList-sample/src/main/webapp/pages/index.jsp 2008-02-07 13:54:44 UTC (rev 5908)
@@ -34,11 +34,11 @@
<br/>
<br/>
- <pickList:pickList
+ <pickList:pickList valueChangeListener="#{pickBean.selectionChanged}"
listsHeight="#{pickBean.listsHeight}"
- valueChangeListener="#{pickBean.selectionChanged}"
sourceListWidth="#{pickBean.sourceListWidth}"
targetListWidth="#{pickBean.targetListWidth}"
+ value="#{pickBean.values}"
>
<f:selectItem itemValue="cat" itemLabel="cat"/>
<f:selectItem itemValue="dog" itemLabel="dog"/>
18 years, 2 months
JBoss Rich Faces SVN: r5907 - in trunk/ui: dataTable/src/main/java/org/richfaces and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-02-07 07:47:37 -0500 (Thu, 07 Feb 2008)
New Revision: 5907
Added:
trunk/ui/dataTable/src/main/java/org/richfaces/taglib/
trunk/ui/dataTable/src/main/java/org/richfaces/taglib/ColumnTagHandler.java
Modified:
trunk/ui/dataTable/src/main/config/component/column.xml
trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java
trunk/ui/scrollableDataTable/src/test/java/org/richfaces/component/html/MockColumns.java
Log:
RF-1741
Modified: trunk/ui/dataTable/src/main/config/component/column.xml
===================================================================
--- trunk/ui/dataTable/src/main/config/component/column.xml 2008-02-07 12:45:55 UTC (rev 5906)
+++ trunk/ui/dataTable/src/main/config/component/column.xml 2008-02-07 12:47:37 UTC (rev 5907)
@@ -22,11 +22,9 @@
</superclass>
<test/>
</tag>
- <!--
<taghandler>
- <classname>org.ajax4jsf.tag.TestHandler</classname>
+ <classname>org.richfaces.taglib.ColumnTagHandler</classname>
</taghandler>
- -->
&ui_component_attributes;
&html_universal_attributes;
<property disabled="true">
@@ -93,6 +91,13 @@
<classname>boolean</classname>
<description>Attribute defines a bean property which is used for filtering of a column</description>
</property>
+ <property elonly="true">
+ <name>filterMethod</name>
+ <classname>javax.el.MethodExpression</classname>
+ <methodargs>java.lang.Object</methodargs>
+ <returntype>boolean</returntype>
+ <description></description>
+ </property>
<!--
<property>
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java 2008-02-07 12:45:55 UTC (rev 5906)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java 2008-02-07 12:47:37 UTC (rev 5907)
@@ -27,6 +27,7 @@
import javax.el.ELContext;
import javax.el.ExpressionFactory;
+import javax.el.MethodExpression;
import javax.el.ValueExpression;
import javax.faces.component.UIColumn;
import javax.faces.component.UIComponent;
@@ -177,6 +178,10 @@
if (filterExpression != null) {
filterFields.add(new FilterField(filterExpression));
}
+ MethodExpression filterMethod = column.getFilterMethod();
+ if (filterMethod != null) {
+ filterFields.add(new FilterField(filterMethod));
+ }
if (column.isSortable() && !Ordering.UNSORTED.equals(column.getSortOrder())) {
ValueExpression sortExpression = component.getValueExpression("sortExpression");
if (sortExpression != null) {
Added: trunk/ui/dataTable/src/main/java/org/richfaces/taglib/ColumnTagHandler.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/taglib/ColumnTagHandler.java (rev 0)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/taglib/ColumnTagHandler.java 2008-02-07 12:47:37 UTC (rev 5907)
@@ -0,0 +1,58 @@
+/**
+ *
+ */
+package org.richfaces.taglib;
+
+import javax.el.MethodExpression;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+import com.sun.facelets.FaceletContext;
+import com.sun.facelets.tag.MetaRule;
+import com.sun.facelets.tag.MetaRuleset;
+import com.sun.facelets.tag.Metadata;
+import com.sun.facelets.tag.MetadataTarget;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.tag.jsf.ComponentConfig;
+import com.sun.facelets.tag.jsf.ComponentHandler;
+
+/**
+ * @author Konstantin Mishin
+ *
+ */
+public class ColumnTagHandler extends ComponentHandler {
+
+ private final static String FILTER_METHOD = "filterMethod";
+
+ public ColumnTagHandler(ComponentConfig config) {
+ super(config);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ protected MetaRuleset createMetaRuleset(Class type) {
+ MetaRuleset ruleset = super.createMetaRuleset(type);
+
+ ruleset.addRule(new MetaRule() {
+
+ @Override
+ public Metadata applyRule(String name, final TagAttribute attribute, MetadataTarget metadataTarget) {
+ if (FILTER_METHOD.equals(name)) {
+ return new Metadata() {
+ public void applyMetadata(FaceletContext context, Object object) {
+ FacesContext facesContext = context.getFacesContext();
+
+ MethodExpression expression = facesContext.getApplication().getExpressionFactory().
+ createMethodExpression(facesContext.getELContext(), attribute.getValue(), boolean.class, new Class[]{Object.class});
+ ((UIComponent) object).getAttributes().put(FILTER_METHOD, expression);
+ }
+ };
+ }
+
+ return null;
+ }
+ });
+
+ return ruleset;
+ }
+}
Modified: trunk/ui/scrollableDataTable/src/test/java/org/richfaces/component/html/MockColumns.java
===================================================================
--- trunk/ui/scrollableDataTable/src/test/java/org/richfaces/component/html/MockColumns.java 2008-02-07 12:45:55 UTC (rev 5906)
+++ trunk/ui/scrollableDataTable/src/test/java/org/richfaces/component/html/MockColumns.java 2008-02-07 12:47:37 UTC (rev 5907)
@@ -21,6 +21,7 @@
package org.richfaces.component.html;
+import javax.el.MethodExpression;
import javax.faces.component.UIColumn;
import javax.faces.component.UIComponent;
import javax.faces.component.UIComponentBase;
@@ -40,6 +41,7 @@
private String sortExpression;
private Ordering sortOrder;
+ private MethodExpression methodExpression;
private boolean sortable;
private boolean breakbefore;
@@ -84,4 +86,13 @@
public void setSortOrder(Ordering sortOrder) {
this.sortOrder = sortOrder;
}
+
+ public MethodExpression getFilterMethod() {
+ return methodExpression;
+ }
+
+ public void setFilterMethod(MethodExpression methodExpression) {
+ this.methodExpression = methodExpression;
+
+ }
}
18 years, 2 months