JBoss Rich Faces SVN: r16834 - branches/enterprise/3.3.X/framework/impl/src/main/java/org/ajax4jsf/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-04-28 18:53:10 -0400 (Wed, 28 Apr 2010)
New Revision: 16834
Modified:
branches/enterprise/3.3.X/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java
Log:
https://jira.jboss.org/jira/browse/RFPL-526
Modified: branches/enterprise/3.3.X/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java
===================================================================
--- branches/enterprise/3.3.X/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java 2010-04-28 18:23:52 UTC (rev 16833)
+++ branches/enterprise/3.3.X/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java 2010-04-28 22:53:10 UTC (rev 16834)
@@ -1487,6 +1487,39 @@
private SerializableDataModel model;
}
+ private Map<String, Map<String, SavedState>> createChildStateCopy(
+ Map<String, Map<String, SavedState>> originalChildState) {
+ Map<String, Map<String, SavedState>> copiedChildState = null;
+
+ if (originalChildState != null) {
+ int originalMapSize = originalChildState.size();
+
+ // formula copied from HashMap implementation code
+ int copiedMapCapacity = Math.max(
+ (int) (originalMapSize / 0.75) + 1, 16);
+
+ copiedChildState = new HashMap<String, Map<String, SavedState>>(
+ copiedMapCapacity);
+
+ for (Entry<String, Map<String, SavedState>> entry : originalChildState
+ .entrySet()) {
+ String entryKey = entry.getKey();
+ Map<String, SavedState> entryValue = entry.getValue();
+
+ Map<String, SavedState> copiedEntryValue = null;
+
+ if (entryValue != null) {
+ copiedEntryValue = new HashMap<String, SavedState>(
+ entryValue);
+ }
+
+ copiedChildState.put(entryKey, copiedEntryValue);
+ }
+ }
+
+ return copiedChildState;
+ }
+
public void restoreState(FacesContext faces, Object object) {
DataState state = (DataState) object;
super.restoreState(faces, state.superState);
@@ -1494,7 +1527,7 @@
this._statesMap = new HashMap<String, DataComponentState>();
this._rowKeyVar = state.rowKeyVar;
this._stateVar = state.stateVar;
- this.childState = state.childStates;
+ this.childState = createChildStateCopy(state.childStates);
if (null != state.rowKeyConverter) {
this._rowKeyConverter = (Converter) restoreAttachedState(faces,
state.rowKeyConverter);
14 years, 8 months
JBoss Rich Faces SVN: r16833 - in branches/enterprise/3.3.X/framework/impl/src/main/java/org/ajax4jsf: webapp and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-04-28 14:23:52 -0400 (Wed, 28 Apr 2010)
New Revision: 16833
Modified:
branches/enterprise/3.3.X/framework/impl/src/main/java/org/ajax4jsf/request/FileParam.java
branches/enterprise/3.3.X/framework/impl/src/main/java/org/ajax4jsf/request/MultipartRequest.java
branches/enterprise/3.3.X/framework/impl/src/main/java/org/ajax4jsf/webapp/BaseFilter.java
Log:
RFPL-548
Modified: branches/enterprise/3.3.X/framework/impl/src/main/java/org/ajax4jsf/request/FileParam.java
===================================================================
--- branches/enterprise/3.3.X/framework/impl/src/main/java/org/ajax4jsf/request/FileParam.java 2010-04-28 18:15:37 UTC (rev 16832)
+++ branches/enterprise/3.3.X/framework/impl/src/main/java/org/ajax4jsf/request/FileParam.java 2010-04-28 18:23:52 UTC (rev 16833)
@@ -81,10 +81,14 @@
return fileSize;
}
- public File createTempFile() {
+ public File createTempFile(String tempFilesDirectory) {
try {
+ File dir = null;
+ if (tempFilesDirectory != null) {
+ dir = new File(tempFilesDirectory);
+ }
tempFile = File.createTempFile(new UID().toString().replace(
- ":", "-"), ".upload");
+ ":", "-"), ".upload", dir);
fOut = new FileOutputStream(tempFile);
} catch (IOException ex) {
if (fOut != null) {
Modified: branches/enterprise/3.3.X/framework/impl/src/main/java/org/ajax4jsf/request/MultipartRequest.java
===================================================================
--- branches/enterprise/3.3.X/framework/impl/src/main/java/org/ajax4jsf/request/MultipartRequest.java 2010-04-28 18:15:37 UTC (rev 16832)
+++ branches/enterprise/3.3.X/framework/impl/src/main/java/org/ajax4jsf/request/MultipartRequest.java 2010-04-28 18:23:52 UTC (rev 16833)
@@ -69,6 +69,8 @@
private boolean createTempFiles;
+ private String tempFilesDirectory;
+
private String uid;
private String encoding = null;
@@ -106,10 +108,11 @@
private boolean shouldStop = false;
private boolean canceled;
- public MultipartRequest(HttpServletRequest request,
- boolean createTempFiles, int maxRequestSize, String uid) {
+ public MultipartRequest(HttpServletRequest request, boolean createTempFiles,
+ String tempFilesDirectory, int maxRequestSize, String uid) {
super(request);
this.createTempFiles = createTempFiles;
+ this.tempFilesDirectory = tempFilesDirectory;
this.uid = uid;
String contentLength = request.getHeader("Content-Length");
@@ -227,7 +230,7 @@
this.keys.add(paramName);
if (createTempFiles) {
- fp.createTempFile();
+ fp.createTempFile(tempFilesDirectory);
}
fp.setContentType(headers.get(PARAM_CONTENT_TYPE));
fp.setFilename(decodeFileName(headers.get(PARAM_FILENAME)));
Modified: branches/enterprise/3.3.X/framework/impl/src/main/java/org/ajax4jsf/webapp/BaseFilter.java
===================================================================
--- branches/enterprise/3.3.X/framework/impl/src/main/java/org/ajax4jsf/webapp/BaseFilter.java 2010-04-28 18:15:37 UTC (rev 16832)
+++ branches/enterprise/3.3.X/framework/impl/src/main/java/org/ajax4jsf/webapp/BaseFilter.java 2010-04-28 18:23:52 UTC (rev 16833)
@@ -126,6 +126,8 @@
*/
private boolean createTempFiles = false;
+ private String tempFilesDirectory;
+
/**
* The maximum size of a file upload request. 0 means no limit.
*/
@@ -179,6 +181,9 @@
} else {
this.createTempFiles = true;
}
+
+ this.tempFilesDirectory = filterConfig.getInitParameter("tempFilesDirectory");
+
param = filterConfig.getInitParameter("maxRequestSize");
if (param != null) {
this.maxRequestSize = Integer.parseInt(param);
@@ -323,7 +328,7 @@
if (uid != null) {
if (isMultipartRequest(httpRequest)) {
- MultipartRequest multipartRequest = new MultipartRequest(httpRequest, createTempFiles, maxRequestSize, uid);
+ MultipartRequest multipartRequest = new MultipartRequest(httpRequest, createTempFiles, tempFilesDirectory, maxRequestSize, uid);
Object oldAttributeValue = httpRequest.getAttribute(FileUploadConstants.FILE_UPLOAD_REQUEST_ATTRIBUTE_NAME);
httpRequest.setAttribute(FileUploadConstants.FILE_UPLOAD_REQUEST_ATTRIBUTE_NAME, multipartRequest);
14 years, 8 months
JBoss Rich Faces SVN: r16832 - in branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf: webapp and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-04-28 14:15:37 -0400 (Wed, 28 Apr 2010)
New Revision: 16832
Modified:
branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/request/FileParam.java
branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/request/MultipartRequest.java
branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/webapp/BaseFilter.java
Log:
RF-6525
Modified: branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/request/FileParam.java
===================================================================
--- branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/request/FileParam.java 2010-04-28 17:40:24 UTC (rev 16831)
+++ branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/request/FileParam.java 2010-04-28 18:15:37 UTC (rev 16832)
@@ -81,10 +81,14 @@
return fileSize;
}
- public File createTempFile() {
+ public File createTempFile(String tempFilesDirectory) {
try {
+ File dir = null;
+ if (tempFilesDirectory != null) {
+ dir = new File(tempFilesDirectory);
+ }
tempFile = File.createTempFile(new UID().toString().replace(
- ":", "-"), ".upload");
+ ":", "-"), ".upload", dir);
fOut = new FileOutputStream(tempFile);
} catch (IOException ex) {
if (fOut != null) {
Modified: branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/request/MultipartRequest.java
===================================================================
--- branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/request/MultipartRequest.java 2010-04-28 17:40:24 UTC (rev 16831)
+++ branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/request/MultipartRequest.java 2010-04-28 18:15:37 UTC (rev 16832)
@@ -69,6 +69,8 @@
private boolean createTempFiles;
+ private String tempFilesDirectory;
+
private String uid;
private String encoding = null;
@@ -106,10 +108,11 @@
private boolean shouldStop = false;
private boolean canceled;
- public MultipartRequest(HttpServletRequest request,
- boolean createTempFiles, int maxRequestSize, String uid) {
+ public MultipartRequest(HttpServletRequest request, boolean createTempFiles,
+ String tempFilesDirectory, int maxRequestSize, String uid) {
super(request);
this.createTempFiles = createTempFiles;
+ this.tempFilesDirectory = tempFilesDirectory;
this.uid = uid;
String contentLength = request.getHeader("Content-Length");
@@ -227,7 +230,7 @@
this.keys.add(paramName);
if (createTempFiles) {
- fp.createTempFile();
+ fp.createTempFile(tempFilesDirectory);
}
fp.setContentType(headers.get(PARAM_CONTENT_TYPE));
fp.setFilename(decodeFileName(headers.get(PARAM_FILENAME)));
Modified: branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/webapp/BaseFilter.java
===================================================================
--- branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/webapp/BaseFilter.java 2010-04-28 17:40:24 UTC (rev 16831)
+++ branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/webapp/BaseFilter.java 2010-04-28 18:15:37 UTC (rev 16832)
@@ -126,6 +126,8 @@
*/
private boolean createTempFiles = false;
+ private String tempFilesDirectory;
+
/**
* The maximum size of a file upload request. 0 means no limit.
*/
@@ -179,6 +181,9 @@
} else {
this.createTempFiles = true;
}
+
+ this.tempFilesDirectory = filterConfig.getInitParameter("tempFilesDirectory");
+
param = filterConfig.getInitParameter("maxRequestSize");
if (param != null) {
this.maxRequestSize = Integer.parseInt(param);
@@ -343,7 +348,7 @@
if (uid != null) {
if (isMultipartRequest(httpRequest)) {
- MultipartRequest multipartRequest = new MultipartRequest(httpRequest, createTempFiles, maxRequestSize, uid);
+ MultipartRequest multipartRequest = new MultipartRequest(httpRequest, createTempFiles, tempFilesDirectory, maxRequestSize, uid);
Object oldAttributeValue = httpRequest.getAttribute(FileUploadConstants.FILE_UPLOAD_REQUEST_ATTRIBUTE_NAME);
httpRequest.setAttribute(FileUploadConstants.FILE_UPLOAD_REQUEST_ATTRIBUTE_NAME, multipartRequest);
14 years, 8 months
JBoss Rich Faces SVN: r16831 - in root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces: renderkit and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-04-28 13:40:24 -0400 (Wed, 28 Apr 2010)
New Revision: 16831
Modified:
root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/component/behavior/ClientBehavior.java
root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/component/behavior/ComponentControlBehavior.java
root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/renderkit/ComponentControlBehaviorRenderer.java
root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/tag/BehaviorRule.java
Log:
add selector attribute, rename setLiteral method to setLiteralAttribute
Modified: root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/component/behavior/ClientBehavior.java
===================================================================
--- root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/component/behavior/ClientBehavior.java 2010-04-28 17:38:19 UTC (rev 16830)
+++ root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/component/behavior/ClientBehavior.java 2010-04-28 17:40:24 UTC (rev 16831)
@@ -1,5 +1,6 @@
package org.richfaces.component.behavior;
+import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
@@ -20,7 +21,7 @@
*
* base class for the client behaviors
*/
-public class ClientBehavior extends ClientBehaviorBase {
+public abstract class ClientBehavior extends ClientBehaviorBase {
private StateHelper behaviorStateHelper = null;
@@ -78,15 +79,13 @@
ELContext context = getFacesContext().getELContext();
try {
- setLiteral(name, expression.getValue(context));
- } catch (ELException ele) {
- throw new FacesException(ele);
+ setLiteralAttribute(name, expression.getValue(context));
+ } catch (ELException elem) {
+ throw new FacesException(elem);
}
}
- public void setLiteral(String name, Object value) {
- //TODO override this method
- }
+ public abstract void setLiteralAttribute(String name, Object value);
@Override
public Object saveState(FacesContext context) {
@@ -162,4 +161,14 @@
}
return (bindings);
}
+
+ protected boolean compare(Serializable key, String name) {
+ boolean retValue = false;
+ if(key != null) {
+ String keyName = key.toString();
+ retValue = keyName.equals(name);
+ }
+ return retValue;
+ }
+
}
Modified: root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/component/behavior/ComponentControlBehavior.java
===================================================================
--- root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/component/behavior/ComponentControlBehavior.java 2010-04-28 17:38:19 UTC (rev 16830)
+++ root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/component/behavior/ComponentControlBehavior.java 2010-04-28 17:40:24 UTC (rev 16831)
@@ -1,6 +1,5 @@
package org.richfaces.component.behavior;
-import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
@@ -12,16 +11,13 @@
public static final String BEHAVIOR_ID = "org.richfaces.behavior.ComponentControlBehavior";
- public static final String LIST_TYPE = "list";
-
-
+ private List<UIComponent> children;
+
enum PropertyKeys {
- event, target, selector, parameters, operation, type
+ event, target, selector, parameters, operation
}
- private List<UIComponent> children;
-
public List<UIComponent> getChildren() {
if(children == null) {
children = new ArrayList<UIComponent>();
@@ -37,14 +33,6 @@
getStateHelper().eval(PropertyKeys.event, eventName);
}
- public String getType() {
- return (String)getStateHelper().eval(PropertyKeys.type, LIST_TYPE);
- }
-
- public void setType(String type) {
- getStateHelper().put(PropertyKeys.type, type);
- }
-
public String getTarget() {
return (String)getStateHelper().eval(PropertyKeys.target);
}
@@ -75,21 +63,13 @@
}
@Override
- public void setLiteral(String name, Object value) {
+ public void setLiteralAttribute(String name, Object value) {
if(compare(PropertyKeys.operation, name)) {
setOperation((String)value);
} else if(compare(PropertyKeys.target, name)) {
setTarget((String)value);
+ } else if(compare(PropertyKeys.selector, name)) {
+ setSelector((String)name);
}
}
-
- private boolean compare(Serializable key, String name) {
- boolean retValue = false;
- if(key != null) {
- String keyName = key.toString();
- retValue = keyName.equals(name);
- }
- return retValue;
- }
-
}
Modified: root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/renderkit/ComponentControlBehaviorRenderer.java
===================================================================
--- root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/renderkit/ComponentControlBehaviorRenderer.java 2010-04-28 17:38:19 UTC (rev 16830)
+++ root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/renderkit/ComponentControlBehaviorRenderer.java 2010-04-28 17:40:24 UTC (rev 16831)
@@ -32,7 +32,7 @@
@ResourceDependency(name = "richfaces-base-component.js"),
@ResourceDependency(name = "script/component-control.js")
})
-public class ComponentControlBehaviorRenderer extends ClientBehaviorRenderer{
+public class ComponentControlBehaviorRenderer extends ClientBehaviorRenderer {
private static final String FUNC_NAME = "RichFaces.ui.ComponentControl.execute";
@@ -43,11 +43,9 @@
private static final String PARAM_CALLBACK = "callback";
private static final String PARAM_TARGET = "target";
+
+ private static final String PARAM_SELECTOR = "selector";
- public static final String SEPARATOR = "\\.";
-
-
-
@Override
public String getScript(ClientBehaviorContext behaviorContext, ClientBehavior behavior) {
ComponentControlBehavior controlBehavior = (ComponentControlBehavior)behavior;
@@ -58,19 +56,24 @@
String apiFunctionName = controlBehavior.getOperation();
+ //create callback function
StringBuffer script = new StringBuffer();
script.append(REF_COMPONENT).append("['").append(apiFunctionName).append("'].").append("apply").append("(");
+ //get client api function parameters
List<Object> apiFunctionParams = createSignature(controlBehavior);
script.append(REF_COMPONENT).append(",").append(ScriptUtils.toScript(apiFunctionParams.toArray())).append(");");
callback.addToBody(script);
String target = controlBehavior.getTarget();
+ String selector = controlBehavior.getSelector();
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put(PARAM_CALLBACK, callback);
parameters.put(PARAM_TARGET, target);
-
+ parameters.put(PARAM_SELECTOR, selector);
+
+ //execution function
JSFunction eventFunction = new JSFunction(FUNC_NAME);
eventFunction.addParameter(new JSReference(REF_EVENT));
eventFunction.addParameter(parameters);
Modified: root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/tag/BehaviorRule.java
===================================================================
--- root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/tag/BehaviorRule.java 2010-04-28 17:38:19 UTC (rev 16830)
+++ root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/tag/BehaviorRule.java 2010-04-28 17:40:24 UTC (rev 16831)
@@ -25,7 +25,7 @@
}
public void applyMetadata(FaceletContext ctx, Object instance) {
- ((ClientBehavior) instance).setLiteral(this.name, this.value);
+ ((ClientBehavior) instance).setLiteralAttribute(this.name, this.value);
}
}
14 years, 8 months
JBoss Rich Faces SVN: r16830 - in root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces: taglib and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-04-28 13:38:19 -0400 (Wed, 28 Apr 2010)
New Revision: 16830
Modified:
root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/tag/BehaviorTagHandlerDelegate.java
root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/taglib/ComponentControlHandler.java
Log:
fix and move nested component processing logic for the component control from tagHandlerDelegate to ComponentControlHandler
Modified: root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/tag/BehaviorTagHandlerDelegate.java
===================================================================
--- root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/tag/BehaviorTagHandlerDelegate.java 2010-04-28 17:36:28 UTC (rev 16829)
+++ root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/tag/BehaviorTagHandlerDelegate.java 2010-04-28 17:38:19 UTC (rev 16830)
@@ -1,130 +1,49 @@
package org.richfaces.tag;
import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
import javax.faces.component.UIComponent;
-import javax.faces.component.UIParameter;
-import javax.faces.component.behavior.ClientBehavior;
-import javax.faces.component.behavior.ClientBehaviorHolder;
import javax.faces.context.FacesContext;
import javax.faces.view.AttachedObjectHandler;
-import javax.faces.view.facelets.ComponentConfig;
-import javax.faces.view.facelets.ComponentHandler;
-import javax.faces.view.facelets.CompositeFaceletHandler;
+import javax.faces.view.facelets.BehaviorHandler;
import javax.faces.view.facelets.FaceletContext;
-import javax.faces.view.facelets.FaceletHandler;
import javax.faces.view.facelets.MetaRuleset;
import javax.faces.view.facelets.TagHandlerDelegate;
-import org.richfaces.component.UIHashParameter;
-import org.richfaces.component.behavior.ComponentControlBehavior;
-
-
-public class BehaviorTagHandlerDelegate extends TagHandlerDelegate implements AttachedObjectHandler{
-
- private TagHandlerDelegate tagHandlerDelegate;
+public class BehaviorTagHandlerDelegate extends TagHandlerDelegate implements AttachedObjectHandler {
- private List<UIComponent> children;
-
- public BehaviorTagHandlerDelegate(TagHandlerDelegate tagHandlerDelegate) {
- this.tagHandlerDelegate = tagHandlerDelegate;
+ TagHandlerDelegate wrappedHandlerDelegate;
+
+ BehaviorHandler owner;
+
+ public BehaviorTagHandlerDelegate(BehaviorHandler owner, TagHandlerDelegate wrappedHandlerDelegate) {
+ this.owner = owner;
+ this.wrappedHandlerDelegate = wrappedHandlerDelegate;
}
@Override
- public void apply(FaceletContext ctx, UIComponent parent) throws IOException {
- this.tagHandlerDelegate.apply(ctx, parent);
+ public void apply(FaceletContext ctx, UIComponent comp) throws IOException {
+ wrappedHandlerDelegate.apply(ctx, comp);
}
-
- public void apply(FaceletContext ctx, UIComponent parent, FaceletHandler nextHandler) throws IOException {
- apply(ctx, parent);
- processAttachedObject(ctx, parent, nextHandler);
- }
-
+
@Override
public MetaRuleset createMetaRuleset(Class type) {
- MetaRuleset metaRuleset = this.tagHandlerDelegate.createMetaRuleset(type);
+ MetaRuleset metaRuleset = wrappedHandlerDelegate.createMetaRuleset(type);
metaRuleset.addRule(new BehaviorRule());
return metaRuleset;
}
public void applyAttachedObject(FacesContext context, UIComponent parent) {
- if(tagHandlerDelegate instanceof AttachedObjectHandler) {
- ((AttachedObjectHandler)tagHandlerDelegate).applyAttachedObject(context, parent);
+ if(wrappedHandlerDelegate instanceof AttachedObjectHandler) {
+ ((AttachedObjectHandler)wrappedHandlerDelegate).applyAttachedObject(context, parent);
}
}
public String getFor() {
- String retValue = null;
- if(tagHandlerDelegate instanceof AttachedObjectHandler) {
- retValue = ((AttachedObjectHandler)tagHandlerDelegate).getFor();
+ if(wrappedHandlerDelegate instanceof AttachedObjectHandler) {
+ return ((AttachedObjectHandler)wrappedHandlerDelegate).getFor();
}
- return retValue;
+ return null;
}
-
-
- public void processNextHandler(FaceletContext ctx, FaceletHandler nextHandler, UIComponent parent) throws IOException {
- if(nextHandler instanceof CompositeFaceletHandler) {
- FaceletHandler [] children = ((CompositeFaceletHandler)nextHandler).getHandlers();
- for (FaceletHandler handler: children) {
- collectParameters(ctx, handler, parent);
- }
- } else {
- collectParameters(ctx, nextHandler, parent);
- }
- }
-
- private void processAttachedObject(FaceletContext ctx, UIComponent parent, FaceletHandler nextHandler) throws IOException{
- ClientBehaviorHolder holder = (ClientBehaviorHolder)parent;
- Map<String, List<ClientBehavior>> behaviors = holder.getClientBehaviors();
- Set<Map.Entry<String,List<ClientBehavior>>> entries = behaviors.entrySet();
- for(Map.Entry<String, List<ClientBehavior>>entry: entries) {
- for(ClientBehavior behavior: entry.getValue()) {
- if(behavior instanceof ComponentControlBehavior) {
- processNextHandler(ctx, nextHandler, parent);
- ((ComponentControlBehavior) behavior).getChildren().addAll(getChildren());
- //reset collected children after save to the behavior;
- children = null;
- }
- }
- }
- }
-
- private void collectParameters(FaceletContext ctx, FaceletHandler handler, UIComponent parent) throws IOException {
- if(handler instanceof ComponentHandler) {
- ComponentHandler componentHandler = (ComponentHandler) handler;
-
- ComponentConfig componentConfig = componentHandler.getComponentConfig();
- String componentType = componentConfig.getComponentType();
- if(isUIParameter(componentType)) {
-
- FacesContext facesContext = ctx.getFacesContext();
- UIComponent component = (UIComponent)facesContext.getApplication().createComponent(facesContext, componentType, null);
- if((component instanceof UIParameter) || (component instanceof UIHashParameter)) {
- componentHandler.setAttributes(ctx, component);
- getChildren().add(component);
- }
-
- if(component instanceof UIHashParameter) {
- componentHandler.applyNextHandler(ctx, component);
- }
- }
- }
- }
-
- private boolean isUIParameter(String type) {
- return (UIParameter.COMPONENT_TYPE.equals(type) || UIHashParameter.COMPONENT_TYPE.equals(type));
- }
-
- public List<UIComponent> getChildren() {
- if(this.children == null) {
- this.children = new ArrayList<UIComponent>();
- }
- return this.children;
- }
-
}
Modified: root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/taglib/ComponentControlHandler.java
===================================================================
--- root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/taglib/ComponentControlHandler.java 2010-04-28 17:36:28 UTC (rev 16829)
+++ root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/taglib/ComponentControlHandler.java 2010-04-28 17:38:19 UTC (rev 16830)
@@ -1,40 +1,89 @@
package org.richfaces.taglib;
import java.io.IOException;
+import java.util.List;
+import java.util.Map;
import javax.faces.component.UIComponent;
+import javax.faces.component.UIParameter;
+import javax.faces.component.behavior.ClientBehavior;
+import javax.faces.component.behavior.ClientBehaviorHolder;
+import javax.faces.context.FacesContext;
import javax.faces.view.facelets.BehaviorConfig;
-import javax.faces.view.facelets.BehaviorHandler;
+import javax.faces.view.facelets.ComponentConfig;
+import javax.faces.view.facelets.ComponentHandler;
+import javax.faces.view.facelets.CompositeFaceletHandler;
import javax.faces.view.facelets.FaceletContext;
-import javax.faces.view.facelets.TagHandlerDelegate;
+import javax.faces.view.facelets.FaceletHandler;
-import org.richfaces.tag.BehaviorTagHandlerDelegate;
+import org.richfaces.component.UIHashParameter;
+import org.richfaces.component.behavior.ComponentControlBehavior;
+import org.richfaces.tag.CustomBehaviorHandler;
-public class ComponentControlHandler extends BehaviorHandler {
-
- private BehaviorTagHandlerDelegate helper;
+public class ComponentControlHandler extends CustomBehaviorHandler {
-
public ComponentControlHandler(BehaviorConfig config) {
super(config);
}
-
- public BehaviorTagHandlerDelegate getBehaviorTagHandlerDelegate() {
- return (BehaviorTagHandlerDelegate)getTagHandlerDelegate();
- }
-
+
@Override
public void apply(FaceletContext ctx, UIComponent parent) throws IOException {
- getBehaviorTagHandlerDelegate().apply(ctx, parent, nextHandler);
+ super.apply(ctx, parent);
+ processNestedTags(ctx, parent);
}
-
- @Override
- protected TagHandlerDelegate getTagHandlerDelegate() {
- if(helper == null){
- helper = new BehaviorTagHandlerDelegate(super.getTagHandlerDelegate());
+
+
+ private void processNestedTags(FaceletContext ctx, UIComponent parent) throws IOException {
+ if(nextHandler instanceof CompositeFaceletHandler) {
+ FaceletHandler [] children = ((CompositeFaceletHandler)nextHandler).getHandlers();
+ for (FaceletHandler handler: children) {
+ processNextHandler(ctx, handler, parent);
+ }
+ } else {
+ processNextHandler(ctx, nextHandler, parent);
}
- return helper;
}
+ private void processNextHandler(FaceletContext ctx, FaceletHandler handler, UIComponent parent) throws IOException {
+ if(handler instanceof ComponentHandler) {
+ ComponentHandler componentHandler = (ComponentHandler) handler;
+
+ ComponentConfig componentConfig = componentHandler.getComponentConfig();
+ String componentType = componentConfig.getComponentType();
+
+ if(isUIParameter(componentType)) {
+ FacesContext facesContext = ctx.getFacesContext();
+
+ UIComponent component = (UIComponent)facesContext.getApplication().createComponent(facesContext, componentType, null);
+ componentHandler.setAttributes(ctx, component);
+
+ if(parent instanceof ClientBehaviorHolder) {
+ ClientBehaviorHolder clientBehaviorHolder = ((ClientBehaviorHolder)parent);
+ Map<String, List<ClientBehavior>> clientBehaviors = clientBehaviorHolder.getClientBehaviors();
+
+ String eventName = getEventName();
+
+ if(eventName == null) {
+ eventName = clientBehaviorHolder.getDefaultEventName();
+ }
+
+ if(eventName != null) {
+ List<ClientBehavior> eventClientBehaviors = clientBehaviors.get(eventName);
+ for(ClientBehavior clientBehavior: eventClientBehaviors) {
+ if(clientBehavior instanceof ComponentControlBehavior) {
+ ((ComponentControlBehavior)clientBehavior).getChildren().add(component);
+ }
+ }
+ }
+ }
+
+ componentHandler.applyNextHandler(ctx, component);
+ }
+ }
+ }
+
+ private boolean isUIParameter(String type) {
+ return (UIParameter.COMPONENT_TYPE.equals(type) || UIHashParameter.COMPONENT_TYPE.equals(type));
+ }
}
14 years, 8 months
JBoss Rich Faces SVN: r16829 - root/ui-sandbox/trunk/components/componentcontrol/src/main/resources/META-INF/resources/script.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-04-28 13:36:28 -0400 (Wed, 28 Apr 2010)
New Revision: 16829
Modified:
root/ui-sandbox/trunk/components/componentcontrol/src/main/resources/META-INF/resources/script/component-control.js
Log:
implement invokeOnComponent callback method, add support for jQuery selectors
Modified: root/ui-sandbox/trunk/components/componentcontrol/src/main/resources/META-INF/resources/script/component-control.js
===================================================================
--- root/ui-sandbox/trunk/components/componentcontrol/src/main/resources/META-INF/resources/script/component-control.js 2010-04-28 16:24:45 UTC (rev 16828)
+++ root/ui-sandbox/trunk/components/componentcontrol/src/main/resources/META-INF/resources/script/component-control.js 2010-04-28 17:36:28 UTC (rev 16829)
@@ -7,23 +7,32 @@
execute: function(event, parameters) {
var target = parameters.target;
+ var selector = parameters.selector;
var callback = parameters.callback;
if(target) {
- target = document.getElementById(target);
+ var ids = target.split(',');
+ for (var i = 0; i < ids.length; i++) {
+ var component = document.getElementById(ids[i]);
+ if(component) {
+ richfaces.ui.ComponentControl.invokeOnComponent(event, component, callback);
+ }
+ }
}
-
- if(target && (callback && typeof callback == 'function')) {
- richfaces.ui.ComponentControl.eachComponent(event, target, callback);
- }
+
+ if(selector) {
+ richfaces.ui.ComponentControl.invokeOnComponent(event, selector, callback);
+ }
},
- eachComponent : function(event, target, callback) {
- $(target).each(function() {
- if (this.richfaces && this.richfaces.component) {
- callback(event, this.richfaces.component);
- }
- });
+ invokeOnComponent : function(event, target, callback) {
+ if(callback && typeof callback == 'function') {
+ $(target).each(function() {
+ if (this.richfaces && this.richfaces.component) {
+ callback(event, this.richfaces.component);
+ }
+ });
+ }
}
});
14 years, 8 months
JBoss Rich Faces SVN: r16828 - in root/framework/trunk/impl/src/test: resources/javascript and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2010-04-28 12:24:45 -0400 (Wed, 28 Apr 2010)
New Revision: 16828
Added:
root/framework/trunk/impl/src/test/resources/javascript/richfaces-base-component-qunit.js
Modified:
root/framework/trunk/impl/src/test/java/org/richfaces/javascript/QUnitTest.java
root/framework/trunk/impl/src/test/resources/javascript/richfaces-client-api.html
Log:
BaseComponent qunit tests was added
Modified: root/framework/trunk/impl/src/test/java/org/richfaces/javascript/QUnitTest.java
===================================================================
--- root/framework/trunk/impl/src/test/java/org/richfaces/javascript/QUnitTest.java 2010-04-28 16:23:19 UTC (rev 16827)
+++ root/framework/trunk/impl/src/test/java/org/richfaces/javascript/QUnitTest.java 2010-04-28 16:24:45 UTC (rev 16828)
@@ -123,5 +123,6 @@
runTest(getClass().getClassLoader().getResource("javascript/richfaces-client-api.html"), "?richfaces-queue-isEmpty");
runTest(getClass().getClassLoader().getResource("javascript/richfaces-client-api.html"), "?richfaces-queue-clear");
runTest(getClass().getClassLoader().getResource("javascript/richfaces-client-api.html"), "?richfaces-queue-submitFirst");
+ runTest(getClass().getClassLoader().getResource("javascript/richfaces-client-api.html"), "?richfaces-base-component module");
}
}
Added: root/framework/trunk/impl/src/test/resources/javascript/richfaces-base-component-qunit.js
===================================================================
--- root/framework/trunk/impl/src/test/resources/javascript/richfaces-base-component-qunit.js (rev 0)
+++ root/framework/trunk/impl/src/test/resources/javascript/richfaces-base-component-qunit.js 2010-04-28 16:24:45 UTC (rev 16828)
@@ -0,0 +1,111 @@
+RichFaces.QUnit.run(function(){
+ module("richfaces-base-component");
+
+ var createMyComponentClass = function (richfaces) {
+ MyComponent = function(componentId) {
+ $super.constructor.call(this, componentId);
+ };
+
+ var $p ={a:function(){return "hello"}};
+ $p = richfaces.BaseComponent.extend(richfaces.BaseComponent, MyComponent, $p);
+ equals(typeof $p.attachToDom, "function", "ComponentCreation: inherit protected method from BaseComponent");
+ var $super = MyComponent.$super;
+
+ jQuery.extend(MyComponent.prototype, (function () {
+ return { name:"MyComponent", attachToDom: function(){$p.attachToDom.apply(this,arguments);}}
+ })());
+ equals(MyComponent.$super, richfaces.BaseComponent.prototype, "New component: MyComponent from");
+ };
+
+ // BaseComponent.constructor
+ test("RichFaces.BaseComponent.constructor", function () {
+ expect(5);
+ var c = new RichFaces.BaseComponent("myId");
+ ok(c instanceof RichFaces.BaseComponent, "inctance of RichFaces.BaseComponent");
+ equals(c.name, "BaseComponent", "name");
+ equals(c.id, "myId", "id");
+ equals(c.toString(), "BaseComponent", "toString");
+ equals(c.getEventElement(), "#myId", "getEventElement");
+ });
+
+ // BaseComponent inheritance
+ test("RichFaces.BaseComponent inheritance", function () {
+ expect(29);
+
+ createMyComponentClass(RichFaces);
+
+ var c = new MyComponent("myId");
+ ok(c instanceof MyComponent, "inctance of MyComponent");
+ equals(c.name, "MyComponent", "name");
+ equals(c.id, "myId", "id");
+ equals(c.toString(), "BaseComponent, MyComponent", "toString");
+ equals(c.getEventElement(), "#myId", "getEventElement");
+
+ (function (richfaces) {
+ MyComponent2 = function(componentId) {
+ $super.constructor.call(this, componentId);
+ };
+ var $p = {b:"b"};
+ $p = MyComponent.extend(MyComponent, MyComponent2, $p);
+ equals(typeof $p.attachToDom, "function", "ComponentCreation: inherit protected method from BaseComponent");
+ equals(typeof $p.a, "function", "ComponentCreation: inherit protected method from MyComponent2");
+ var $super = MyComponent2.$super;
+ jQuery.extend(MyComponent2.prototype, (function () {
+ return { name:"MyComponent2" }
+ })());
+ })(RichFaces);
+ equals(MyComponent2.$super, MyComponent.prototype, "New component: MyComponent2 from");
+
+ var c = new MyComponent2("myId");
+ ok(c instanceof MyComponent2, "inctance of MyComponent2");
+ ok(c instanceof MyComponent, "inctance of MyComponent");
+ ok(c instanceof RichFaces.BaseComponent, "inctance of RichFaces.BaseComponent");
+ equals(c.name, "MyComponent2", "name");
+ equals(c.id, "myId", "id");
+ equals(c.toString(), "BaseComponent, MyComponent, MyComponent2", "toString");
+ equals(c.getEventElement(), "#myId", "getEventElement");
+
+ (function (richfaces) {
+ MyComponent3 = function(componentId) {
+ $super.constructor.call(this, componentId);
+ };
+ var $p = {c:"c"};
+ $p = MyComponent2.extend(MyComponent2, MyComponent3, $p);
+ equals(typeof $p.attachToDom, "function", "ComponentCreation: inherit protected method from BaseComponent");
+ equals(typeof $p.a, "function", "ComponentCreation: inherit protected method from MyComponent2");
+ equals(typeof $p.b, "string", "ComponentCreation: inherit static protected property from MyComponent3");
+ var $super = MyComponent3.$super;
+ jQuery.extend(MyComponent3.prototype, (function () {
+ return { name:"MyComponent3" }
+ })());
+ equals(MyComponent3.$super, MyComponent2.prototype, "New component: MyComponent3 from");
+
+
+ var c = new MyComponent3("myId");
+ ok(c instanceof MyComponent3, "inctance of MyComponent3");
+ ok(c instanceof MyComponent2, "inctance of MyComponent2");
+ ok(c instanceof MyComponent, "inctance of MyComponent");
+ ok(c instanceof RichFaces.BaseComponent, "inctance of RichFaces.BaseComponent");
+ equals(c.name, "MyComponent3", "name");
+ equals(c.id, "myId", "id");
+ equals(c.toString(), "BaseComponent, MyComponent, MyComponent2, MyComponent3", "toString");
+ equals(c.getEventElement(), "#myId", "getEventElement");
+
+ })(RichFaces);
+ });
+
+
+ test("RichFaces.BaseComponent.attachToDom", function () {
+ expect(2);
+
+ var body = document.getElementsByTagName("body")[0];
+ RichFaces.QUnit.appendDomElements(body, '<div id="myId">baseComponentMarkup</div><div id="myId2">baseComponentMarkup2</div>');
+
+ var c = new MyComponent("myId");
+ c.attachToDom();
+ equals(RichFaces.$("myId"), c, "attachToDom without params");
+ c.attachToDom("myId2");
+ equals(RichFaces.$("myId2"), c, "attachToDom with custom id");
+ });
+
+});
\ No newline at end of file
Modified: root/framework/trunk/impl/src/test/resources/javascript/richfaces-client-api.html
===================================================================
--- root/framework/trunk/impl/src/test/resources/javascript/richfaces-client-api.html 2010-04-28 16:23:19 UTC (rev 16827)
+++ root/framework/trunk/impl/src/test/resources/javascript/richfaces-client-api.html 2010-04-28 16:24:45 UTC (rev 16828)
@@ -21,6 +21,7 @@
<script type="text/javascript" src="richfaces-queue-qunit-isEmpty.js"></script>
<script type="text/javascript" src="richfaces-queue-qunit-clear.js"></script>
<script type="text/javascript" src="richfaces-queue-qunit-submitFirst.js"></script>
+ <script type="text/javascript" src="richfaces-base-component-qunit.js"></script>
</head>
<body>
<h1 id="qunit-header">Richfaces Client API Tests</h1>
14 years, 8 months
JBoss Rich Faces SVN: r16827 - root/framework/trunk/impl/src/main/resources/META-INF/resources.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2010-04-28 12:23:19 -0400 (Wed, 28 Apr 2010)
New Revision: 16827
Modified:
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-base-component.js
Log:
BaseComponent: protected methods support was added, jsdocs updated
Modified: root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-base-component.js
===================================================================
--- root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-base-component.js 2010-04-28 15:24:38 UTC (rev 16826)
+++ root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-base-component.js 2010-04-28 16:23:19 UTC (rev 16827)
@@ -13,18 +13,30 @@
*
<pre><code>
//Inheritance example:
- (function (jQuery, richfaces, params) {
+ (function ($, richfaces, params) {
// Constructor definition
richfaces.MyComponent = function(componentId, [options]) {
- $super.constructor.call(this, componentId, [options]);
+ // call constructor of parent class
+ $super.constructor.call(this, componentId, [options]);
};
-
- // Extend component class
- var $super = richfaces.BaseComponent.extend(richfaces.BaseComponent, richfaces.MyComponent);
+
+ // define private method
+ var myPrivateMethod = function () {
+ }
+
+ // create container for protected method's links
+ // in this example we link private method as protected
+ var $p ={myProtectedMethod: myPrivateMethod};
+
+ // Extend component class and add protected methods from parent class to our container
+ $p = richfaces.BaseComponent.extend(richfaces.BaseComponent, richfaces.MyComponent, $p);
+
+ // define super class link
+ var $super = richfaces.MyComponent.$super;
// Add new properties and methods
- jQuery.extend(richfaces.MyComponent.prototype, (function (params) {
+ $.extend(richfaces.MyComponent.prototype, (function (params) {
return {
name:"MyComponent",
f:function (){alert("hello");
@@ -45,23 +57,53 @@
};
/**
+ * <protected> Attach component object to DOM element by component id, DOM element or jQuery object and returns the element
+ *
+ * @function
+ * @name RichFaces.BaseComponent#attachToDom
+ * @param {string|DOMElement|jQuery} source - component id, DOM element or DOM elements wrapped by jQuery
+ *
+ * @return {DOMElement}
+ * */
+ var attachToDom = function(source) {
+ source = source || this.id;
+ var element = richfaces.getDomElement(source);
+ if (element) {
+ element["richfaces"] = element["richfaces"] || {};
+ element.richfaces.component = this;
+ }
+ return element;
+ }
+
+ var $p = {attachToDom:attachToDom};
+
+ /**
* Method extends child class prototype with parent prototype
- * and return parent's prototype ($super)
+ * and return the object with parent's protected methods
*
* @function
* @name RichFaces.BaseComponent.extend
*
* @return {object}
* */
- richfaces.BaseComponent.extend = function (Parent, Child) {
+ richfaces.BaseComponent.extend = function (parent, child, h) {
var F = richfaces.blankFunction;
- F.prototype = Parent.prototype;
- Child.prototype = new F();
- Child.prototype.constructor = Child;
- Child.$super = Parent.prototype;
- return Parent.prototype;
- }
-
+ F.prototype = parent.prototype;
+ child.prototype = new F();
+ child.prototype.constructor = child;
+ child.$super = parent.prototype;
+ if (child.$super == richfaces.BaseComponent.prototype) {
+ var r = jQuery.extend({}, $p, h||{});
+ }
+
+ // create wrapper with protected methods and variables
+ child.extend = function (_parent, _child, _h) {
+ var _r = jQuery.extend({}, r||h||{}, _h||{});
+ return richfaces.BaseComponent.extend(_parent, _child, _r);
+ }
+ return r||h;
+ };
+
$.extend(richfaces.BaseComponent.prototype, (function (params) {
return {
/**
@@ -99,26 +141,7 @@
* @return {String}
* */
getEventElement: function() {
- return "#"+this.id;
- },
-
- /**
- * Attach component object to DOM element by component id, DOM element or jQuery object and returns the element
- *
- * @function
- * @name RichFaces.BaseComponent#attachToDom
- * @param {string|DOMElement|jQuery} source - component id, DOM element or DOM elements wrapped by jQuery
- *
- * @return {DOMElement}
- * */
- attachToDom: function(source) {
- source = source || this.id;
- var element = RichFaces.getDomElement(source);
- if (element) {
- element["richfaces"] = element["richfaces"] || {};
- element.richfaces.component = this;
- }
- return element;
+ return "#"+this.id;
}
};
})(params));
14 years, 8 months
JBoss Rich Faces SVN: r16826 - in branches/enterprise/3.3.X/ui/datascroller/src/main: resources/org/richfaces/renderkit/html/css and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-04-28 11:24:38 -0400 (Wed, 28 Apr 2010)
New Revision: 16826
Modified:
branches/enterprise/3.3.X/ui/datascroller/src/main/java/org/richfaces/renderkit/html/DataScrollerRenderer.java
branches/enterprise/3.3.X/ui/datascroller/src/main/resources/org/richfaces/renderkit/html/css/datascroller.xcss
branches/enterprise/3.3.X/ui/datascroller/src/main/templates/org/richfaces/htmlDatascroller.jspx
Log:
RFPL-544
Modified: branches/enterprise/3.3.X/ui/datascroller/src/main/java/org/richfaces/renderkit/html/DataScrollerRenderer.java
===================================================================
--- branches/enterprise/3.3.X/ui/datascroller/src/main/java/org/richfaces/renderkit/html/DataScrollerRenderer.java 2010-04-28 13:43:58 UTC (rev 16825)
+++ branches/enterprise/3.3.X/ui/datascroller/src/main/java/org/richfaces/renderkit/html/DataScrollerRenderer.java 2010-04-28 15:24:38 UTC (rev 16826)
@@ -219,7 +219,11 @@
out.writeAttribute("onclick", getOnClick(Integer.toString(i + 1)), null);
}
if (null != style) out.writeAttribute("style", style, null);
+ out.startElement("a", component);
+ out.writeAttribute("class", "rich-datascr-button-content", null);
+ out.writeAttribute("href", "javascript:void(0)", null);
out.writeText(Integer.toString(i + 1), null);
+ out.endElement("a");
//renderChild(context, link);
out.endElement("td");
}
Modified: branches/enterprise/3.3.X/ui/datascroller/src/main/resources/org/richfaces/renderkit/html/css/datascroller.xcss
===================================================================
--- branches/enterprise/3.3.X/ui/datascroller/src/main/resources/org/richfaces/renderkit/html/css/datascroller.xcss 2010-04-28 13:43:58 UTC (rev 16825)
+++ branches/enterprise/3.3.X/ui/datascroller/src/main/resources/org/richfaces/renderkit/html/css/datascroller.xcss 2010-04-28 15:24:38 UTC (rev 16826)
@@ -18,6 +18,10 @@
text-align: center;
}
+.rich-datascr-button-content {
+ text-decoration:none;
+}
+
.dr-dscr-button-dsbld {
cursor: default;
}
@@ -52,11 +56,13 @@
<u:style name="font-size" skin="generalSizeFont" />
</u:selector>
-<u:selector name=".dr-dscr-button-dsbld">
+<u:selector name=".rich-datascr-button-dsbld,
+ .rich-datascr-button-dsbld .rich-datascr-button-content, .rich-datascr-button-dsbld a.rich-datascr-button-content:hover,
+ .rich-datascr-inact .rich-datascr-button-content, .rich-datascr-inact a.rich-datascr-button-content:hover">
<u:style name="color" skin="panelBorderColor" default="gray" />
</u:selector>
-<u:selector name=".dr-dscr-act">
+<u:selector name=".dr-dscr-act, .rich-datascr-button-content, a.rich-datascr-button-content:hover">
<u:style name=" border-top-color" skin="generalTextColor" />
<u:style name="color" skin="generalTextColor" />
<u:style name="font-family" skin="generalFamilyFont" />
Modified: branches/enterprise/3.3.X/ui/datascroller/src/main/templates/org/richfaces/htmlDatascroller.jspx
===================================================================
--- branches/enterprise/3.3.X/ui/datascroller/src/main/templates/org/richfaces/htmlDatascroller.jspx 2010-04-28 13:43:58 UTC (rev 16825)
+++ branches/enterprise/3.3.X/ui/datascroller/src/main/templates/org/richfaces/htmlDatascroller.jspx 2010-04-28 15:24:38 UTC (rev 16826)
@@ -101,9 +101,11 @@
}else{
]]></jsp:scriptlet>
<td class="#{buttonClass} dr-dscr-button rich-datascr-button" onclick="#{onclick}">
- <jsp:scriptlet><![CDATA[
- writer.write("««");
- ]]></jsp:scriptlet>
+ <a class="rich-datascr-button-content" href="javascript:void(0)">
+ <jsp:scriptlet><![CDATA[
+ writer.write("««");
+ ]]></jsp:scriptlet>
+ </a>
</td>
<jsp:scriptlet><![CDATA[
}
@@ -147,9 +149,11 @@
}else{
]]></jsp:scriptlet>
<td class="#{buttonClass} dr-dscr-button rich-datascr-button" onclick="#{onclick}">
- <jsp:scriptlet><![CDATA[
- writer.write("«");
- ]]></jsp:scriptlet>
+ <a class="rich-datascr-button-content" href="javascript:void(0)">
+ <jsp:scriptlet><![CDATA[
+ writer.write("«");
+ ]]></jsp:scriptlet>
+ </a>
</td>
<jsp:scriptlet><![CDATA[
}
@@ -294,9 +298,11 @@
}else{
]]></jsp:scriptlet>
<td class="#{buttonClass} dr-dscr-button rich-datascr-button" onclick="#{onclick}">
- <jsp:scriptlet><![CDATA[
- writer.write("»");
- ]]></jsp:scriptlet>
+ <a class="rich-datascr-button-content" href="javascript:void(0)">
+ <jsp:scriptlet><![CDATA[
+ writer.write("»");
+ ]]></jsp:scriptlet>
+ </a>
</td>
<jsp:scriptlet><![CDATA[
}
@@ -341,9 +347,11 @@
}else{
]]></jsp:scriptlet>
<td class="#{buttonClass} dr-dscr-button rich-datascr-button" onclick="#{onclick}">
+ <a class="rich-datascr-button-content" href="javascript:void(0)">
<jsp:scriptlet><![CDATA[
writer.write("»»");
- ]]></jsp:scriptlet>
+ ]]></jsp:scriptlet>
+ </a>
</td>
<jsp:scriptlet><![CDATA[
}
14 years, 8 months
JBoss Rich Faces SVN: r16825 - in branches/community/3.3.X/ui/datascroller/src/main: resources/org/richfaces/renderkit/html/css and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-04-28 09:43:58 -0400 (Wed, 28 Apr 2010)
New Revision: 16825
Modified:
branches/community/3.3.X/ui/datascroller/src/main/java/org/richfaces/renderkit/html/DataScrollerRenderer.java
branches/community/3.3.X/ui/datascroller/src/main/resources/org/richfaces/renderkit/html/css/datascroller.xcss
branches/community/3.3.X/ui/datascroller/src/main/templates/org/richfaces/htmlDatascroller.jspx
Log:
RF-8067
Modified: branches/community/3.3.X/ui/datascroller/src/main/java/org/richfaces/renderkit/html/DataScrollerRenderer.java
===================================================================
--- branches/community/3.3.X/ui/datascroller/src/main/java/org/richfaces/renderkit/html/DataScrollerRenderer.java 2010-04-28 00:54:49 UTC (rev 16824)
+++ branches/community/3.3.X/ui/datascroller/src/main/java/org/richfaces/renderkit/html/DataScrollerRenderer.java 2010-04-28 13:43:58 UTC (rev 16825)
@@ -219,7 +219,11 @@
out.writeAttribute("onclick", getOnClick(Integer.toString(i + 1)), null);
}
if (null != style) out.writeAttribute("style", style, null);
+ out.startElement("a", component);
+ out.writeAttribute("class", "rich-datascr-button-content", null);
+ out.writeAttribute("href", "javascript:void(0)", null);
out.writeText(Integer.toString(i + 1), null);
+ out.endElement("a");
//renderChild(context, link);
out.endElement("td");
}
Modified: branches/community/3.3.X/ui/datascroller/src/main/resources/org/richfaces/renderkit/html/css/datascroller.xcss
===================================================================
--- branches/community/3.3.X/ui/datascroller/src/main/resources/org/richfaces/renderkit/html/css/datascroller.xcss 2010-04-28 00:54:49 UTC (rev 16824)
+++ branches/community/3.3.X/ui/datascroller/src/main/resources/org/richfaces/renderkit/html/css/datascroller.xcss 2010-04-28 13:43:58 UTC (rev 16825)
@@ -16,6 +16,10 @@
text-align: center;
}
+.rich-datascr-button-content {
+ text-decoration:none;
+}
+
.rich-datascr-button-dsbld {
cursor: default;
}
@@ -45,11 +49,13 @@
<u:style name="font-size" skin="generalSizeFont" />
</u:selector>
-<u:selector name=".rich-datascr-button-dsbld">
+<u:selector name=".rich-datascr-button-dsbld,
+ .rich-datascr-button-dsbld .rich-datascr-button-content, .rich-datascr-button-dsbld a.rich-datascr-button-content:hover,
+ .rich-datascr-inact .rich-datascr-button-content, .rich-datascr-inact a.rich-datascr-button-content:hover">
<u:style name="color" skin="panelBorderColor" default="gray" />
</u:selector>
-<u:selector name=".rich-datascr-act">
+<u:selector name=".rich-datascr-act, .rich-datascr-button-content, a.rich-datascr-button-content:hover">
<u:style name=" border-top-color" skin="generalTextColor" />
<u:style name="color" skin="generalTextColor" />
<u:style name="font-family" skin="generalFamilyFont" />
Modified: branches/community/3.3.X/ui/datascroller/src/main/templates/org/richfaces/htmlDatascroller.jspx
===================================================================
--- branches/community/3.3.X/ui/datascroller/src/main/templates/org/richfaces/htmlDatascroller.jspx 2010-04-28 00:54:49 UTC (rev 16824)
+++ branches/community/3.3.X/ui/datascroller/src/main/templates/org/richfaces/htmlDatascroller.jspx 2010-04-28 13:43:58 UTC (rev 16825)
@@ -101,9 +101,11 @@
}else{
]]></jsp:scriptlet>
<td class="#{buttonClass} rich-datascr-button" onclick="#{onclick}">
- <jsp:scriptlet><![CDATA[
- writer.write("««");
- ]]></jsp:scriptlet>
+ <a class="rich-datascr-button-content" href="javascript:void(0)">
+ <jsp:scriptlet><![CDATA[
+ writer.write("««");
+ ]]></jsp:scriptlet>
+ </a>
</td>
<jsp:scriptlet><![CDATA[
}
@@ -147,9 +149,11 @@
}else{
]]></jsp:scriptlet>
<td class="#{buttonClass} rich-datascr-button" onclick="#{onclick}">
- <jsp:scriptlet><![CDATA[
- writer.write("«");
- ]]></jsp:scriptlet>
+ <a class="rich-datascr-button-content" href="javascript:void(0)">
+ <jsp:scriptlet><![CDATA[
+ writer.write("«");
+ ]]></jsp:scriptlet>
+ </a>
</td>
<jsp:scriptlet><![CDATA[
}
@@ -294,9 +298,11 @@
}else{
]]></jsp:scriptlet>
<td class="#{buttonClass} rich-datascr-button" onclick="#{onclick}">
- <jsp:scriptlet><![CDATA[
- writer.write("»");
- ]]></jsp:scriptlet>
+ <a class="rich-datascr-button-content" href="javascript:void(0)">
+ <jsp:scriptlet><![CDATA[
+ writer.write("»");
+ ]]></jsp:scriptlet>
+ </a>
</td>
<jsp:scriptlet><![CDATA[
}
@@ -341,9 +347,11 @@
}else{
]]></jsp:scriptlet>
<td class="#{buttonClass} rich-datascr-button" onclick="#{onclick}">
+ <a class="rich-datascr-button-content" href="javascript:void(0)">
<jsp:scriptlet><![CDATA[
writer.write("»»");
- ]]></jsp:scriptlet>
+ ]]></jsp:scriptlet>
+ </a>
</td>
<jsp:scriptlet><![CDATA[
}
14 years, 8 months