JBoss Rich Faces SVN: r16580 - in root/ui-sandbox/trunk/components/datascroller/ui/src/main: resources/META-INF/resources/script and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-03-15 14:03:04 -0400 (Mon, 15 Mar 2010)
New Revision: 16580
Modified:
root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/renderkit/DataScrollerBaseRenderer.java
root/ui-sandbox/trunk/components/datascroller/ui/src/main/resources/META-INF/resources/script/datascroller.js
Log:
add submit function
Modified: root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/renderkit/DataScrollerBaseRenderer.java
===================================================================
--- root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/renderkit/DataScrollerBaseRenderer.java 2010-03-15 14:18:52 UTC (rev 16579)
+++ root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/renderkit/DataScrollerBaseRenderer.java 2010-03-15 18:03:04 UTC (rev 16580)
@@ -35,7 +35,11 @@
import javax.faces.render.Renderer;
import org.ajax4jsf.javascript.JSFunction;
-import org.ajax4jsf.renderkit.RendererUtils;
+import org.ajax4jsf.javascript.JSFunctionDefinition;
+import org.ajax4jsf.javascript.JSLiteral;
+import org.ajax4jsf.javascript.JSReference;
+import org.ajax4jsf.renderkit.AjaxEventOptions;
+import org.ajax4jsf.renderkit.AjaxRendererUtils;
import org.ajax4jsf.renderkit.RendererUtils.HTML;
import org.richfaces.component.UIDataScroller;
import org.richfaces.event.DataScrollerEvent;
@@ -68,7 +72,12 @@
}
}
}
+ @Override
+ public void decode(FacesContext context, UIComponent component) {
+ Map <String, String> paramMap = context.getExternalContext().getRequestParameterMap();
+
+ }
public ControlsState getControlsState(FacesContext context, UIComponent component) {
@@ -290,17 +299,30 @@
Map<String, Object> options = new HashMap<String, Object>();
options.put("buttons", buttons);
options.put("digitals", digitals);
-
+ function.addParameter(getSubmitFunction(context, component));
function.addParameter(options);
- writer.writeText(function.toScript(),null);
+ writer.write(function.toString());
}
- public Object getOnClick(FacesContext facesContext, UIComponent component, String string) {
- String id = component.getClientId(facesContext);
- return "RichFaces.Event.callHandlerById('" + id + "', 'rich:datascroller:onscroll', {'page': '" + string + "'});";
+ public JSFunctionDefinition getSubmitFunction(FacesContext facesContext, UIComponent component) {
+ JSFunctionDefinition definition = new JSFunctionDefinition(JSReference.EVENT, new JSReference("element"), new JSReference("data"));
+
+ JSFunction function = AjaxRendererUtils.buildAjaxFunction(facesContext, component, AjaxRendererUtils.AJAX_FUNCTION_NAME);
+ AjaxEventOptions options = AjaxRendererUtils.buildEventOptions(facesContext, component);
+
+ Map<String, Object> parameters = options.getParameters();
+ parameters.put(component.getClientId(facesContext) + ":page", new JSLiteral("data.page"));
+
+ function.addParameter(options);
+
+ StringBuffer buffer = new StringBuffer();
+ function.appendScript(buffer);
+
+ definition.addToBody(buffer);
+ return definition;
}
-
+
public void renderPages(FacesContext context, UIComponent component, int pageIndex, int count) throws IOException {
int currentPage = pageIndex;
@@ -341,12 +363,6 @@
}
return parameters;
}
-
-
- public String getSubmitFunction(FacesContext context, UIComponent component) {
-// TODO: anton - add
- return null;
- }
public boolean getRendersChildren() {
return true;
Modified: root/ui-sandbox/trunk/components/datascroller/ui/src/main/resources/META-INF/resources/script/datascroller.js
===================================================================
--- root/ui-sandbox/trunk/components/datascroller/ui/src/main/resources/META-INF/resources/script/datascroller.js 2010-03-15 14:18:52 UTC (rev 16579)
+++ root/ui-sandbox/trunk/components/datascroller/ui/src/main/resources/META-INF/resources/script/datascroller.js 2010-03-15 18:03:04 UTC (rev 16580)
@@ -2,7 +2,7 @@
richfaces.ui = richfaces.ui || {};
- richfaces.ui.DataScroller = function(id, options) {
+ richfaces.ui.DataScroller = function(id, submit, options) {
$super.constructor.call(this,id);
@@ -11,11 +11,14 @@
var buttons = options.buttons;
var digitals = options.digitals;
+ if (submit && typeof submit == 'function') {
+ RichFaces.Event.bindById(id, this.getScrollEventName(), submit);
+ }
+
var css = {};
if(buttons) {
var leftButtons = buttons.left;
-
css.mouseover = "ds_button ds_left ds_over";
css.mouseup = "ds_button ds_left";
css.mouseout = "ds_button ds_left";
@@ -40,8 +43,6 @@
this.initButtons(digitals,css);
}
-
-
};
var $super = richfaces.BaseComponent.extend(richfaces.BaseComponent, richfaces.ui.DataScroller);
@@ -59,24 +60,32 @@
return eventData;
};
- var processEvents = function(event) {
+ var processStyles = function(event) {
var data = event.data;
if(data) {
-
var element = data.element;
var css = data.css;
- var page = data.page;
-
+
if(element && css) {
element.attr('class', css);
}
-
- if(event.type == 'click') {
+ }
+
+ };
+
+ var processClick = function(event) {
+ var data = event.data;
+
+ if(data) {
+ var page = data.page;
+ if(page) {
this.switchToPage(page);
- }
+ }
}
- };
+ }
+
+ var scrollEventName = "rich:datascroller:onscroll";
return {
@@ -92,7 +101,6 @@
var data = {};
data.component = this;
- data.fn = processEvents;
for(id in buttons) {
@@ -101,10 +109,13 @@
data.id = id;
data.page = buttons[id];
data.element = element;
-
+ data.fn = processClick;
+
element.bind('click', copy(data), fn);
if(css) {
+ data.fn = processStyles;
+
data.css = css.mousedown;
element.bind('mousedown', copy(data), fn);
@@ -118,11 +129,12 @@
element.bind('mouseover', copy(data), fn);
}
}
-
},
switchToPage: function(page) {
- alert(page);
+ if (typeof page != 'undefined' && page != null) {
+ RichFaces.Event.fireById(this.id, this.getScrollEventName(), {'page' : page});
+ }
},
next: function() {
@@ -147,6 +159,10 @@
fastRewind: function() {
this.switchToPage("fastrewind");
+ },
+
+ getScrollEventName: function() {
+ return scrollEventName;
}
}
14 years, 10 months
JBoss Rich Faces SVN: r16578 - root/ui-sandbox/trunk/components.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-03-15 09:53:15 -0400 (Mon, 15 Mar 2010)
New Revision: 16578
Modified:
root/ui-sandbox/trunk/components/pom.xml
Log:
RF-8489 Integrate JSDoc build
Modified: root/ui-sandbox/trunk/components/pom.xml
===================================================================
--- root/ui-sandbox/trunk/components/pom.xml 2010-03-15 13:49:51 UTC (rev 16577)
+++ root/ui-sandbox/trunk/components/pom.xml 2010-03-15 13:53:15 UTC (rev 16578)
@@ -21,4 +21,19 @@
<module>datascroller</module>
</modules>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>gr.abiss.mvn.plugins</groupId>
+ <artifactId>maven-jstools-plugin</artifactId>
+ <version>0.7</version>
+ <configuration>
+ <jsDir>${basedir}/src/main/resources/Meta-inf/resources</jsDir>
+ <includes>**/*.js</includes>
+ <caseSensitive>true</caseSensitive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
14 years, 10 months
JBoss Rich Faces SVN: r16577 - in root: ui/trunk/components and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-03-15 09:49:51 -0400 (Mon, 15 Mar 2010)
New Revision: 16577
Modified:
root/framework/trunk/impl/pom.xml
root/ui/trunk/components/pom.xml
Log:
RF-8489 Integrate JSDoc build
Modified: root/framework/trunk/impl/pom.xml
===================================================================
--- root/framework/trunk/impl/pom.xml 2010-03-13 14:13:26 UTC (rev 16576)
+++ root/framework/trunk/impl/pom.xml 2010-03-15 13:49:51 UTC (rev 16577)
@@ -193,8 +193,59 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>gr.abiss.mvn.plugins</groupId>
+ <artifactId>maven-jstools-plugin</artifactId>
+ <version>0.7</version>
+ <executions>
+ <execution>
+ <id>jsdoc</id>
+ <configuration>
+ <jsDir>${basedir}/src/main/resources/META-INF/resources</jsDir>
+ <includes>**/*.js</includes>
+ <caseSensitive>true</caseSensitive>
+ </configuration>
+ <goals>
+ <goal>jsdoc</goal>
+ </goals>
+ <phase>process-sources</phase>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
</profile>
+ <profile>
+ <id>jsdoc</id>
+ <activation>
+ <property>
+ <name>release</name>
+ </property>
+ </activation>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>gr.abiss.mvn.plugins</groupId>
+ <artifactId>maven-jstools-plugin</artifactId>
+ <version>0.7</version>
+ <executions>
+ <execution>
+ <id>jsdoc</id>
+ <configuration>
+ <jsDir>${basedir}/src/main/resources/META-INF/resources</jsDir>
+ <includes>**/*.js</includes>
+ <caseSensitive>true</caseSensitive>
+ </configuration>
+ <goals>
+ <goal>jsdoc</goal>
+ </goals>
+ <phase>process-sources</phase>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
</profiles>
</project>
\ No newline at end of file
Modified: root/ui/trunk/components/pom.xml
===================================================================
--- root/ui/trunk/components/pom.xml 2010-03-13 14:13:26 UTC (rev 16576)
+++ root/ui/trunk/components/pom.xml 2010-03-15 13:49:51 UTC (rev 16577)
@@ -39,4 +39,18 @@
<module>calendar</module-->
</modules>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>gr.abiss.mvn.plugins</groupId>
+ <artifactId>maven-jstools-plugin</artifactId>
+ <version>0.7</version>
+ <configuration>
+ <jsDir>${basedir}/src/main/resources/Meta-inf/resources</jsDir>
+ <includes>**/*.js</includes>
+ <caseSensitive>true</caseSensitive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
14 years, 10 months
JBoss Rich Faces SVN: r16576 - root/ui-sandbox/trunk/components/datascroller/ui/src/main/resources/META-INF/resources/script.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-03-13 09:13:26 -0500 (Sat, 13 Mar 2010)
New Revision: 16576
Modified:
root/ui-sandbox/trunk/components/datascroller/ui/src/main/resources/META-INF/resources/script/datascroller.js
Log:
remove var with css classes defin
Modified: root/ui-sandbox/trunk/components/datascroller/ui/src/main/resources/META-INF/resources/script/datascroller.js
===================================================================
--- root/ui-sandbox/trunk/components/datascroller/ui/src/main/resources/META-INF/resources/script/datascroller.js 2010-03-13 14:10:48 UTC (rev 16575)
+++ root/ui-sandbox/trunk/components/datascroller/ui/src/main/resources/META-INF/resources/script/datascroller.js 2010-03-13 14:13:26 UTC (rev 16576)
@@ -48,21 +48,7 @@
jQuery.extend(richfaces.ui.DataScroller.prototype, (function (options) {
- var button_right_css = "ds_button ds_right";
- var button_left_css = "ds_button ds_left"
-
- var button_right_over_css = "ds_button ds_right ds_over";
- var button_left_over_css = "ds_button ds_left ds_over";
-
- var button_right_press_css = "ds_button ds_right ds_over";
- var button_left_press_css = "ds_button ds_left ds_over";
-
- var digital_css = "ds_digital";
- var digital_over_css = "ds_digital ds_over";
- var digital_press_css = "ds_digital ds_press";
-
-
- var copy = function(data) {
+ var copy = function(data) {
var key;
var eventData = {};
14 years, 10 months
JBoss Rich Faces SVN: r16575 - root/ui-sandbox/trunk/components/datascroller/ui/src/main/resources/META-INF/resources/script.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-03-13 09:10:48 -0500 (Sat, 13 Mar 2010)
New Revision: 16575
Modified:
root/ui-sandbox/trunk/components/datascroller/ui/src/main/resources/META-INF/resources/script/datascroller.js
Log:
add events processing
Modified: root/ui-sandbox/trunk/components/datascroller/ui/src/main/resources/META-INF/resources/script/datascroller.js
===================================================================
--- root/ui-sandbox/trunk/components/datascroller/ui/src/main/resources/META-INF/resources/script/datascroller.js 2010-03-13 14:09:37 UTC (rev 16574)
+++ root/ui-sandbox/trunk/components/datascroller/ui/src/main/resources/META-INF/resources/script/datascroller.js 2010-03-13 14:10:48 UTC (rev 16575)
@@ -3,36 +3,141 @@
richfaces.ui = richfaces.ui || {};
richfaces.ui.DataScroller = function(id, options) {
- $super.constructor.call(this);
+
+ $super.constructor.call(this,id);
- this.id = id;
- this.options = options;
+ this.options = options;
+
+ var buttons = options.buttons;
+ var digitals = options.digitals;
- RichFaces.Event.bindById(this.id, 'rich:datascroller:onscroll', this.submitFunction, this);
+ var css = {};
- this.init(options);
+ if(buttons) {
+ var leftButtons = buttons.left;
+
+ css.mouseover = "ds_button ds_left ds_over";
+ css.mouseup = "ds_button ds_left";
+ css.mouseout = "ds_button ds_left";
+ css.mousedown = "ds_button ds_left ds_over";
+
+ this.initButtons(leftButtons,css);
+
+ var rightButtons = buttons.right;
+ css.mouseover = "ds_button ds_right ds_over";
+ css.mouseup = "ds_button ds_right";
+ css.mouseout = "ds_button ds_right";
+ css.mousedown = "ds_button ds_right ds_over";
+
+ this.initButtons(rightButtons,css);
+ }
+
+ if(digitals) {
+ css.mouseover= "ds_digital ds_over";
+ css.mouseup= "ds_digital ds_over";
+ css.mouseout = "ds_digital";
+ css.mousedown="ds_digital ds_press";
+
+ this.initButtons(digitals,css);
+ }
+
+
};
-
-
var $super = richfaces.BaseComponent.extend(richfaces.BaseComponent, richfaces.ui.DataScroller);
jQuery.extend(richfaces.ui.DataScroller.prototype, (function (options) {
+
+ var button_right_css = "ds_button ds_right";
+ var button_left_css = "ds_button ds_left"
+
+ var button_right_over_css = "ds_button ds_right ds_over";
+ var button_left_over_css = "ds_button ds_left ds_over";
-
+ var button_right_press_css = "ds_button ds_right ds_over";
+ var button_left_press_css = "ds_button ds_left ds_over";
+
+ var digital_css = "ds_digital";
+ var digital_over_css = "ds_digital ds_over";
+ var digital_press_css = "ds_digital ds_press";
+
+
+ var copy = function(data) {
+ var key;
+ var eventData = {};
+
+ for (key in data) {
+ eventData[key] = data[key];
+ }
+
+ return eventData;
+ };
+
+ var processEvents = function(event) {
+ var data = event.data;
+
+ if(data) {
+
+ var element = data.element;
+ var css = data.css;
+ var page = data.page;
+
+ if(element && css) {
+ element.attr('class', css);
+ }
+
+ if(event.type == 'click') {
+ this.switchToPage(page);
+ }
+ }
+ };
+
return {
name: "RichFaces.ui.DataScroller",
-
- submitFunction: function(event) {
- alert(test);
+
+ initButtons: function(buttons, css) {
+
+ var id;
+
+ var fn = function(e) {
+ e.data.fn.call(e.data.component, e, this);
+ }
+
+ var data = {};
+ data.component = this;
+ data.fn = processEvents;
+
+ for(id in buttons) {
+
+ var element = jQuery(document.getElementById(id));
+
+ data.id = id;
+ data.page = buttons[id];
+ data.element = element;
+
+ element.bind('click', copy(data), fn);
+
+ if(css) {
+ data.css = css.mousedown;
+ element.bind('mousedown', copy(data), fn);
+
+ data.css = css.mouseup;
+ element.bind('mouseup', copy(data), fn);
+
+ data.css = css.mouseout;
+ element.bind('mouseout', copy(data), fn);
+
+ data.css = css.mouseover;
+ element.bind('mouseover', copy(data), fn);
+ }
+ }
+
},
switchToPage: function(page) {
- if (typeof page != 'undefined' && page != null) {
- RichFaces.Event.callHandlerById(this.id, 'rich:datascroller:onscroll', {'page': page});
- }
- },
+ alert(page);
+ },
next: function() {
this.switchToPage("next");
@@ -57,7 +162,7 @@
fastRewind: function() {
this.switchToPage("fastrewind");
}
- }
+ }
})());
14 years, 10 months
JBoss Rich Faces SVN: r16574 - in root/ui-sandbox/trunk/components/datascroller/ui/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-03-13 09:09:37 -0500 (Sat, 13 Mar 2010)
New Revision: 16574
Modified:
root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/renderkit/DataScrollerBaseRenderer.java
root/ui-sandbox/trunk/components/datascroller/ui/src/main/templates/datascroller.template.xml
Log:
remove inline javascript, add encode id on DS controls
Modified: root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/renderkit/DataScrollerBaseRenderer.java
===================================================================
--- root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/renderkit/DataScrollerBaseRenderer.java 2010-03-12 20:02:03 UTC (rev 16573)
+++ root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/renderkit/DataScrollerBaseRenderer.java 2010-03-13 14:09:37 UTC (rev 16574)
@@ -195,6 +195,8 @@
start = 0;
}
+ String clientId = component.getClientId(context);
+
for (int i = start, size = start + pages; i < size; i++) {
boolean isCurrentPage = (i + 1 == currentPage);
@@ -219,13 +221,14 @@
out.writeAttribute(HTML.CLASS_ATTRIBUTE, "ds_digital ds_current "+styleClass, null);
} else {
out.writeAttribute(HTML.CLASS_ATTRIBUTE, "ds_digital "+styleClass, null);
-
+ /*
out.writeAttribute(HTML.ONMOUSEOVER_ATTRIBUTE, "this.className='ds_digital ds_over'", null);
out.writeAttribute(HTML.ONMOUSEOUT_ATTRIBUTE, "this.className='ds_digital'", null);
out.writeAttribute(HTML.ONMOUSEUP_ATTRIBUTE, "this.className='ds_digital ds_over'", null);
out.writeAttribute(HTML.ONMOUSEDOWN_ATTRIBUTE, "this.className='ds_digital ds_press'", null);
out.writeAttribute(HTML.ONCLICK_ATTRIBUTE, getOnClick(context, component, Integer.toString(i + 1)), null);
+ */
}
if (null != style) {
@@ -233,45 +236,60 @@
}
String page = Integer.toString(i + 1);
+ String id = clientId+ "_ds_" + page;
+ out.writeAttribute(HTML.ID_ATTRIBUTE,id, null);
+ digital.put(id, page);
out.writeText(page, null);
- digital.put("ds_" + page, page);
+
out.endElement(HTML.SPAN_ELEM);
}
return digital;
}
- public Map<String, String> getControls(FacesContext context, UIComponent component, ControlsState controlsState) {
+ public Map<String, Map<String,String>> getControls(FacesContext context, UIComponent component, ControlsState controlsState) {
//will be refactored
- Map<String, String> controls = new HashMap<String, String>();
+ Map<String, Map<String, String>> controls = new HashMap<String, Map<String,String>>();
+ Map<String, String> right = new HashMap<String, String>();
+ Map<String, String> left = new HashMap<String, String>();
+ String clientId = component.getClientId(context);
+
if(controlsState.getFirstRendered() && controlsState.getFirstEnabled()) {
- controls.put("ds_f", "first");
+
+ left.put(clientId + "_ds_f", "first");
}
if(controlsState.getFastRewindRendered()&& controlsState.getFastRewindEnabled()) {
- controls.put("ds_fr", "fastRewind");
+ left.put(clientId + "_ds_fr", "fastRewind");
}
if(controlsState.getFastForwardRendered()&& controlsState.getFastForwardEnabled()) {
- controls.put("ds_ff", "fastForward");
+ right.put(clientId + "_ds_ff", "fastForward");
}
if(controlsState.getLastRendered()&& controlsState.getLastEnabled()) {
- controls.put("ds_l", "last");
+ right.put(clientId + "_ds_l", "last");
}
+ if(!left.isEmpty()) {
+ controls.put("left", left);
+ }
+
+ if(!right.isEmpty()) {
+ controls.put("right", right);
+ }
return controls;
}
- public void buildScript(ResponseWriter writer, FacesContext context, UIComponent component, Map buttons, Map controls) throws IOException {
+ public void buildScript(ResponseWriter writer, FacesContext context, UIComponent component, Map buttons, Map digitals) throws IOException {
JSFunction function = new JSFunction("new RichFaces.ui.DataScroller");
function.addParameter(component.getClientId(context));
Map<String, Object> options = new HashMap<String, Object>();
options.put("buttons", buttons);
- options.put("controls", controls);
+ options.put("digitals", digitals);
function.addParameter(options);
Modified: root/ui-sandbox/trunk/components/datascroller/ui/src/main/templates/datascroller.template.xml
===================================================================
--- root/ui-sandbox/trunk/components/datascroller/ui/src/main/templates/datascroller.template.xml 2010-03-12 20:02:03 UTC (rev 16573)
+++ root/ui-sandbox/trunk/components/datascroller/ui/src/main/templates/datascroller.template.xml 2010-03-13 14:09:37 UTC (rev 16574)
@@ -20,12 +20,12 @@
<c:if test="#{controlsState.firstRendered}">
<c:choose>
<c:when test="#{controlsState.firstEnabled}">
- <span class="ds_button ds_left" onmousedown="this.className='ds_button ds_left ds_over'" onmouseup="this.className='ds_button ds_left'" onmouseout="this.className='ds_button ds_left'" onclick="#{getOnClick(facesContext, component, 'first')}">
+ <span id="#{clientId}_ds_f" class="ds_button ds_left" >
««
</span>
</c:when>
<c:otherwise>
- <span class="ds_button ds_left ds_disabled">
+ <span id="#{clientId}_ds_f" class="ds_button ds_left ds_disabled">
««
</span>
</c:otherwise>
@@ -36,29 +36,29 @@
<c:if test="#{controlsState.fastRewindRendered}">
<c:choose>
<c:when test="#{controlsState.fastRewindEnabled}">
- <span class="ds_button ds_left" onmousedown="this.className='ds_button ds_left ds_over'" onmouseup="this.className='ds_button ds_left'" onmouseout="this.className='ds_button ds_left'" onclick="#{getOnClick(facesContext, component, 'fastRewind')}">
+ <span id="#{clientId}_ds_fr" class="ds_button ds_left">
«
</span>
</c:when>
<c:otherwise>
- <span class="ds_button ds_left ds_disabled">
+ <span id="#{clientId}_ds_fr" class="ds_button ds_left ds_disabled">
«
</span>
</c:otherwise>
</c:choose>
</c:if>
- <cdk:object type="java.util.Map" name="buttons" value="#{renderPager(responseWriter, facesContext, component)}" />
+ <cdk:object type="java.util.Map" name="digitals" value="#{renderPager(responseWriter, facesContext, component)}" />
<c:if test="#{controlsState.fastForwardRendered}">
<c:choose>
<c:when test="#{controlsState.fastForwardEnabled}">
- <span class="ds_button ds_right" onmousedown="this.className='ds_button ds_right ds_over'" onmouseup="this.className='ds_button ds_right'" onmouseout="this.className='ds_button ds_right'" onclick="#{getOnClick(facesContext, component, 'fastForward')}">
+ <span id="#{clientId}_ds_ff" class="ds_button ds_right">
»
</span>
</c:when>
<c:otherwise>
- <span class="ds_button ds_right ds_disabled">
+ <span id="#{clientId}_ds_ff" class="ds_button ds_right ds_disabled">
»
</span>
</c:otherwise>
@@ -68,12 +68,12 @@
<c:if test="#{controlsState.lastRendered}">
<c:choose>
<c:when test="#{controlsState.lastEnabled}">
- <span class="ds_button ds_right" onmousedown="this.className='ds_button ds_right ds_over'" onmouseup="this.className='ds_button ds_right'" onmouseout="this.className='ds_button ds_right'" onclick="#{getOnClick(facesContext, component, 'last')}">
+ <span id="#{clientId}_ds_l" class="ds_button ds_right">
»»
</span>
</c:when>
<c:otherwise>
- <span class="ds_button ds_right ds_disabled">
+ <span id="#{clientId}_ds_l" class="ds_button ds_right ds_disabled">
»»
</span>
</c:otherwise>
@@ -81,10 +81,10 @@
</c:if>
</span>
- <cdk:object type="java.util.Map" name="controls" value="#{getControls(facesContext, component, controlsState)}" />
+ <cdk:object type="java.util.Map" name="buttons" value="#{getControls(facesContext, component, controlsState)}" />
<script type="text/javascript">
- <cdk:call expression="buildScript(responseWriter, facesContext, component, buttons, controls);"/>
+ <cdk:call expression="buildScript(responseWriter, facesContext, component, buttons, digitals);"/>
</script>
</cc:implementation>
</cdk:root>
\ No newline at end of file
14 years, 10 months
JBoss Rich Faces SVN: r16573 - branches/community/3.3.X/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2010-03-12 15:02:03 -0500 (Fri, 12 Mar 2010)
New Revision: 16573
Modified:
branches/community/3.3.X/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
Log:
RF-8368
Modified: branches/community/3.3.X/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
===================================================================
--- branches/community/3.3.X/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2010-03-12 19:59:36 UTC (rev 16572)
+++ branches/community/3.3.X/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2010-03-12 20:02:03 UTC (rev 16573)
@@ -1362,7 +1362,7 @@
//this.getElement().oncontextmenu = oncontextmenu;
//this.getIcon().oncontextmenu = oncontextmenu;
- this.getLabel().oncontextmenu = oncontextmenu;
+ //this.getLabel().oncontextmenu = oncontextmenu;
var binding = new RichFaces.Menu.Layer.Binding(id, "mouseover",
this.onmouseover.bindAsEventListener(this));
14 years, 10 months
JBoss Rich Faces SVN: r16572 - in root/ui-sandbox/trunk/components/tables/ui/src: test/java/org/richfaces/component and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-03-12 14:59:36 -0500 (Fri, 12 Mar 2010)
New Revision: 16572
Added:
root/ui-sandbox/trunk/components/tables/ui/src/test/java/org/richfaces/component/UIColumnTest.java
Modified:
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIColumn.java
Log:
RF-8118 RF-8119 unit test
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIColumn.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIColumn.java 2010-03-12 19:48:31 UTC (rev 16571)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIColumn.java 2010-03-12 19:59:36 UTC (rev 16572)
@@ -41,7 +41,7 @@
}
public SortOrder getSortOrder() {
- return (SortOrder) getStateHelper().eval(PropertyKeys.sortOrder);
+ return (SortOrder) getStateHelper().eval(PropertyKeys.sortOrder, SortOrder.UNSORTED);
}
public void setFilter(Filter<?> filter) {
Added: root/ui-sandbox/trunk/components/tables/ui/src/test/java/org/richfaces/component/UIColumnTest.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/test/java/org/richfaces/component/UIColumnTest.java (rev 0)
+++ root/ui-sandbox/trunk/components/tables/ui/src/test/java/org/richfaces/component/UIColumnTest.java 2010-03-12 19:59:36 UTC (rev 16572)
@@ -0,0 +1,180 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.richfaces.component;
+
+import static org.easymock.EasyMock.expect;
+
+import java.util.Comparator;
+
+import javax.el.ValueExpression;
+import javax.swing.SortOrder;
+
+import junit.framework.Assert;
+
+import org.jboss.test.faces.mock.MockFacesEnvironment;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.richfaces.model.Filter;
+import org.richfaces.model.FilterField;
+import org.richfaces.model.SortField;
+
+/**
+ * @author Konstantin Mishin
+ *
+ */
+public class UIColumnTest {
+
+ private MockFacesEnvironment environment;
+ private UIColumn column;
+ /**
+ * @throws java.lang.Exception
+ */
+ @Before
+ public void setUp() throws Exception {
+ environment = MockFacesEnvironment.createEnvironment();
+ column = new UIColumn();
+ }
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @After
+ public void tearDown() throws Exception {
+ environment.verify();
+ environment.release();
+ environment = null;
+ column = null;
+ }
+
+ /**
+ * Test method for {@link org.richfaces.component.UIColumn#setSortOrder(javax.swing.SortOrder)} and
+ * {@link org.richfaces.component.UIColumn#getSortOrder()}.
+ */
+ @Test
+ public final void testSortOrder() {
+ Assert.assertEquals(SortOrder.UNSORTED, column.getSortOrder());
+ column.setSortOrder(SortOrder.ASCENDING);
+ Assert.assertEquals(SortOrder.ASCENDING, column.getSortOrder());
+ environment.replay();
+ }
+
+ /**
+ * Test method for {@link org.richfaces.component.UIColumn#setFilter(org.richfaces.model.Filter)} and
+ * {@link org.richfaces.component.UIColumn#getFilter()}.
+ */
+ @Test
+ public final void testFilter() {
+ Assert.assertNull(column.getFilter());
+ Filter<?> filter = new Filter<Object>() {
+ @Override
+ public boolean accept(Object t) {
+ return false;
+ }
+ };
+ column.setFilter(filter);
+ Assert.assertSame(filter, column.getFilter());
+ environment.replay();
+ }
+
+ /**
+ * Test method for {@link org.richfaces.component.UIColumn#setFilterValue(java.lang.Object)} and
+ * {@link org.richfaces.component.UIColumn#getFilterValue()}.
+ */
+ @Test
+ public final void testFilterValue() {
+ Assert.assertNull(column.getFilterValue());
+ Object object = new Object();
+ column.setFilterValue(object);
+ Assert.assertEquals(object, column.getFilterValue());
+ environment.replay();
+ }
+
+ /**
+ * Test method for {@link org.richfaces.component.UIColumn#setComparator(java.util.Comparator)} and
+ * {@link org.richfaces.component.UIColumn#getComparator()}.
+ */
+ @Test
+ public final void testComparator() {
+ Assert.assertNull(column.getComparator());
+ Comparator<?> comparator = new Comparator<Object>() {
+ @Override
+ public int compare(Object o1, Object o2) {
+ return 0;
+ }
+ };
+ column.setComparator(comparator);
+ Assert.assertSame(comparator, column.getComparator());
+ environment.replay();
+ }
+
+ /**
+ * Test method for {@link org.richfaces.component.UIColumn#getFilterField()}.
+ */
+ @Test
+ public final void testGetFilterField() {
+ Assert.assertNull(column.getFilterField());
+ ValueExpression expression = environment.createMock(ValueExpression.class);
+ expect(expression.isLiteralText()).andStubReturn(false);
+ environment.replay();
+ Filter<?> filter = new Filter<Object>() {
+ @Override
+ public boolean accept(Object t) {
+ return false;
+ }
+ };
+ Object object = new Object();
+ column.setValueExpression("filterExpression", expression);
+ column.setFilter(filter);
+ column.setFilterValue(object);
+ FilterField filterField = column.getFilterField();
+ Assert.assertEquals(expression, filterField.getFilterExpression());
+ Assert.assertSame(filter, filterField.getFilter());
+ Assert.assertEquals(object, filterField.getFilterValue());
+ }
+
+ /**
+ * Test method for {@link org.richfaces.component.UIColumn#getSortField()}.
+ */
+ @Test
+ public final void testGetSortField() {
+ Assert.assertNull(column.getSortField());
+ ValueExpression expression = environment.createMock(ValueExpression.class);
+ expect(expression.isLiteralText()).andStubReturn(false);
+ environment.replay();
+ Comparator<?> comparator = new Comparator<Object>() {
+ @Override
+ public int compare(Object o1, Object o2) {
+ return 0;
+ }
+ };
+ column.setSortOrder(SortOrder.ASCENDING);
+ column.setValueExpression("sortBy", expression);
+ column.setComparator(comparator);
+ SortField sortField = column.getSortField();
+ Assert.assertEquals(SortOrder.ASCENDING, sortField.getSortOrder());
+ Assert.assertEquals(expression, sortField.getSortBy());
+ Assert.assertSame(comparator, sortField.getComparator());
+ }
+
+}
14 years, 10 months
JBoss Rich Faces SVN: r16571 - branches/community/3.3.X/samples/richfaces-demo.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2010-03-12 14:48:31 -0500 (Fri, 12 Mar 2010)
New Revision: 16571
Modified:
branches/community/3.3.X/samples/richfaces-demo/pom.xml
Log:
RF-8465
Modified: branches/community/3.3.X/samples/richfaces-demo/pom.xml
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/pom.xml 2010-03-12 19:47:58 UTC (rev 16570)
+++ branches/community/3.3.X/samples/richfaces-demo/pom.xml 2010-03-12 19:48:31 UTC (rev 16571)
@@ -351,6 +351,10 @@
<artifactId>servlet-api</artifactId>
<groupId>javax.servlet</groupId>
</exclusion>
+ <exclusion>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam-jul</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
@@ -402,6 +406,10 @@
<artifactId>jsf-impl</artifactId>
<groupId>javax.faces</groupId>
</exclusion>
+ <exclusion>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam-jul</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
@@ -417,6 +425,10 @@
<artifactId>jsf-impl</artifactId>
<groupId>javax.faces</groupId>
</exclusion>
+ <exclusion>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam-jul</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
14 years, 10 months
JBoss Rich Faces SVN: r16570 - branches/community/3.3.X/samples/richfaces-demo/src/main/java/org/richfaces/demo/modifiableModel.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2010-03-12 14:47:58 -0500 (Fri, 12 Mar 2010)
New Revision: 16570
Modified:
branches/community/3.3.X/samples/richfaces-demo/src/main/java/org/richfaces/demo/modifiableModel/BaseModifiableHibernateDataModel.java
Log:
RF-8466
Modified: branches/community/3.3.X/samples/richfaces-demo/src/main/java/org/richfaces/demo/modifiableModel/BaseModifiableHibernateDataModel.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/src/main/java/org/richfaces/demo/modifiableModel/BaseModifiableHibernateDataModel.java 2010-03-12 15:57:39 UTC (rev 16569)
+++ branches/community/3.3.X/samples/richfaces-demo/src/main/java/org/richfaces/demo/modifiableModel/BaseModifiableHibernateDataModel.java 2010-03-12 19:47:58 UTC (rev 16570)
@@ -146,7 +146,9 @@
Criteria criteria = createCriteria();
appendFilters(FacesContext.getCurrentInstance(), criteria);
criteria.setProjection(Projections.rowCount());
- return ((Integer)criteria.list().get(0)).intValue();
+ //There are cast to Number object, related to http://opensource.atlassian.com/projects/hibernate/browse/HHH-3497.
+ //Such kind of implementation should work undependent on what Hibernate library version used.
+ return ((Number)criteria.list().get(0)).intValue();
}
@Override
14 years, 10 months