JBoss Rich Faces SVN: r7638 - trunk/docs/userguide/en/src/main/docbook/modules.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2008-04-07 13:24:45 -0400 (Mon, 07 Apr 2008)
New Revision: 7638
Modified:
trunk/docs/userguide/en/src/main/docbook/modules/RFCtechreqs.xml
Log:
http://jira.jboss.com/jira/browse/RF-2949 - All servers except Sybase EAServer were checked.
Modified: trunk/docs/userguide/en/src/main/docbook/modules/RFCtechreqs.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/modules/RFCtechreqs.xml 2008-04-07 16:48:23 UTC (rev 7637)
+++ trunk/docs/userguide/en/src/main/docbook/modules/RFCtechreqs.xml 2008-04-07 17:24:45 UTC (rev 7638)
@@ -78,7 +78,7 @@
<section id="SupportedJavaServerFacesImplementations">
<?dbhtml filename="SupportedJavaServerFacesImplementations.html"?>
- <title>Supported JavaServer Faces Implementations</title>
+ <title>Supported JavaServer Faces Implementations and Frameworks</title>
<itemizedlist>
<listitem>Sun JSF-RI - 1.2</listitem>
@@ -97,7 +97,7 @@
<title>Supported Servers</title>
<itemizedlist>
- <listitem>Apache Tomcat 4.1 - 6.0</listitem>
+ <listitem>Apache Tomcat 5.5 - 6.0</listitem>
<listitem>IBM WebSphere 6.1</listitem>
@@ -105,15 +105,15 @@
<listitem>Oracle AS/OC4J 10.1.3</listitem>
- <listitem>Resin 3.0</listitem>
+ <listitem>Resin 3.1</listitem>
- <listitem>Jetty 5.1.x</listitem>
+ <listitem>Jetty 6.1.x</listitem>
- <listitem>Sun Application Server 8 (J2EE 1.4)</listitem>
+ <listitem>Sun Application Server 9 (J2EE 1.5)</listitem>
<listitem>Glassfish (J2EE 5)</listitem>
- <listitem>JBoss 3.2 - 4.2.x</listitem>
+ <listitem>JBoss 4.2.x - 5</listitem>
<listitem>Sybase EAServer 6.0.1</listitem>
</itemizedlist>
17 years, 5 months
JBoss Rich Faces SVN: r7637 - in trunk/samples/richfaces-demo: src/main/java/org/richfaces/demo/tree and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-04-07 12:48:23 -0400 (Mon, 07 Apr 2008)
New Revision: 7637
Removed:
trunk/samples/richfaces-demo/src/test/java/
Modified:
trunk/samples/richfaces-demo/pom.xml
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/Album.java
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/Artist.java
Log:
Modified: trunk/samples/richfaces-demo/pom.xml
===================================================================
--- trunk/samples/richfaces-demo/pom.xml 2008-04-07 16:37:17 UTC (rev 7636)
+++ trunk/samples/richfaces-demo/pom.xml 2008-04-07 16:48:23 UTC (rev 7637)
@@ -1,18 +1,75 @@
<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>samples</artifactId>
- <groupId>org.richfaces</groupId>
- <version>3.2.1-SNAPSHOT</version>
- </parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.richfaces.samples</groupId>
<artifactId>richfaces-demo</artifactId>
<packaging>war</packaging>
+ <version>3.2.0.GA</version>
<name>richfaces-demo Maven Webapp</name>
- <version>3.2.1-SNAPSHOT</version>
+
+ <repositories>
+ <repository>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ <id>repository.jboss.com</id>
+ <name>Jboss Repository for Maven</name>
+ <url>
+ http://repository.jboss.com/maven2/
+ </url>
+ </repository>
+ </repositories>
+
<build>
<finalName>richfaces-demo</finalName>
<plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.0</version>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <!--
+ -->
+ <version>6.1.5</version>
+ <configuration>
+ <scanIntervalSeconds>10</scanIntervalSeconds>
+ <connectors>
+ <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+ <port>8080</port>
+ <maxIdleTime>60000</maxIdleTime>
+ </connector>
+ </connectors>
+ </configuration>
+
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ <executions>
+ <execution>
+ <id>surefire-it</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>false</skip>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
@@ -179,7 +236,7 @@
<dependency>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-ui</artifactId>
- <version>3.2.1-SNAPSHOT</version>
+ <version>3.2.0.GA</version>
</dependency>
<dependency>
<groupId>com.uwyn</groupId>
@@ -187,15 +244,61 @@
<version>1.0</version>
</dependency>
<dependency>
- <groupId>org.richfaces.ui</groupId>
- <artifactId>core</artifactId>
- <version>3.2.1-SNAPSHOT</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.8.1</version>
</dependency>
+ <dependency>
+ <groupId>com.sun.facelets</groupId>
+ <artifactId>jsf-facelets</artifactId>
+ <version>1.1.14</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jstl</artifactId>
+ <version>1.0</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>nekohtml</groupId>
+ <artifactId>nekohtml</artifactId>
+ <version>0.9.5</version>
+ <scope>runtime</scope>
+ <exclusions>
+ <exclusion>
+ <artifactId>xerces</artifactId>
+ <groupId>xerces</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>jsp-api</artifactId>
+ <version>2.1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>1.2_07</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <version>1.2_07</version>
+ <scope>runtime</scope>
+ </dependency>
</dependencies>
</project>
Modified: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/Album.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/Album.java 2008-04-07 16:37:17 UTC (rev 7636)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/Album.java 2008-04-07 16:48:23 UTC (rev 7637)
@@ -1,7 +1,7 @@
package org.richfaces.demo.tree;
-import java.util.HashMap;
import java.util.Iterator;
+import java.util.LinkedHashMap;
import java.util.Map;
import org.richfaces.model.TreeNode;
@@ -12,7 +12,7 @@
*/
private static final long serialVersionUID = 6514596192023597908L;
private long id;
- private Map songs = new HashMap();
+ private Map songs = new LinkedHashMap();
private String title;
private Integer year;
private Artist artist;
Modified: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/Artist.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/Artist.java 2008-04-07 16:37:17 UTC (rev 7636)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/Artist.java 2008-04-07 16:48:23 UTC (rev 7637)
@@ -1,14 +1,14 @@
package org.richfaces.demo.tree;
-import java.util.HashMap;
import java.util.Iterator;
+import java.util.LinkedHashMap;
import java.util.Map;
import org.richfaces.model.TreeNode;
public class Artist implements TreeNode {
private long id;
- private Map albums = new HashMap();
+ private Map albums = new LinkedHashMap();
private String name;
private Library library;
17 years, 5 months
JBoss Rich Faces SVN: r7636 - trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/common/utils.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-04-07 12:37:17 -0400 (Mon, 07 Apr 2008)
New Revision: 7636
Modified:
trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/common/utils/Utils.js
Log:
RF-2893
Modified: trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/common/utils/Utils.js
===================================================================
--- trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/common/utils/Utils.js 2008-04-07 16:19:26 UTC (rev 7635)
+++ trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/common/utils/Utils.js 2008-04-07 16:37:17 UTC (rev 7636)
@@ -196,7 +196,10 @@
var rowindex, i, el;
var dataModel = grid.dataModel;
var baseid = clientid;
-
+ var suffixs = [":n:"];
+ if (($(baseid+":f")).rows.length) {
+ suffixs = [":f:", ":n:"];
+ }
var countForUpdate = 0;
var rowsForUpdate = [];
@@ -205,7 +208,7 @@
if(rowindex >= rowCount){
rowindex -= rowCount;
}
- [":f:", ":n:"].unbreakableEach(
+ suffixs.unbreakableEach(
function(suffix) {
var id = [baseid,suffix,rowindex].join("");
var row = Utils.DOM.replaceNode(id, request);
@@ -239,8 +242,13 @@
callbacks.unbreakableEach(
function(callback) {
if(rowsForUpdate[i]) {
- if(rowsForUpdate[i][":f:"].row) callback.call(grid, rowsForUpdate[i][":f:"]);
- if(rowsForUpdate[i][":n:"].row) callback.call(grid, rowsForUpdate[i][":n:"]);
+ suffixs.unbreakableEach(
+ function(suffix) {
+ if(rowsForUpdate[i][suffix].row) {
+ callback.call(grid, rowsForUpdate[i][suffix]);
+ }
+ }
+ );
}
}
);
17 years, 5 months
JBoss Rich Faces SVN: r7635 - in trunk/ui/combobox/src: main/templates and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-04-07 12:19:26 -0400 (Mon, 07 Apr 2008)
New Revision: 7635
Modified:
trunk/ui/combobox/src/main/java/org/richfaces/renderkit/ComboBoxBaseRenderer.java
trunk/ui/combobox/src/main/templates/combobox.jspx
trunk/ui/combobox/src/test/java/org/richfaces/renderkit/ComboBoxRendererTest.java
Log:
http://jira.jboss.com/jira/browse/RF-2967
Modified: trunk/ui/combobox/src/main/java/org/richfaces/renderkit/ComboBoxBaseRenderer.java
===================================================================
--- trunk/ui/combobox/src/main/java/org/richfaces/renderkit/ComboBoxBaseRenderer.java 2008-04-07 16:18:10 UTC (rev 7634)
+++ trunk/ui/combobox/src/main/java/org/richfaces/renderkit/ComboBoxBaseRenderer.java 2008-04-07 16:19:26 UTC (rev 7635)
@@ -33,12 +33,11 @@
*/
public class ComboBoxBaseRenderer extends HeaderResourcesRendererBase {
- private List valuesList = null;
- private final String RICH_COMBOBOX_ITEM_CLASSES = "rich-combobox-item rich-combobox-item-normal";
+ private static final String RICH_COMBOBOX_ITEM_CLASSES = "rich-combobox-item rich-combobox-item-normal";
private static Log logger = LogFactory.getLog(ComboBoxBaseRenderer.class);
protected Class<? extends UIComponent> getComponentClass() {
- return UIComboBox.class;
+ return UIComboBox.class;
}
protected void doDecode(FacesContext context, UIComponent component) {
@@ -48,14 +47,14 @@
comboBox = (UIComboBox) component;
} else {
if (logger.isDebugEnabled()) {
- logger.debug("No decoding necessary since the component " + component.getId() + " is not an instance or a sub class of UIComboBox");
+ logger.debug("No decoding necessary since the component " + component.getId() + " is not an instance or a sub class of UIComboBox");
}
return;
}
if (InputUtils.isDisabled(comboBox) || InputUtils.isReadOnly(comboBox)) {
if (logger.isDebugEnabled()) {
- logger.debug(("No decoding necessary since the component " + component.getId() + " is disabled"));
+ logger.debug(("No decoding necessary since the component " + component.getId() + " is disabled"));
}
}
@@ -71,88 +70,91 @@
comboBox.setSubmittedValue(newValue);
}
}
+
+ public List encodeItems(FacesContext context, UIComponent component) throws IOException {
+ if (!isAcceptableComponent(component)) {
+ return null;
+ }
+
+ UIComboBox comboBox = (UIComboBox) component;
+ Object suggestionValues = comboBox.getSuggestionValues();
+ ResponseWriter writer = context.getResponseWriter();
- public void encodeItems(FacesContext context, UIComponent component) throws IOException {
- UIComboBox comboBox = (UIComboBox) component;
- Object suggestionValues = comboBox.getSuggestionValues();
- ResponseWriter writer = context.getResponseWriter();
+ List values = new ArrayList();
- List values = new ArrayList();
+ if (suggestionValues != null) {
+ if (suggestionValues instanceof Collection) {
+ for (Iterator iterator = ((Collection) suggestionValues).iterator(); iterator.hasNext();) {
+ String value = getConvertedStringValue(context, comboBox, iterator.next());
+ values.add(value);
+ encodeSuggestion(writer, comboBox, value, RICH_COMBOBOX_ITEM_CLASSES);
+ }
+ } else if (suggestionValues.getClass().isArray()) {
+ Object[] suggestions = (Object[]) suggestionValues;
+ for (int i = 0; i < suggestions.length; i++) {
+ String value = getConvertedStringValue(context, comboBox, suggestions[i]);
+ values.add(value);
+ encodeSuggestion(writer, comboBox, value, RICH_COMBOBOX_ITEM_CLASSES);
+ }
+ } else {
+ throw new IllegalArgumentException("suggestionValues should be Collection or array");
+ }
+
+ }
- if (suggestionValues != null) {
- if (suggestionValues instanceof Collection) {
- for (Iterator iterator = ((Collection) suggestionValues).iterator(); iterator.hasNext();) {
- String value = getConvertedStringValue(context, comboBox, iterator.next());
- values.add(value);
- encodeSuggestion(writer, comboBox, value, RICH_COMBOBOX_ITEM_CLASSES);
+ List<SelectItem> selectItems = SelectUtils.getSelectItems(context, component);
+ if (!selectItems.isEmpty()) {
+ for (Iterator<SelectItem> iterator = selectItems.iterator(); iterator.hasNext();) {
+ SelectItem selectItem = iterator.next();
+ String value = getConvertedStringValue(context, comboBox, selectItem.getValue());
+ values.add(value);
+ encodeSuggestion(writer, comboBox, value, RICH_COMBOBOX_ITEM_CLASSES);
+ }
}
- } else if (suggestionValues.getClass().isArray()) {
- Object[] suggestions = (Object[]) suggestionValues;
- for (int i = 0; i < suggestions.length; i++) {
- String value = getConvertedStringValue(context, comboBox, suggestions[i]);
- values.add(value);
- encodeSuggestion(writer, comboBox, value, RICH_COMBOBOX_ITEM_CLASSES);
- }
- } else {
- throw new IllegalArgumentException("suggestionValues should be Collection or array");
- }
-
- }
-
- List<SelectItem> selectItems = SelectUtils.getSelectItems(context, component);
- if (!selectItems.isEmpty()) {
- for (Iterator<SelectItem> iterator = selectItems.iterator(); iterator.hasNext();) {
- SelectItem selectItem = iterator.next();
- String value = getConvertedStringValue(context, comboBox, selectItem.getValue());
- values.add(value);
- encodeSuggestion(writer, comboBox, value, RICH_COMBOBOX_ITEM_CLASSES);
- }
- }
- setValuesList(values);
+ return values;
}
@Override
public Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue) throws ConverterException {
- return InputUtils.getConvertedValue(context, component, submittedValue);
+ return InputUtils.getConvertedValue(context, component, submittedValue);
+ }
- }
protected String getConvertedStringValue(FacesContext context, UIComponent component, Object value) {
- return InputUtils.getConvertedStringValue(context, component, value);
+ return InputUtils.getConvertedStringValue(context, component, value);
}
public void encodeSuggestion(ResponseWriter writer, UIComponent component, String value, String classes) throws IOException {
- writer.startElement(HTML.SPAN_ELEM, component);
- writer.writeAttribute(HTML.class_ATTRIBUTE, classes, null);
- writer.write(value);
- writer.endElement(HTML.SPAN_ELEM);
+ writer.startElement(HTML.SPAN_ELEM, component);
+ writer.writeAttribute(HTML.class_ATTRIBUTE, classes, null);
+ writer.writeText(value, null);
+ writer.endElement(HTML.SPAN_ELEM);
}
-
- public String getItemsTextAsJSArray(FacesContext context, UIComponent component) {
- return ScriptUtils.toScript(valuesList);
+
+ protected boolean isAcceptableComponent(UIComponent component) {
+ if (component instanceof UIComboBox) {
+ return true;
+ }
+ return false;
}
+
+ public String getItemsTextAsJSArray(FacesContext context, UIComponent component, List items) {
+ return ScriptUtils.toScript(items);
+ }
public String getAsEventHandler(FacesContext context, UIComponent component, String attributeName) {
- String event = (String) component.getAttributes().get(attributeName);
- ScriptString result = JSReference.NULL;
+ String event = (String) component.getAttributes().get(attributeName);
+ ScriptString result = JSReference.NULL;
- if (event != null) {
- event = event.trim();
- if (event.length() != 0) {
- JSFunctionDefinition function = new JSFunctionDefinition();
- function.addParameter("event");
- function.addToBody(event);
- result = function;
- }
- }
+ if (event != null) {
+ event = event.trim();
+ if (event.length() != 0) {
+ JSFunctionDefinition function = new JSFunctionDefinition();
+ function.addParameter("event");
+ function.addToBody(event);
+ result = function;
+ }
+ }
- return ScriptUtils.toScript(result);
+ return ScriptUtils.toScript(result);
}
-
- public List getValuesList() {
- return valuesList;
- }
-
- public void setValuesList(List valuesList) {
- this.valuesList = valuesList;
- }
}
Modified: trunk/ui/combobox/src/main/templates/combobox.jspx
===================================================================
--- trunk/ui/combobox/src/main/templates/combobox.jspx 2008-04-07 16:18:10 UTC (rev 7634)
+++ trunk/ui/combobox/src/main/templates/combobox.jspx 2008-04-07 16:19:26 UTC (rev 7635)
@@ -11,6 +11,7 @@
component="org.richfaces.component.UIComboBox">
<jsp:directive.page import="org.richfaces.component.util.HtmlUtil" />
+ <jsp:directive.page import=" java.util.List"/>
<h:styles>css/combobox.xcss</h:styles>
<h:scripts>
@@ -248,7 +249,8 @@
<div id="#{clientId}listPosition" class="rich-combobox-list-position">
<div id="#{clientId}listDecoration" class="rich-combobox-list-decoration">
<div id="#{clientId}list" class="rich-combobox-list-scroll">
- <f:call name="encodeItems"/>
+ <c:object type="java.util.List" var="items" value="#{this:encodeItems(context,component)}">
+ </c:object>
</div>
</div>
</div>
@@ -306,7 +308,7 @@
"#{clientId}shadow",
Richfaces.ComboBox.CLASSES,
"#{listWidth}", "#{listHeight}",
- #{this:getItemsTextAsJSArray(context, component)},
+ #{this:getItemsTextAsJSArray(context, component,items)},
#{directInputSuggestions},
#{filterNewValues},
#{selectFirstOnUpdate},
Modified: trunk/ui/combobox/src/test/java/org/richfaces/renderkit/ComboBoxRendererTest.java
===================================================================
--- trunk/ui/combobox/src/test/java/org/richfaces/renderkit/ComboBoxRendererTest.java 2008-04-07 16:18:10 UTC (rev 7634)
+++ trunk/ui/combobox/src/test/java/org/richfaces/renderkit/ComboBoxRendererTest.java 2008-04-07 16:19:26 UTC (rev 7635)
@@ -70,10 +70,10 @@
requestMap.put(id, "Pennsylvania");
}
- public void itemsTextAsJSArrayTest() {
- String script = renderer.getItemsTextAsJSArray(facesContext, comboBox);
- assertNotNull(script);
- }
+// public void itemsTextAsJSArrayTest() {
+// String script = renderer.getItemsTextAsJSArray(facesContext, comboBox);
+// assertNotNull(script);
+// }
public void testRender() throws Exception {
17 years, 5 months
JBoss Rich Faces SVN: r7634 - in trunk/ui/inplaceInput/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-04-07 12:18:10 -0400 (Mon, 07 Apr 2008)
New Revision: 7634
Modified:
trunk/ui/inplaceInput/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java
trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx
Log:
http://jira.jboss.com/jira/browse/RF-2967
Modified: trunk/ui/inplaceInput/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java
===================================================================
--- trunk/ui/inplaceInput/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java 2008-04-07 16:17:41 UTC (rev 7633)
+++ trunk/ui/inplaceInput/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java 2008-04-07 16:18:10 UTC (rev 7634)
@@ -53,8 +53,9 @@
private static final String INPLACE_CSS_CHANGE = "changed";
private static final String INPLACE_CSS_HOVER = "hover";
+
+ private static final String EMPTY_DEFAULT_LABEL = "   ";
-
protected Class<UIInplaceInput> getComponentClass() {
return UIInplaceInput.class;
@@ -120,7 +121,7 @@
String defaultLabel = (String)component.getAttributes().get("defaultLabel");
if (defaultLabel == null || defaultLabel.equals("")) {
- defaultLabel = "   ";
+ defaultLabel = EMPTY_DEFAULT_LABEL;
}
options.addOption("defaultLabel", defaultLabel);
@@ -150,7 +151,7 @@
return events.toString();
}
-
+
public String encodeInplaceInputCss(FacesContext context, UIComponent component) {
StringBuffer cssMap = new StringBuffer();
cssMap.append("var classes = ");
@@ -239,4 +240,11 @@
protected String getConvertedStringValue(FacesContext context, UIInplaceInput component, Object value) {
return InputUtils.getConvertedStringValue(context, component, value);
}
+
+ protected boolean isEmptyDefaultLabel(String defaultLabel) {
+ if (defaultLabel != null && EMPTY_DEFAULT_LABEL.equals(defaultLabel)) {
+ return true;
+ }
+ return false;
+ }
}
Modified: trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx
===================================================================
--- trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-04-07 16:17:41 UTC (rev 7633)
+++ trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-04-07 16:18:10 UTC (rev 7634)
@@ -30,8 +30,8 @@
if (value == null) {
value = component.getValue();
}
+ value = getConvertedStringValue(context, component,value);
Object fieldValue = value;
- value = getConvertedStringValue(context, component,value);
if (value == null || value.equals("")) {
fieldValue = "";
String defaultValue = (String)component.getAttributes().get("defaultLabel");
@@ -174,8 +174,12 @@
</div>
<jsp:scriptlet>
- writer.write(convertToString(variables.getVariable("value")));
- if (!layout.equals("inline")) {
+ if(isEmptyDefaultLabel(convertToString(variables.getVariable("value")))) {
+ writer.write(convertToString(variables.getVariable("value")));
+ } else {
+ writer.writeText(convertToString(variables.getVariable("value")),null);
+ }
+ if (!layout.equals("inline")) {
</jsp:scriptlet>
</div>
<jsp:scriptlet>
17 years, 5 months
JBoss Rich Faces SVN: r7633 - in trunk/ui/inplaceSelect/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-04-07 12:17:41 -0400 (Mon, 07 Apr 2008)
New Revision: 7633
Modified:
trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
Log:
http://jira.jboss.com/jira/browse/RF-2967
Modified: trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
===================================================================
--- trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2008-04-07 15:02:59 UTC (rev 7632)
+++ trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2008-04-07 16:17:41 UTC (rev 7633)
@@ -19,7 +19,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.richfaces.component.UIInplaceSelect;
-import org.richfaces.json.JSONArray;
/**
* InplaceSelect base renderer implementation
@@ -31,127 +30,139 @@
private static Log logger = LogFactory.getLog(InplaceSelectBaseRenderer.class);
private static final String RICH_INPLACE_SELECT_CLASSES = "rich-inplace-select-item rich-inplace-select-font";
private static final String CONTROLS_FACET = "controls";
+ private static final String EMPTY_DEFAULT_LABEL = "   ";
+
- private JSONArray jsonParentArray;
-
-
@Override
protected void doDecode(FacesContext context, UIComponent component) {
- UIInplaceSelect inplaceInput = null;
-
- if (component instanceof UIInplaceSelect) {
- inplaceInput = (UIInplaceSelect) component;
- } else {
- if (logger.isDebugEnabled()) {
- logger.debug("No decoding necessary since the component " + component.getId() + " is not an instance or a sub class of UIInplaceSelect");
- }
- return;
- }
-
- if (InputUtils.isDisabled(inplaceInput) || InputUtils.isReadOnly(inplaceInput)) {
- if (logger.isDebugEnabled()) {
- logger.debug(("No decoding necessary since the component " + component.getId() + " is disabled"));
- }
- }
-
- String clientId = component.getClientId(context);
- if (clientId == null) {
- throw new NullPointerException("component " + inplaceInput.getClientId(context) + " client id is NULL");
- }
-
- clientId = clientId + "inplaceValue";
- Map request = context.getExternalContext().getRequestParameterMap();
- if (request.containsKey(clientId)) {
- String newValue = (String) request.get(clientId);
- if(newValue != null) {
- inplaceInput.setSubmittedValue(newValue);
- }
- }
+ UIInplaceSelect inplaceInput = null;
+
+ if (component instanceof UIInplaceSelect) {
+ inplaceInput = (UIInplaceSelect) component;
+ } else {
+ if (logger.isDebugEnabled()) {
+ logger.debug("No decoding necessary since the component " + component.getId() + " is not an instance or a sub class of UIInplaceSelect");
+ }
+ return;
+ }
+
+ if (InputUtils.isDisabled(inplaceInput) || InputUtils.isReadOnly(inplaceInput)) {
+ if (logger.isDebugEnabled()) {
+ logger.debug(("No decoding necessary since the component " + component.getId() + " is disabled"));
+ }
+ }
+
+ String clientId = component.getClientId(context);
+ if (clientId == null) {
+ throw new NullPointerException("component " + inplaceInput.getClientId(context) + " client id is NULL");
+ }
+
+ clientId = clientId + "inplaceValue";
+ Map request = context.getExternalContext().getRequestParameterMap();
+ if (request.containsKey(clientId)) {
+ String newValue = (String) request.get(clientId);
+ if(newValue != null) {
+ inplaceInput.setSubmittedValue(newValue);
+ }
+ }
}
- public void encodeItems(FacesContext context, UIComponent component) throws IOException {
- List <String> labels = new ArrayList<String>();
- ResponseWriter writer = context.getResponseWriter();
- jsonParentArray = new JSONArray();
-
- List<SelectItem> selectItems = SelectUtils.getSelectItems(context, component);
- if (!selectItems.isEmpty()) {
- for (Iterator<SelectItem> iterator = selectItems.iterator(); iterator.hasNext();) {
- SelectItem selectItem = iterator.next();
- String value = getConvertedStringValue(context, component, selectItem.getValue());
- String label = selectItem.getLabel();
- labels.add(label);
-
- encodeSuggestion(writer, component, label, RICH_INPLACE_SELECT_CLASSES);
-
- JSONArray jsonChildArray = new JSONArray();
- jsonChildArray.put(label);
- jsonChildArray.put(value);
- jsonParentArray.put(jsonChildArray);
- }
- }
- setValuesList(labels);
+ protected boolean isAcceptableComponent(UIComponent component) {
+ if (component instanceof UIInplaceSelect) {
+ return true;
+ }
+ return false;
}
+
+ public List encodeItems(FacesContext context, UIComponent component) throws IOException {
+
+ if (!isAcceptableComponent(component)) {
+ return null;
+ }
+
+ List parentList = new ArrayList();
+ UIInplaceSelect inplaceSelect = (UIInplaceSelect)component;
+ List <String> labels = new ArrayList<String>();
+ ResponseWriter writer = context.getResponseWriter();
+ List<SelectItem> selectItems = SelectUtils.getSelectItems(context, inplaceSelect);
+ if (!selectItems.isEmpty()) {
+ for (Iterator<SelectItem> iterator = selectItems.iterator(); iterator.hasNext();) {
+ SelectItem selectItem = iterator.next();
+ String value = getConvertedStringValue(context, inplaceSelect, selectItem.getValue());
+ String label = selectItem.getLabel();
+ labels.add(label);
+
+ encodeSuggestion(writer, inplaceSelect, label, RICH_INPLACE_SELECT_CLASSES);
+
+ List childList = new ArrayList();
+ childList.add(label);
+ childList.add(value);
+ parentList.add(childList);
+ }
+ }
+ return parentList;
+ }
public void encodeControlsFacet(FacesContext context, UIComponent component) throws IOException {
- UIComponent facet = component.getFacet(CONTROLS_FACET);
- if ((facet != null) && (facet.isRendered())) {
- renderChild(context, facet);
- }
+ UIComponent facet = component.getFacet(CONTROLS_FACET);
+ if ((facet != null) && (facet.isRendered())) {
+ renderChild(context, facet);
+ }
}
public boolean isControlsFacetExists(FacesContext context, UIComponent component) {
- UIComponent facet = component.getFacet(CONTROLS_FACET);
- if (facet != null && facet.isRendered()) {
- return true;
- }
- return false;
+ UIComponent facet = component.getFacet(CONTROLS_FACET);
+ if (facet != null && facet.isRendered()) {
+ return true;
+ }
+ return false;
}
protected Class<? extends UIComponent> getComponentClass() {
- return UIInplaceSelect.class;
+ return UIInplaceSelect.class;
}
- public String getItemsTextAsJSArray(FacesContext context, UIComponent component) {
- StringBuffer attributes = new StringBuffer();
- attributes.append(jsonParentArray.toString());
- return attributes.toString();
- }
-
public String getSelectedItemLabel(FacesContext context, UIInplaceSelect component) {
- String defaultLabel = null;
- Object value = component.getSubmittedValue();
- if (value == null) {
- value = component.getAttributes().get("value");
- }
- if (value == null) {
- return createDefaultLabel(component);
- }
- defaultLabel = getItemLabel(context, component, value);
- if (defaultLabel == null) {
- return createDefaultLabel(component);
- }
- return defaultLabel;
+ String defaultLabel = null;
+ Object value = component.getSubmittedValue();
+ if (value == null) {
+ value = component.getAttributes().get("value");
+ }
+ if (value == null) {
+ return createDefaultLabel(component);
+ }
+ defaultLabel = getItemLabel(context, component, value);
+ if (defaultLabel == null) {
+ return createDefaultLabel(component);
+ }
+ return defaultLabel;
}
protected String getItemLabel(FacesContext context, UIComponent component, Object value) {
- String itemLabel = null;
- List<SelectItem> selectItems = SelectUtils.getSelectItems(context, component);
- if (!selectItems.isEmpty()) {
- for(SelectItem item : selectItems) {
- if (value.equals(item.getValue())) {
- itemLabel = item.getLabel();
+ String itemLabel = null;
+ List<SelectItem> selectItems = SelectUtils.getSelectItems(context, component);
+ if (!selectItems.isEmpty()) {
+ for(SelectItem item : selectItems) {
+ if (value.equals(item.getValue())) {
+ itemLabel = item.getLabel();
+ }
+ }
}
- }
- }
- return itemLabel;
+ return itemLabel;
}
protected String createDefaultLabel(UIComponent component) {
- String defaultLabel = (String) component.getAttributes().get("defaultLabel");
- if (defaultLabel == null || defaultLabel.equals("")) {
- defaultLabel = "   ";
- }
- return defaultLabel;
+ String defaultLabel = (String) component.getAttributes().get("defaultLabel");
+ if (defaultLabel == null || defaultLabel.equals("")) {
+ defaultLabel = EMPTY_DEFAULT_LABEL;
+ }
+ return defaultLabel;
}
+
+ protected boolean isEmptyDefaultLabel(String defaultLabel) {
+ if (defaultLabel != null && EMPTY_DEFAULT_LABEL.equals(defaultLabel)) {
+ return true;
+ }
+ return false;
+ }
}
Modified: trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
===================================================================
--- trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2008-04-07 15:02:59 UTC (rev 7632)
+++ trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2008-04-07 16:17:41 UTC (rev 7633)
@@ -9,6 +9,8 @@
baseclass="org.richfaces.renderkit.InplaceSelectBaseRenderer"
class="org.richfaces.renderkit.html.InplaceSelectRenderer"
component="org.richfaces.component.UIInplaceSelect">
+
+
<h:styles>css/inplaceselect.xcss</h:styles>
@@ -32,10 +34,10 @@
if(value == null) {
value = component.getAttributes().get("value");
}
- Object fieldValue = value;
- String fieldLabel = getSelectedItemLabel(context, component);
+ String fieldLabel = getSelectedItemLabel(context, component);
value = getConvertedStringValue(context, component,value);
-
+ Object fieldValue = value;
+
if (value == null || value.equals("")) {
fieldValue = "";
}
@@ -158,7 +160,8 @@
<div id="listPosition#{clientId}" class="rich-inplace-select-list-position">
<div id="listDecoration#{clientId}" class="rich-inplace-select-list-decoration">
<div id="list#{clientId}" class="rich-inplace-select-list-scroll">
- <f:call name="encodeItems"/>
+ <c:object type="java.util.List" var="items" value="#{this:encodeItems(context,component)}">
+ </c:object>
</div>
</div>
</div>
@@ -179,7 +182,7 @@
};
new Richfaces.InplaceSelect(new Richfaces.InplaceSelectList('list#{clientId}', 'listParent#{clientId}', true,
- Richfaces.InplaceSelect.CLASSES.COMBO_LIST, '#{component.attributes["listWidth"]}', '#{component.attributes["listHeight"]}', #{this:getItemsTextAsJSArray(context, component)}, null,
+ Richfaces.InplaceSelect.CLASSES.COMBO_LIST, '#{component.attributes["listWidth"]}', '#{component.attributes["listHeight"]}', #{this:getItemsTextAsJSArray(context, component,items)}, null,
'#{clientId}inplaceTmpValue', 'shadow#{clientId}', 0, 0, '#{fieldValue}'),
'#{clientId}', '#{clientId}inplaceTmpValue',
'#{clientId}inplaceValue', '#{clientId}tabber',
@@ -203,7 +206,11 @@
</div>
<jsp:scriptlet>
- writer.write(convertToString(variables.getVariable("fieldLabel")));
+ if(isEmptyDefaultLabel(convertToString(variables.getVariable("fieldLabel")))) {
+ writer.write(convertToString(variables.getVariable("fieldLabel")));
+ } else {
+ writer.writeText(convertToString(variables.getVariable("fieldLabel")),null);
+ }
if (layout.equals("block")) {
</jsp:scriptlet>
</div>
17 years, 5 months
JBoss Rich Faces SVN: r7632 - trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-04-07 11:02:59 -0400 (Mon, 07 Apr 2008)
New Revision: 7632
Modified:
trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/Grid.js
Log:
RF-1828
Modified: trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/Grid.js
===================================================================
--- trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/Grid.js 2008-04-07 14:59:13 UTC (rev 7631)
+++ trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/Grid.js 2008-04-07 15:02:59 UTC (rev 7632)
@@ -77,14 +77,22 @@
grid.updateLayout();
grid.getBody().restoreScrollState();
},
- Utils.Condition.ElementPresent(grid.client_id), 100);
+ Utils.Condition.ElementPresent(($(this.getElement().id + ":c")).parentNode), 100);
},
updateLayout: function($super) {
$super();
+ var element = $(this.getElement().id + ":c")
+ var height = element.parentNode.offsetHeight;
+ if (element.offsetHeight != height) {
+ element.setStyle({height: height + "px"});
+ }
if(this.layout) {
this.layout.updateLayout();
}
+ if (element.offsetHeight != height) {
+ element.setStyle({height: height + "px"});
+ }
},
getHeader: function() {
return this.layout.getPane(GridLayout_Enum.HEADER);
17 years, 5 months
JBoss Rich Faces SVN: r7631 - branches/3.1.x/ui/scrollableDataTable/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-04-07 10:59:13 -0400 (Mon, 07 Apr 2008)
New Revision: 7631
Modified:
branches/3.1.x/ui/scrollableDataTable/src/main/config/component/scrollable-data-table.xml
Log:
http://jira.jboss.com/jira/browse/RF-2025
Modified: branches/3.1.x/ui/scrollableDataTable/src/main/config/component/scrollable-data-table.xml
===================================================================
--- branches/3.1.x/ui/scrollableDataTable/src/main/config/component/scrollable-data-table.xml 2008-04-07 14:46:55 UTC (rev 7630)
+++ branches/3.1.x/ui/scrollableDataTable/src/main/config/component/scrollable-data-table.xml 2008-04-07 14:59:13 UTC (rev 7631)
@@ -137,7 +137,7 @@
</description>
</property>
- <property attachedstate="true">
+ <property attachedstate="true" elonly="true" el="true">
<name>sortOrder</name>
<classname>org.richfaces.model.SortOrder</classname>
<description>
@@ -145,7 +145,7 @@
</description>
</property>
- <property attachedstate="true">
+ <property attachedstate="true" elonly="true" el="true">
<name>selection</name>
<classname>org.richfaces.model.selection.Selection</classname>
<description>Value binding representing selected rows</description>
17 years, 5 months
JBoss Rich Faces SVN: r7630 - in trunk/ui/insert/src/main: java/org/ajax4jsf/renderkit and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: vbaranov
Date: 2008-04-07 10:46:55 -0400 (Mon, 07 Apr 2008)
New Revision: 7630
Added:
trunk/ui/insert/src/main/java/org/richfaces/ui/taglib/
trunk/ui/insert/src/main/java/org/richfaces/ui/taglib/InsertTagBase.java
Modified:
trunk/ui/insert/src/main/config/component/insert.xml
trunk/ui/insert/src/main/java/org/ajax4jsf/renderkit/AbstractInsertRenderer.java
trunk/ui/insert/src/main/java/org/richfaces/ui/component/UIInsert.java
Log:
http://jira.jboss.com/jira/browse/RF-2932
Modified: trunk/ui/insert/src/main/config/component/insert.xml
===================================================================
--- trunk/ui/insert/src/main/config/component/insert.xml 2008-04-07 14:01:00 UTC (rev 7629)
+++ trunk/ui/insert/src/main/config/component/insert.xml 2008-04-07 14:46:55 UTC (rev 7630)
@@ -20,10 +20,8 @@
<tag>
<name>insert</name>
<classname>org.richfaces.ui.taglib.InsertTag</classname>
- <superclass>
- org.ajax4jsf.webapp.taglib.HtmlComponentTagBase
- </superclass>
- <test/>
+ <superclass>org.richfaces.ui.taglib.InsertTagBase</superclass>
+ <test />
</tag>
<!--
<taghandler>
@@ -46,6 +44,13 @@
<description>Defines the path to the file with source code</description>
</property>
<property>
+ <name>content</name>
+ <classname>java.lang.String</classname>
+ <description><![CDATA[
+ Defines the String, inserted with this component. This attribute is alternative to "src" attribute.
+ ]]></description>
+ </property>
+ <property>
<name>highlight</name>
<classname>java.lang.String</classname>
<description>Defines a type of code</description>
Modified: trunk/ui/insert/src/main/java/org/ajax4jsf/renderkit/AbstractInsertRenderer.java
===================================================================
--- trunk/ui/insert/src/main/java/org/ajax4jsf/renderkit/AbstractInsertRenderer.java 2008-04-07 14:01:00 UTC (rev 7629)
+++ trunk/ui/insert/src/main/java/org/ajax4jsf/renderkit/AbstractInsertRenderer.java 2008-04-07 14:46:55 UTC (rev 7630)
@@ -3,11 +3,15 @@
*/
package org.ajax4jsf.renderkit;
+import java.io.BufferedInputStream;
+import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
+import java.io.StringBufferInputStream;
+import java.io.StringReader;
import java.io.UnsupportedEncodingException;
import javax.faces.FacesException;
@@ -30,39 +34,51 @@
HeaderResourcesRendererBase {
private static final Object ERROR_MESSAGE_CLASS = "dr-insert-error";
+
+
public void renderContent(FacesContext context, UIInsert component)
throws IOException {
- if (null != component.getSrc()) {
- ExternalContext externalContext = context.getExternalContext();
- InputStream inputStream = externalContext
- .getResourceAsStream(component.getSrc());
- if (null != inputStream) {
- renderStream(context, component, inputStream);
- } else {
- String errorContent = component.getErrorContent();
- if (null != errorContent
- && null != (inputStream = externalContext
- .getResourceAsStream(errorContent))) {
- // Render default content, if src not found.
- renderStream(context, component, inputStream);
- } else {
- // Render error message for a not found resource.
- renderErrorMessage(context, component, "UI_INSERT_RESOURCE_NOT_FOUND");
- }
- }
+ boolean isSrcAvailable = (component.getSrc() != null);
+ boolean isContentAvailable = (component.getContent() != null);
+ if (isSrcAvailable && isContentAvailable) {
+ throw new FacesException(UIInsert.ILLEGAL_ATTRIBUTE_VALUE_MESSAGE);
+ }
+
+ if (isSrcAvailable || isContentAvailable) {
+ ExternalContext externalContext = context.getExternalContext();
+ InputStream inputStream = null;
+
+ if (isSrcAvailable) {
+ inputStream = externalContext.getResourceAsStream(component.getSrc());
+ } else if (isContentAvailable) {
+ inputStream = new ByteArrayInputStream(component.getContent().getBytes());
+ }
+ if (null != inputStream) {
+ renderStream(context, component, inputStream);
} else {
- throw new FacesException(
- "Attribute 'scr' for a component <rich:insert > "
- + component.getClientId(context) + " must be set");
+ String errorContent = component.getErrorContent();
+ if ((null != errorContent)
+ && (null != (inputStream = externalContext.getResourceAsStream(errorContent)))) {
+ // Render default content, if src not found.
+ renderStream(context, component, inputStream);
+ } else {
+ // Render error message for a not found resource.
+ renderErrorMessage(context, component, "UI_INSERT_RESOURCE_NOT_FOUND");
}
+ }
+ } else {
+ throw new FacesException("Attribute 'scr' for a component <rich:insert> " + component.getClientId(context)
+ + " must be set");
+ }
}
/**
* @param context
* @param component
- * @param message TODO
+ * @param message
+ * TODO
* @throws IOException
*/
private void renderErrorMessage(FacesContext context, UIInsert component, String message)
Modified: trunk/ui/insert/src/main/java/org/richfaces/ui/component/UIInsert.java
===================================================================
--- trunk/ui/insert/src/main/java/org/richfaces/ui/component/UIInsert.java 2008-04-07 14:01:00 UTC (rev 7629)
+++ trunk/ui/insert/src/main/java/org/richfaces/ui/component/UIInsert.java 2008-04-07 14:46:55 UTC (rev 7630)
@@ -4,12 +4,6 @@
package org.richfaces.ui.component;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-
-import javax.faces.FacesException;
import javax.faces.component.UIComponentBase;
/**
@@ -18,6 +12,13 @@
*/
public abstract class UIInsert extends UIComponentBase {
+ /**
+ * Message of the Exception thrown in case both "content" and "src"
+ * attributes are set on the page
+ */
+ public static final String ILLEGAL_ATTRIBUTE_VALUE_MESSAGE = "Only one attribute "
+ + "should be set for the <rich:insert> component: either \"content\" or \"src\".";
+
private static final String COMPONENT_TYPE = "org.richfaces.ui.Insert";
private static final String COMPONENT_FAMILY = "org.richfaces.ui.Insert";
@@ -26,7 +27,11 @@
public abstract String getSrc();
public abstract void setSrc(String src);
+
+ public abstract String getContent();
+ public abstract void setContent(String content);
+
public abstract String getHighlight();
public abstract void setHighlight(String highlight);
Added: trunk/ui/insert/src/main/java/org/richfaces/ui/taglib/InsertTagBase.java
===================================================================
--- trunk/ui/insert/src/main/java/org/richfaces/ui/taglib/InsertTagBase.java (rev 0)
+++ trunk/ui/insert/src/main/java/org/richfaces/ui/taglib/InsertTagBase.java 2008-04-07 14:46:55 UTC (rev 7630)
@@ -0,0 +1,124 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.ui.taglib;
+
+import javax.el.ELException;
+import javax.el.ValueExpression;
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+
+import org.ajax4jsf.webapp.taglib.HtmlComponentTagBase;
+import org.richfaces.ui.component.UIInsert;
+
+/**
+ * Abstract base tag class for the <rich:insert> tag.
+ *
+ * @author Vladislav Baranov
+ */
+public abstract class InsertTagBase extends HtmlComponentTagBase {
+
+ /**
+ * Defines the String, inserted with this component.
+ * This attribute is alternative to "src" attribute.
+ */
+ private ValueExpression _content;
+
+ /**
+ * Defines the path to the file with source code
+ */
+ private ValueExpression _src;
+
+ /**
+ * Setter for content
+ *
+ * @param content - new value
+ */
+ public void setContent(ValueExpression __content) {
+ if (this._src == null) {
+ this._content = __content;
+ } else {
+ throw new FacesException(UIInsert.ILLEGAL_ATTRIBUTE_VALUE_MESSAGE);
+ }
+ }
+
+ /**
+ * Defines the path to the file with source code.
+ * Setter for src.
+ *
+ * @param src - new value
+ */
+ public void setSrc(ValueExpression __src) {
+ if (this._content == null) {
+ this._src = __src;
+ } else {
+ throw new FacesException(UIInsert.ILLEGAL_ATTRIBUTE_VALUE_MESSAGE);
+ }
+ }
+
+ public void release() {
+ super.release();
+
+ this._content = null;
+ this._src = null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.components.taglib.html.HtmlCommandButtonTagBase#setProperties(javax.faces.component.UIComponent)
+ */
+ protected void setProperties(UIComponent component) {
+ super.setProperties(component);
+ UIInsert insertComponent = (UIInsert) component;
+
+ if (this._content != null) {
+ if (this._content.isLiteralText()) {
+ try {
+ String __content = (String) getFacesContext().getApplication().getExpressionFactory().coerceToType(
+ this._content.getExpressionString(), String.class);
+
+ insertComponent.setContent(__content);
+ } catch (ELException e) {
+ throw new FacesException(e);
+ }
+ } else {
+ component.setValueExpression("content", this._content);
+ }
+ }
+
+ if (this._src != null) {
+ if (this._src.isLiteralText()) {
+ try {
+ String __src = (String) getFacesContext().getApplication().getExpressionFactory().coerceToType(
+ this._src.getExpressionString(), String.class);
+
+ insertComponent.setSrc(__src);
+ } catch (ELException e) {
+ throw new FacesException(e);
+ }
+ } else {
+ component.setValueExpression("src", this._src);
+ }
+ }
+ }
+
+}
Property changes on: trunk/ui/insert/src/main/java/org/richfaces/ui/taglib/InsertTagBase.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
17 years, 5 months
JBoss Rich Faces SVN: r7629 - in branches/3.1.x/ui/orderingList/src/main: templates/org/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-04-07 10:01:00 -0400 (Mon, 07 Apr 2008)
New Revision: 7629
Modified:
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss
branches/3.1.x/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx
Log:
http://jira.jboss.com/jira/browse/RF-2730
Modified: branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss 2008-04-07 12:33:10 UTC (rev 7628)
+++ branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss 2008-04-07 14:01:00 UTC (rev 7629)
@@ -67,7 +67,7 @@
}
.rich-ordering-list-button-layout {
- padding : 15px 8px 15px 0px;
+ padding : 0px 8px 0px 0px;
}
.rich-ordering-list-button-content {
@@ -105,7 +105,7 @@
.rich-ordering-list-output {
border : 1px solid;
- margin : 0px 8px 8px 8px;
+ margin : 0px 8px 0px 8px;
background: none repeat scroll 0% 50%;
}
Modified: branches/3.1.x/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx 2008-04-07 12:33:10 UTC (rev 7628)
+++ branches/3.1.x/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx 2008-04-07 14:01:00 UTC (rev 7629)
@@ -33,11 +33,39 @@
<table id="#{clientId}table" cellpadding="0" cellspacing="0" class="rich-ordering-list-body">
<tbody>
<tr style="#{this:getCaptionDisplay(context, component)}" >
+ <jsp:scriptlet><![CDATA[
+ String controlsHorizontalAlign = (String) component.getAttributes().get("controlsHorizontalAlign");
+ if ("left".equals(controlsHorizontalAlign)) {
+ ]]></jsp:scriptlet>
+ <td></td>
+ <jsp:scriptlet><![CDATA[
+ }
+ ]]></jsp:scriptlet>
<td colspan="2" class="rich-ordering-list-caption">
<f:call name="encodeCaption"/>
</td>
+ <jsp:scriptlet><![CDATA[
+ if ("right".equals(controlsHorizontalAlign)) {
+ ]]></jsp:scriptlet>
+ <td></td>
+ <jsp:scriptlet><![CDATA[
+ }
+ ]]></jsp:scriptlet>
</tr>
<tr>
+ <jsp:scriptlet><![CDATA[
+ String controlsVerticalAlign = (String) component.getAttributes().get("controlsVerticalAlign");
+ variables.setVariable("controlsVerticalAlign", controlsVerticalAlign);
+ if ("left".equals(controlsHorizontalAlign)) {
+ ]]></jsp:scriptlet>
+ <td class="rich-ordering-list-button-valign" style="vertical-align: #{controlsVerticalAlign}">
+ <div class="rich-ordering-list-button-layout">
+ <f:call name="encodeControlsFacets" />
+ </div>
+ </td>
+ <jsp:scriptlet><![CDATA[
+ }
+ ]]></jsp:scriptlet>
<td>
<div id="#{clientId}headerBox" class="rich-ordering-list-output">
<jsp:scriptlet><![CDATA[
@@ -74,12 +102,19 @@
</div>
</div>
</td>
- <td class="rich-ordering-list-button-valign">
+ <jsp:scriptlet><![CDATA[
+ String controlsHorizontalAlign = (String) component.getAttributes().get("controlsHorizontalAlign");
+ if ("right".equals(controlsHorizontalAlign)) {
+ ]]></jsp:scriptlet>
+ <td class="rich-ordering-list-button-valign" style="vertical-align: #{controlsVerticalAlign}">
<div class="rich-ordering-list-button-layout">
<f:call name="encodeControlsFacets" />
</div>
- <f:clientId var="clientId"/>
</td>
+ <jsp:scriptlet><![CDATA[
+ }
+ ]]></jsp:scriptlet>
+ <f:clientId var="clientId"/>
</tr>
</tbody>
</table>
17 years, 5 months