JBoss Rich Faces SVN: r6798 - trunk/samples/suggestionbox-sample/src/main/webapp/pages.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-03-13 21:29:52 -0400 (Thu, 13 Mar 2008)
New Revision: 6798
Modified:
trunk/samples/suggestionbox-sample/src/main/webapp/pages/index.jsp
Log:
http://jira.jboss.com/jira/browse/RF-1774
Modified: trunk/samples/suggestionbox-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/samples/suggestionbox-sample/src/main/webapp/pages/index.jsp 2008-03-14 00:24:19 UTC (rev 6797)
+++ trunk/samples/suggestionbox-sample/src/main/webapp/pages/index.jsp 2008-03-14 01:29:52 UTC (rev 6798)
@@ -38,8 +38,7 @@
<h:inputText value="#{suggestionBox.property}" id="text"/>
<rich:suggestionbox id="suggestionBoxId" for="text" tokens=",["
rules="#{suggestionBox.rules}"
- suggestionAction="#{suggestionBox.autocomplete}"
- var="result"
+ suggestionAction="#{suggestionBox.autocomplete}" var="result"
fetchValue="#{result.text}"
first="#{suggestionBox.intFirst}"
minChars="#{suggestionBox.minchars}"
@@ -48,8 +47,8 @@
width="#{suggestionBox.width}"
height="#{suggestionBox.height}"
shadowDepth="#{suggestionBox.shadowDepth}"
- cellpadding="#{suggestionBox.cellpadding}"
- hiddenFetchValue="#{result.label}">
+ cellpadding="#{suggestionBox.cellpadding}">
+
<a4j:ajaxListener type="org.richfaces.AjaxListener"/>
<h:column>
<h:outputText value="#{result.text}"/>
16 years, 10 months
JBoss Rich Faces SVN: r6797 - in trunk: framework/impl/src/main/java/org/ajax4jsf/application and 11 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2008-03-13 20:24:19 -0400 (Thu, 13 Mar 2008)
New Revision: 6797
Added:
trunk/framework/test/src/main/java/org/ajax4jsf/tests/MockUIComponent.java
trunk/framework/test/src/test/java/org/ajax4jsf/component/
trunk/framework/test/src/test/java/org/ajax4jsf/component/AjaxViewRootTest.java
Modified:
trunk/framework/api/src/main/java/org/ajax4jsf/component/AjaxContainerBase.java
trunk/framework/impl/src/main/java/org/ajax4jsf/application/AjaxViewHandler.java
trunk/framework/impl/src/main/java/org/ajax4jsf/component/AjaxRegionBrige.java
trunk/framework/impl/src/main/java/org/ajax4jsf/component/AjaxViewRoot.java
trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxChildrenRenderer.java
trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxContainerRenderer.java
trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxViewRootRenderer.java
trunk/framework/test/src/main/java/org/ajax4jsf/tests/MockViewRoot.java
trunk/ui/core/src/main/java/org/ajax4jsf/component/UIAjaxRegion.java
trunk/ui/drag-drop/src/test/java/org/richfaces/component/DragDropTest.java
trunk/ui/menu-components/src/test/java/org/richfaces/component/MenuItemComponentTest.java
trunk/ui/panelbar/src/test/java/org/richfaces/component/PanelBarComponentTest.java
trunk/ui/togglePanel/src/test/java/org/richfaces/component/TogglePanelComponentTest.java
trunk/ui/tree/src/test/java/org/richfaces/component/events/TreeEventsTest.java
Log:
Continue to refactor JSF 1.2 compatibility.
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/component/AjaxContainerBase.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/component/AjaxContainerBase.java 2008-03-13 20:37:14 UTC (rev 6796)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/component/AjaxContainerBase.java 2008-03-14 00:24:19 UTC (rev 6797)
@@ -81,15 +81,5 @@
public void setSubmitted(boolean submitted);
- /**
- * Render AJAX response for this container from stored View.
- * @param context
- * @throws FacesException
- */
-// public void renderAjaxRegion(FacesContext context) throws FacesException ;
- public abstract void setSubmittedControlId(String string);
-
- public abstract String getSubmittedControlId();
-
}
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/application/AjaxViewHandler.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/application/AjaxViewHandler.java 2008-03-13 20:37:14 UTC (rev 6796)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/application/AjaxViewHandler.java 2008-03-14 00:24:19 UTC (rev 6797)
@@ -30,15 +30,11 @@
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
-import javax.servlet.http.HttpServletResponse;
import org.ajax4jsf.Messages;
-import org.ajax4jsf.application.ViewHandlerWrapper;
import org.ajax4jsf.component.AjaxViewRoot;
import org.ajax4jsf.context.AjaxContext;
import org.ajax4jsf.context.ViewIdHolder;
-import org.ajax4jsf.renderkit.AjaxContainerRenderer;
-import org.ajax4jsf.renderkit.AjaxRendererUtils;
import org.ajax4jsf.renderkit.RendererUtils.HTML;
import org.ajax4jsf.resource.InternetResource;
import org.ajax4jsf.resource.InternetResourceBuilder;
@@ -88,35 +84,11 @@
viewIdHolder.setViewId(viewId);
riRoot = facesContext.getViewRoot();
} else {
- UIViewRoot root = super.createView(facesContext, viewId);
- // TODO -setup render-kit where instead of Listener ?
- if (null == root || root instanceof AjaxViewRoot) {
- riRoot = root;
- } else {
- // HACK - since only RI 1.1 use new for create ViewRoot instead
- // of Application.createComponent,
- // we can use it as flag for custom creation.
- riRoot = (UIViewRoot) facesContext.getApplication()
- .createComponent(UIViewRoot.COMPONENT_TYPE);
- // fill properties from default.
- riRoot.setViewId(root.getViewId());
- riRoot.setLocale(root.getLocale());
- String renderKitId = root.getRenderKitId();
- // Fix facelets bug - for debug requests renderKitId is null !
- if (null == renderKitId) {
- renderKitId = calculateRenderKitId(facesContext);
- }
- riRoot.setRenderKitId(renderKitId);
- }
- // if (null ==
- // facesContext.getExternalContext().getRequestMap().get(VIEW_EXPIRED))
- // {
- // Clear ajax request flag ( except new view creation )- for navigation states, full page will be
- // send.
+ riRoot = super.createView(facesContext, viewId);
+ // Reset ajax request status for a navigation case.
if(null != facesContext.getViewRoot()){
ajaxContext.setAjaxRequest(false);
}
- // }
}
return riRoot;
}
@@ -128,8 +100,8 @@
*/
public void writeState(FacesContext context) throws IOException {
AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
- if (ajaxContext.isAjaxRequest()) {
- // TODO - detect case of JSF 1.1 + JSP. for all other we need own
+ if (ajaxContext.isAjaxRequest() && ajaxContext.isSelfRender()) {
+ // We need own
// state marker for
// self-rendered regions only.
// write marker html element - input field. Will be parsed in filter
@@ -139,10 +111,10 @@
writer.startElement(HTML.SPAN_ELEM, null);
writer.writeAttribute(HTML.id_ATTRIBUTE, STATE_MARKER_KEY, null);
writer.writeAttribute(HTML.NAME_ATTRIBUTE, STATE_MARKER_KEY, null);
- // writer.writeAttribute("style", "display:none;", null);
- if (!ajaxContext.isSelfRender()) {
- super.writeState(context);
- }
+// // writer.writeAttribute("style", "display:none;", null);
+// if (!ajaxContext.isSelfRender()) {
+// super.writeState(context);
+// }
writer.endElement(HTML.SPAN_ELEM);
} else {
super.writeState(context);
@@ -158,7 +130,7 @@
public UIViewRoot restoreView(FacesContext context, String viewId) {
UIViewRoot viewRoot = super.restoreView(context, viewId);
ExternalContext externalContext = context.getExternalContext();
- Map requestMap = externalContext.getRequestMap();
+ Map<String, Object> requestMap = externalContext.getRequestMap();
if (null == viewRoot) {
requestMap.put(VIEW_EXPIRED, Messages
.getMessage(Messages.AJAX_VIEW_EXPIRED));
@@ -205,39 +177,12 @@
// Broadcast Ajax events before rendering, to setup areas to update.
if (root instanceof AjaxViewRoot) {
AjaxViewRoot ajaxRoot = (AjaxViewRoot) root;
- Map requestMap = context.getExternalContext().getRequestMap();
// broadcast ajax events before render response.
- if (ajaxContext.isAjaxRequest()
- && null == requestMap
- .get(AjaxRendererUtils.AJAX_AREAS_RENDERED)) {
+ if (ajaxContext.isAjaxRequest()) {
processAjaxEvents(context, ajaxRoot);
}
if (!context.getResponseComplete()) {
super.renderView(context, root);
- if (ajaxContext.isAjaxRequest()
- && null == requestMap
- .get(AjaxRendererUtils.AJAX_AREAS_RENDERED)) {
- // HACK for MyFaces ( <f:view> tag not call renderers )
- if (_log.isDebugEnabled()) {
- _log
- .debug(Messages
- .getMessage(Messages.AJAX_RESPONSE_NOT_RENDERED_INFO));
- }
- ajaxContext.setSelfRender(true);
- // ServletResponse response = (ServletResponse) context
- // .getExternalContext().getResponse();
- Object response = (Object) context.getExternalContext()
- .getResponse();
- try {
- response.getClass().getDeclaredMethod("reset",
- new Class[0]).invoke(response, new Object[0]);
- // response.reset();
- } catch (Exception e) {
- // Do nothing - we will use directly and reset
- // wrapper
- }
- ajaxContext.renderSubmittedAjaxRegion(context, true);
- }
}
} else {
super.renderView(context, root);
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/component/AjaxRegionBrige.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/component/AjaxRegionBrige.java 2008-03-13 20:37:14 UTC (rev 6796)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/component/AjaxRegionBrige.java 2008-03-14 00:24:19 UTC (rev 6797)
@@ -80,8 +80,6 @@
private boolean selfRendered = false;
private boolean selfRenderedSet = false;
- private String submittedControlId;
-
private boolean transientFlag = false;
private UIComponent component ;
@@ -358,19 +356,6 @@
this.transientFlag = transientFlag;
}
- /**
- * @return the submittedControlId
- */
- public String getSubmittedControlId() {
- return submittedControlId;
- }
- /**
- * @param submittedControlId the submittedControlId to set
- */
- public void setSubmittedControlId(String submittedControlId) {
- this.submittedControlId = submittedControlId;
}
-
- }
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/component/AjaxViewRoot.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/component/AjaxViewRoot.java 2008-03-13 20:37:14 UTC (rev 6796)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/component/AjaxViewRoot.java 2008-03-14 00:24:19 UTC (rev 6797)
@@ -22,16 +22,26 @@
package org.ajax4jsf.component;
import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
import java.util.NoSuchElementException;
import javax.el.MethodExpression;
import javax.faces.FacesException;
+import javax.faces.FactoryFinder;
+import javax.faces.component.ContextCallback;
import javax.faces.component.UIComponent;
import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.FacesEvent;
+import javax.faces.event.PhaseEvent;
import javax.faces.event.PhaseId;
+import javax.faces.event.PhaseListener;
+import javax.faces.lifecycle.Lifecycle;
+import javax.faces.lifecycle.LifecycleFactory;
+import javax.faces.webapp.FacesServlet;
import org.ajax4jsf.Messages;
import org.ajax4jsf.context.AjaxContext;
@@ -41,6 +51,8 @@
import org.ajax4jsf.event.AjaxListener;
import org.ajax4jsf.event.EventsQueue;
import org.ajax4jsf.renderkit.AjaxContainerRenderer;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
/**
* Custom ViewRoot for support render parts of tree for Ajax requests. Main
@@ -55,514 +67,580 @@
*/
public class AjaxViewRoot extends UIViewRoot implements AjaxContainer {
- public static final String ROOT_ID = "_viewRoot";
+ public static final String ROOT_ID = "_viewRoot";
- private AjaxRegionBrige _brige;
+ private Lifecycle lifecycle;
- /**
- *
- */
- public AjaxViewRoot() {
- super();
- super.setId(ROOT_ID);
- _brige = new AjaxRegionBrige(this);
- }
+ private AjaxRegionBrige _brige;
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.component.UIComponentBase#getId()
- */
- // public String getId() {
- // return ROOT_ID;
- // }
- public String getRendererType() {
- return (COMPONENT_FAMILY);
- }
+ private static final Log _log = LogFactory.getLog(AjaxViewRoot.class);
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.framework.ajax.AjaxViewBrige#broadcast(javax.faces.event.FacesEvent)
- */
- public void broadcast(FacesEvent event) throws AbortProcessingException {
- super.broadcast(event);
- getBrige().broadcast(event);
- }
+ /**
+ *
+ */
+ public AjaxViewRoot() {
+ super();
+ super.setId(ROOT_ID);
+ _brige = new AjaxRegionBrige(this);
+ }
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.framework.ajax.AjaxViewBrige#getAjaxListener()
- */
- public MethodExpression getAjaxListener() {
- return getBrige().getAjaxListener();
- }
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.faces.component.UIComponentBase#getId()
+ */
+ // public String getId() {
+ // return ROOT_ID;
+ // }
+ public String getRendererType() {
+ return (COMPONENT_FAMILY);
+ }
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.framework.ajax.AjaxViewBrige#isImmediate()
- */
- public boolean isImmediate() {
- return getBrige().isImmediate();
- }
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.framework.ajax.AjaxViewBrige#broadcast(javax.faces.event.FacesEvent)
+ */
+ public void broadcast(FacesEvent event) throws AbortProcessingException {
+ super.broadcast(event);
+ getBrige().broadcast(event);
+ }
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.framework.ajax.AjaxViewBrige#isSubmitted()
- */
- public boolean isSubmitted() {
- return getBrige().isSubmitted();
- }
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.framework.ajax.AjaxViewBrige#getAjaxListener()
+ */
+ public MethodExpression getAjaxListener() {
+ return getBrige().getAjaxListener();
+ }
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.component.UIComponent#queueEvent(javax.faces.event.FacesEvent)
- */
- public void queueEvent(FacesEvent event) {
- if (event == null)
- throw new NullPointerException(Messages
- .getMessage(Messages.NULL_EVENT_SUBMITTED_ERROR));
- if (event.getPhaseId().compareTo(PhaseId.RENDER_RESPONSE) == 0) {
- // HACK - Special case - Ajax Events to RenderResponse phase
- // queue.
- // in future, with JSF 1.2 it must be done by invokeOnComponent
- // method.
- // In 1.1 , events to RENDER_RESPONSE phase not used.
- getAjaxEventsQueue(getFacesContext()).offer(event);
- } else {
- getEventsQueue(getFacesContext(), event.getPhaseId()).offer(event);
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.framework.ajax.AjaxViewBrige#isImmediate()
+ */
+ public boolean isImmediate() {
+ return getBrige().isImmediate();
}
- }
- /**
- * Broadcast events for specified Phase
- *
- * @param context
- * @param phaseId -
- * phase, for wich events must be processed.
- */
- void broadcastEvents(FacesContext context, PhaseId phaseId) {
- EventsQueue[] events = getEvents(context);
- EventsQueue anyPhaseEvents = events[PhaseId.ANY_PHASE.getOrdinal()];
- EventsQueue phaseEvents = events[phaseId.getOrdinal()];
- if (phaseEvents.isEmpty() && anyPhaseEvents.isEmpty())
- return;
- // FacesEvent event = null;
- boolean haveAnyPhaseEvents = !anyPhaseEvents.isEmpty();
- boolean havePhaseEvents = !phaseEvents.isEmpty();
- do {
- // ANY_PHASE first
- processEvents(anyPhaseEvents, haveAnyPhaseEvents);
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.framework.ajax.AjaxViewBrige#isSubmitted()
+ */
+ public boolean isSubmitted() {
+ return getBrige().isSubmitted();
+ }
- processEvents(phaseEvents, havePhaseEvents);
- // Events can queued in other events processing
- haveAnyPhaseEvents = !anyPhaseEvents.isEmpty();
- havePhaseEvents = !phaseEvents.isEmpty();
- } while (haveAnyPhaseEvents || havePhaseEvents);
- if (context.getRenderResponse() || context.getResponseComplete()) {
- clearEvents(context);
+ /**
+ * Use own {@link PhaseListener}'s list, to use with AJAX processing.
+ * phases.
+ */
+ private List<PhaseListener> phaseListeners = null;
+
+ public void removePhaseListener(PhaseListener toRemove) {
+ if (null != phaseListeners) {
+ phaseListeners.remove(toRemove);
+ }
+ super.removePhaseListener(toRemove);
}
- }
+ public void addPhaseListener(PhaseListener newPhaseListener) {
+ if (null == phaseListeners) {
+ phaseListeners = new ArrayList<PhaseListener>();
+ }
+ phaseListeners.add(newPhaseListener);
+ super.addPhaseListener(newPhaseListener);
+ }
- /**
- * @param phaseEventsQueue
- * @param havePhaseEvents
- */
- public void processEvents(EventsQueue phaseEventsQueue, boolean havePhaseEvents) {
- FacesEvent event;
- while (havePhaseEvents) {
- try {
- event = (FacesEvent) phaseEventsQueue.remove();
- UIComponent source = event.getComponent();
- try {
- source.broadcast(event);
- } catch (AbortProcessingException e) {
- // abort event processing
- // Page 3-30 of JSF 1.1 spec: "Throw an
- // AbortProcessingException, to tell the JSF
- // implementation
- // that no further broadcast of this event, or any
- // further
- // events, should take place."
- // clearEvents();
- // return;
+ /**
+ * Send notification to a view-scope phase listeners.
+ *
+ * @param context
+ * @param phase
+ * @param before
+ */
+ protected void processPhaseListeners(FacesContext context, PhaseId phase,
+ boolean before) {
+ MethodExpression listenerExpression = before ? getBeforePhaseListener()
+ : getAfterPhaseListener();
+ PhaseEvent event = null;
+ if (null != listenerExpression) {
+ event = createPhaseEvent(context, phase);
+ listenerExpression.invoke(context.getELContext(),
+ new Object[] { event });
}
- } catch (NoSuchElementException e) {
- havePhaseEvents = false;
- }
+ if (null != this.phaseListeners) {
+ for (PhaseListener listener : phaseListeners) {
+ PhaseId phaseId = listener.getPhaseId();
+ if (phaseId == phase || phaseId == PhaseId.ANY_PHASE) {
+ if (null == event) {
+ event = createPhaseEvent(context, phase);
+ }
+ if (before) {
+ listener.beforePhase(event);
+ } else {
+ listener.afterPhase(event);
+ }
+ }
+ }
+ }
}
- }
- public void broadcastAjaxEvents(FacesContext context) {
- EventsQueue queue = getAjaxEventsQueue(context);
- processEvents(queue, !queue.isEmpty());
- }
+ protected PhaseEvent createPhaseEvent(FacesContext context, PhaseId phaseId)
+ throws FacesException {
+ if (lifecycle == null) {
+ LifecycleFactory lifecycleFactory = (LifecycleFactory) FactoryFinder
+ .getFactory(FactoryFinder.LIFECYCLE_FACTORY);
+ String lifecycleId = context.getExternalContext().getInitParameter(
+ FacesServlet.LIFECYCLE_ID_ATTR);
+ if (lifecycleId == null) {
+ lifecycleId = LifecycleFactory.DEFAULT_LIFECYCLE;
+ }
+ lifecycle = lifecycleFactory.getLifecycle(lifecycleId);
+ }
+ return (new PhaseEvent(context, phaseId, lifecycle));
+ }
- private EventsQueue[] events;
+ protected void processPhase(FacesContext context, PhaseId phase,
+ InvokerCallback callback) {
+ // Process phase listeners before phase.
+ processPhaseListeners(context, phase, true);
+ // Process phase. Run callback method by invokeOnComponent for a
+ // submitted region.
+ if (!(null == callback || context.getRenderResponse() || context
+ .getResponseComplete())) {
+ AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
+ String submittedRegionClientId = ajaxContext
+ .getSubmittedRegionClientId();
+ if (ajaxContext.isAjaxRequest() && submittedRegionClientId != null
+ && !submittedRegionClientId.equals(getClientId(context))) {
+ invokeOnComponent(context, submittedRegionClientId, callback);
+ } else {
+ // For a root region, call invokeRoot method, then process all
+ // facets and children by invoke method.
+ try {
+ callback.invokeRoot(context);
+ } catch (RuntimeException e) {
+ context.renderResponse();
+ throw e;
+ }
+ String ajaxSingleClientId = ajaxContext.getAjaxSingleClientId();
+ if (null == ajaxSingleClientId) {
+ for (Iterator<UIComponent> iter = getFacetsAndChildren(); iter
+ .hasNext();) {
+ callback.invokeContextCallback(context, iter.next());
+ }
+ } else {
+ invokeOnComponent(context, ajaxSingleClientId, callback);
+ }
+ }
+ }
+ // Broadcast phase events.
+ broadcastEvents(context, phase);
+ // Process afterPhase listeners.
+ processPhaseListeners(context, phase, false);
+ }
- private EventsQueue ajaxEvents = new EventsQueue();
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.faces.component.UIComponent#queueEvent(javax.faces.event.FacesEvent)
+ */
+ public void queueEvent(FacesEvent event) {
+ if (event == null)
+ throw new NullPointerException(Messages
+ .getMessage(Messages.NULL_EVENT_SUBMITTED_ERROR));
+ if (event.getPhaseId().compareTo(PhaseId.RENDER_RESPONSE) == 0) {
+ // HACK - Special case - Ajax Events to RenderResponse phase
+ // queue.
+ getAjaxEventsQueue().offer(event);
+ } else {
+ getEventsQueue(event.getPhaseId()).offer(event);
+ }
+ }
- /**
- * Use FIFO buffers for hold Faces Events. Hold this buffers in Request
- * scope parameters for support any concurrent requests for same
- * component tree ( since RI hold component tree in session ).
- *
- * @param context
- * @param phase
- * @return
- */
- protected EventsQueue getEventsQueue(FacesContext context, PhaseId phase) {
- return getEvents(context)[phase.getOrdinal()];
- }
+ /**
+ * Broadcast events for specified Phase
+ *
+ * @param context
+ * @param phaseId -
+ * phase, for which events must be processed.
+ */
+ void broadcastEvents(FacesContext context, PhaseId phaseId) {
+ EventsQueue[] events = getEvents();
+ EventsQueue anyPhaseEvents = events[PhaseId.ANY_PHASE.getOrdinal()];
+ EventsQueue phaseEvents = events[phaseId.getOrdinal()];
+ if (phaseEvents.isEmpty() && anyPhaseEvents.isEmpty())
+ return;
+ // FacesEvent event = null;
+ boolean haveAnyPhaseEvents = !anyPhaseEvents.isEmpty();
+ boolean havePhaseEvents = !phaseEvents.isEmpty();
+ do {
+ // ANY_PHASE first
+ processEvents(context, anyPhaseEvents, haveAnyPhaseEvents);
- /**
- * @return
- */
- protected EventsQueue[] getEvents(FacesContext context) {
- if (events == null) {
- clearEvents(context);
+ processEvents(context, phaseEvents, havePhaseEvents);
+ // Events can queued in other events processing
+ haveAnyPhaseEvents = !anyPhaseEvents.isEmpty();
+ havePhaseEvents = !phaseEvents.isEmpty();
+ } while (haveAnyPhaseEvents || havePhaseEvents);
+ if (context.getRenderResponse() || context.getResponseComplete()) {
+ clearEvents();
+ }
+
}
- return events;
- }
- /**
- * Special Fifo Buffer for ajax events to Render Responce phase.
- *
- * @param context
- * @return
- */
- protected EventsQueue getAjaxEventsQueue(FacesContext context) {
+ /**
+ * @param context
+ * TODO
+ * @param phaseEventsQueue
+ * @param havePhaseEvents
+ */
+ public void processEvents(FacesContext context,
+ EventsQueue phaseEventsQueue, boolean havePhaseEvents) {
+ FacesEvent event;
+ while (havePhaseEvents) {
+ try {
+ event = (FacesEvent) phaseEventsQueue.remove();
+ UIComponent source = event.getComponent();
+ try {
+ source.broadcast(event);
+ } catch (AbortProcessingException e) {
+ if (_log.isErrorEnabled()) {
+ UIComponent component = event.getComponent();
+ String id = null != component ? component
+ .getClientId(context) : "";
+ _log.error(
+ "Error processing faces event for the component "
+ + id, e);
+ }
+ }
+ } catch (NoSuchElementException e) {
+ havePhaseEvents = false;
+ }
+ }
+ }
- return ajaxEvents;
- }
+ public void broadcastAjaxEvents(FacesContext context) {
+ EventsQueue queue = getAjaxEventsQueue();
+ processEvents(context, queue, !queue.isEmpty());
+ }
- public void clearEvents(FacesContext context) {
- int len;
- events = new EventsQueue[len = PhaseId.VALUES.size()];
- for (int i = 0; i < len; i++) {
- events[i] = new EventsQueue();
+ private EventsQueue[] events;
+
+ private EventsQueue ajaxEvents = new EventsQueue();
+
+ /**
+ * Use FIFO buffers for hold Faces Events. Hold this buffers in Request
+ * scope parameters for support any concurrent requests for same component
+ * tree ( since RI hold component tree in session ).
+ *
+ * @param phase
+ *
+ * @return
+ */
+ protected EventsQueue getEventsQueue(PhaseId phase) {
+ return getEvents()[phase.getOrdinal()];
}
- }
- private InvokerCallback _decodeInvoker = new InvokerCallback() {
+ /**
+ * @return
+ */
+ protected EventsQueue[] getEvents() {
+ if (events == null) {
+ clearEvents();
+ }
+ return events;
+ }
- public void invokeContextCallback(FacesContext context, UIComponent component) {
- component.processDecodes(context);
+ /**
+ * Special Fifo Buffer for ajax events to Render Responce phase.
+ *
+ * @return
+ */
+ protected EventsQueue getAjaxEventsQueue() {
+
+ return ajaxEvents;
}
- public void invokeRoot(FacesContext context) {
- AjaxViewRoot.super.processDecodes(context);
+ public void clearEvents() {
+ int len;
+ events = new EventsQueue[len = PhaseId.VALUES.size()];
+ for (int i = 0; i < len; i++) {
+ events[i] = new EventsQueue();
+ }
}
- };
+ private InvokerCallback _decodeInvoker = new InvokerCallback() {
+ public void invokeContextCallback(FacesContext context,
+ UIComponent component) {
+ component.processDecodes(context);
+ }
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.framework.ajax.AjaxViewBrige#processDecodes(javax.faces.context.FacesContext)
- */
- public void processDecodes(FacesContext context) {
- if (context == null)
- throw new NullPointerException("context");
- AjaxContextImpl.invokeOnRegionOrRoot(this, context, _decodeInvoker);
- broadcastEvents(context, PhaseId.APPLY_REQUEST_VALUES);
- }
+ public void invokeRoot(FacesContext context) {
+ decode(context);
+ }
- private InvokerCallback _updatesInvoker = new InvokerCallback() {
+ };
- public void invokeContextCallback(FacesContext context, UIComponent component) {
- component.processUpdates(context);
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.framework.ajax.AjaxViewBrige#processDecodes(javax.faces.context.FacesContext)
+ */
+ public void processDecodes(FacesContext context) {
+ if (context == null)
+ throw new NullPointerException("context");
+ processPhase(context, PhaseId.APPLY_REQUEST_VALUES, _decodeInvoker);
}
- public void invokeRoot(FacesContext context) {
- AjaxViewRoot.super.processUpdates(context);
+ private InvokerCallback _updatesInvoker = new InvokerCallback() {
+
+ public void invokeContextCallback(FacesContext context,
+ UIComponent component) {
+ component.processUpdates(context);
+ }
+
+ public void invokeRoot(FacesContext context) {
+ }
+
+ };
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.framework.ajax.AjaxViewBrige#processUpdates(javax.faces.context.FacesContext)
+ */
+ public void processUpdates(FacesContext context) {
+ if (context == null)
+ throw new NullPointerException("context");
+ processPhase(context, PhaseId.UPDATE_MODEL_VALUES, _updatesInvoker);
}
- };
+ private InvokerCallback _validatorsInvoker = new InvokerCallback() {
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.framework.ajax.AjaxViewBrige#processUpdates(javax.faces.context.FacesContext)
- */
- public void processUpdates(FacesContext context) {
- if (context == null)
- throw new NullPointerException("context");
- AjaxContextImpl.invokeOnRegionOrRoot(this, context, _updatesInvoker);
- broadcastEvents(context, PhaseId.UPDATE_MODEL_VALUES);
- }
+ public void invokeContextCallback(FacesContext context,
+ UIComponent component) {
+ component.processValidators(context);
+ }
- private InvokerCallback _validatorsInvoker = new InvokerCallback() {
+ public void invokeRoot(FacesContext context) {
+ }
- public void invokeContextCallback(FacesContext context, UIComponent component) {
- component.processValidators(context);
+ };
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.framework.ajax.AjaxViewBrige#processValidators(javax.faces.context.FacesContext)
+ */
+ public void processValidators(FacesContext context) {
+ if (context == null)
+ throw new NullPointerException("context");
+ processPhase(context, PhaseId.PROCESS_VALIDATIONS, _validatorsInvoker);
}
- public void invokeRoot(FacesContext context) {
- AjaxViewRoot.super.processValidators(context);
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.faces.component.UIViewRoot#processApplication(javax.faces.context.FacesContext)
+ */
+ public void processApplication(FacesContext context) {
+ if (context == null)
+ throw new NullPointerException("context");
+ processPhase(context, PhaseId.INVOKE_APPLICATION, null);
}
- };
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.faces.component.UIViewRoot#encodeBegin(javax.faces.context.FacesContext)
+ */
+ // public void encodeBegin(FacesContext context) throws IOException {
+ // UIComponent submittedComponent = getSubmittedRegion(context);
+ // if(null == submittedComponent){
+ // super.encodeBegin(context);
+ // } else {
+ // submittedComponent.encodeBegin(context);
+ // }
+ // }
+ private ContextCallback _ajaxInvoker = new ContextCallback() {
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.framework.ajax.AjaxViewBrige#processValidators(javax.faces.context.FacesContext)
- */
- public void processValidators(FacesContext context) {
- if (context == null)
- throw new NullPointerException("context");
- AjaxContextImpl.invokeOnRegionOrRoot(this, context, _validatorsInvoker);
- broadcastEvents(context, PhaseId.PROCESS_VALIDATIONS);
- }
+ public void invokeContextCallback(FacesContext context,
+ UIComponent component) {
+ try {
+ if (component instanceof AjaxContainer) {
+ AjaxContainer ajax = (AjaxContainer) component;
+ ajax.encodeAjax(context);
+ } else {
+ // Container not found, use Root for encode.
+ encodeAjax(context);
+ }
+ } catch (IOException e) {
+ throw new FacesException(e);
+ }
+ }
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.component.UIViewRoot#processApplication(javax.faces.context.FacesContext)
- */
- public void processApplication(FacesContext context) {
- if (context == null)
- throw new NullPointerException("context");
- // UIComponent component = getSubmittedRegion(context);
- // TODO - process JSF 1.2 listeners
- broadcastEvents(context, PhaseId.INVOKE_APPLICATION);
- }
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.component.UIViewRoot#encodeBegin(javax.faces.context.FacesContext)
- */
- // public void encodeBegin(FacesContext context) throws IOException {
- // UIComponent submittedComponent = getSubmittedRegion(context);
- // if(null == submittedComponent){
- // super.encodeBegin(context);
- // } else {
- // submittedComponent.encodeBegin(context);
- // }
- // }
- private InvokerCallback _ajaxInvoker = new InvokerCallback() {
+ };
- public void invokeContextCallback(FacesContext context, UIComponent component) {
- try {
- if (component instanceof AjaxContainer) {
- AjaxContainer ajax = (AjaxContainer) component;
- ajax.encodeAjax(context);
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.faces.component.UIComponentBase#encodeChildren(javax.faces.context.FacesContext)
+ */
+ public void encodeChildren(FacesContext context) throws IOException {
+ AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
+ if (ajaxContext.isAjaxRequest()) {
+ String submittedRegionClientId = ajaxContext
+ .getSubmittedRegionClientId();
+ if (submittedRegionClientId != null
+ && !submittedRegionClientId.equals(getClientId(context))) {
+ invokeOnComponent(context, submittedRegionClientId,
+ _ajaxInvoker);
+ } else {
+ encodeAjax(context);
+ }
} else {
- // Container not found, use Root for encode.
- encodeAjax(context);
+ super.encodeChildren(context);
}
- } catch (IOException e) {
- throw new FacesException(e);
- }
}
- public void invokeRoot(FacesContext context) {
- try {
- encodeAjax(context);
- } catch (IOException e) {
- throw new FacesException(e);
- }
+ public void restoreState(FacesContext context, Object state) {
+ Object[] mystate = (Object[]) state;
+ super.restoreState(context, mystate[0]);
+ getBrige().restoreState(context, mystate[1]);
+ Object listeners = restoreAttachedState(context, mystate[2]);
+ if (null != listeners) {
+ phaseListeners = (List<PhaseListener>) listeners;
+ }
}
- };
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.framework.ajax.AjaxViewBrige#saveState(javax.faces.context.FacesContext)
+ */
+ public Object saveState(FacesContext context) {
+ Object[] state = new Object[3];
+ state[0] = super.saveState(context);
+ state[1] = getBrige().saveState(context);
+ state[2] = saveAttachedState(context, phaseListeners);
+ return state;
+ }
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.component.UIComponentBase#encodeChildren(javax.faces.context.FacesContext)
- */
- public void encodeChildren(FacesContext context) throws IOException {
- if (!isHavePage()
- && AjaxContext.getCurrentInstance(context).isAjaxRequest()) {
- AjaxContextImpl.invokeOnRegionOrRoot(this, context, _ajaxInvoker);
- } else {
- super.encodeChildren(context);
+ public String getViewId() {
+ ViewIdHolder viewIdHolder = AjaxContext.getCurrentInstance()
+ .getViewIdHolder();
+ String viewId;
+ if (null != viewIdHolder) {
+ viewId = viewIdHolder.getViewId();
+ } else {
+ viewId = super.getViewId();
+ }
+ return viewId;
}
- }
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.component.UIComponentBase#encodeEnd(javax.faces.context.FacesContext)
- */
- // public void encodeEnd(FacesContext context) throws IOException {
- // UIComponent submittedComponent = getSubmittedRegion(context);
- // if (null == submittedComponent) {
- // super.encodeEnd(context);
- // } else {
- // submittedComponent.encodeEnd(context);
- // }
- // }
- public void restoreState(FacesContext context, Object state) {
- Object[] mystate = (Object[]) state;
- super.restoreState(context, mystate[0]);
- getBrige().restoreState(context, mystate[1]);
- }
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.framework.ajax.AjaxViewBrige#setAjaxListener(javax.faces.el.MethodBinding)
+ */
+ public void setAjaxListener(MethodExpression ajaxListener) {
+ getBrige().setAjaxListener(ajaxListener);
+ }
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.framework.ajax.AjaxViewBrige#saveState(javax.faces.context.FacesContext)
- */
- public Object saveState(FacesContext context) {
- Object[] state = new Object[2];
- state[0] = super.saveState(context);
- state[1] = getBrige().saveState(context);
- return state;
- }
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.framework.ajax.AjaxViewBrige#setImmediate(boolean)
+ */
+ public void setImmediate(boolean immediate) {
+ getBrige().setImmediate(immediate);
+ }
- public String getViewId() {
- ViewIdHolder viewIdHolder = AjaxContext.getCurrentInstance()
- .getViewIdHolder();
- String viewId;
- if (null != viewIdHolder) {
- viewId = viewIdHolder.getViewId();
- } else {
- viewId = super.getViewId();
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.framework.ajax.AjaxViewBrige#setSubmitted(boolean)
+ */
+ public void setSubmitted(boolean submitted) {
+ getBrige().setSubmitted(submitted);
}
- return viewId;
- }
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.framework.ajax.AjaxViewBrige#setAjaxListener(javax.faces.el.MethodBinding)
- */
- public void setAjaxListener(MethodExpression ajaxListener) {
- getBrige().setAjaxListener(ajaxListener);
- }
+ public void addAjaxListener(AjaxListener listener) {
+ addFacesListener(listener);
+ }
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.framework.ajax.AjaxViewBrige#setImmediate(boolean)
- */
- public void setImmediate(boolean immediate) {
- getBrige().setImmediate(immediate);
- }
+ public AjaxListener[] getAjaxListeners() {
+ return (AjaxListener[]) getFacesListeners(AjaxListener.class);
+ }
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.framework.ajax.AjaxViewBrige#setSubmitted(boolean)
- */
- public void setSubmitted(boolean submitted) {
- getBrige().setSubmitted(submitted);
- }
+ public void removeAjaxListener(AjaxListener listener) {
+ removeFacesListener(listener);
- public void addAjaxListener(AjaxListener listener) {
- addFacesListener(listener);
- }
+ }
- public AjaxListener[] getAjaxListeners() {
- return (AjaxListener[]) getFacesListeners(AjaxListener.class);
- }
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.framework.ajax.AjaxViewBrige#isSelfRendered()
+ */
+ public boolean isSelfRendered() {
+ return false;// _brige.isSelfRendered();
+ }
- public void removeAjaxListener(AjaxListener listener) {
- removeFacesListener(listener);
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.framework.ajax.AjaxViewBrige#setSelfRendered(boolean)
+ */
+ public void setSelfRendered(boolean selfRendered) {
+ // _brige.setSelfRendered(selfRendered);
+ }
- }
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.framework.ajax.AjaxViewBrige#isSelfRendered()
- */
- public boolean isSelfRendered() {
- return false;// _brige.isSelfRendered();
- }
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.faces.component.UIComponentBase#getRendersChildren()
+ */
+ public boolean getRendersChildren() {
+ FacesContext context = FacesContext.getCurrentInstance();
+ // For non Ajax request, view root not render children
+ if (!AjaxContext.getCurrentInstance(context).isAjaxRequest()) {
+ return false;
+ }
+ // Ajax Request. Control all output.
+ return true;
+ }
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.framework.ajax.AjaxViewBrige#setSelfRendered(boolean)
- */
- public void setSelfRendered(boolean selfRendered) {
- // _brige.setSelfRendered(selfRendered);
- }
+ public boolean isRenderRegionOnly() {
+ // for viewroot it not applicable.
+ return false;
+ }
- /**
- * Check for AjaxContainer component in childreh. This is workaround for
- * MyFaces JSP tag implementation, not called any encode... methods in
- * <f:view> tag. If only one AjaxContainer present as children for
- * viewRoot, decoding methods delegated to them.
- *
- * @return Returns the havePage.
- */
- public boolean isHavePage() {
- return (getChildCount() == 1 && getChildren().get(0) instanceof AjaxContainer);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.component.UIComponentBase#getRendersChildren()
- */
- public boolean getRendersChildren() {
- FacesContext context = FacesContext.getCurrentInstance();
- // For non Ajax request, view root not render children
- if (!AjaxContext.getCurrentInstance(context).isAjaxRequest()) {
- return false;
+ public void setRenderRegionOnly(boolean reRenderPage) {
+ // Ignore for a ViewRoot.
}
- // Also, if have page component as clild - delegate rendering of
- // children to it.
- if (isHavePage()) {
- return false;
- }
- // Ajax Request. Control all output.
- return true;
- }
- public boolean isRenderRegionOnly() {
- // for viewroot it not applicable.
- return false;
- }
+ public void encodeAjax(FacesContext context) throws IOException {
+ String rendererType = getRendererType();
+ if (rendererType != null) {
+ ((AjaxContainerRenderer) getRenderer(context)).encodeAjax(context,
+ this);
+ }
- public void setRenderRegionOnly(boolean reRenderPage) {
- // Ignore for a ViewRoot.
-
- }
-
-
-
- /**
- * @return
- * @see org.ajax4jsf.component.AjaxRegionBrige#getSubmittedControlId()
- */
- public String getSubmittedControlId() {
- return _brige.getSubmittedControlId();
}
/**
- * @param submittedControlId
- * @see org.ajax4jsf.component.AjaxRegionBrige#setSubmittedControlId(java.lang.String)
+ * @return the brige
*/
- public void setSubmittedControlId(String submittedControlId) {
- _brige.setSubmittedControlId(submittedControlId);
+ protected AjaxRegionBrige getBrige() {
+ return _brige;
}
- public void encodeAjax(FacesContext context) throws IOException {
- String rendererType = getRendererType();
- if (rendererType != null) {
- ((AjaxContainerRenderer) getRenderer(context)).encodeAjax(context,
- this);
- }
-
- }
-
- /**
- * @return the brige
- */
- protected AjaxRegionBrige getBrige() {
- return _brige;
- }
-
}
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxChildrenRenderer.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxChildrenRenderer.java 2008-03-13 20:37:14 UTC (rev 6796)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxChildrenRenderer.java 2008-03-14 00:24:19 UTC (rev 6797)
@@ -50,24 +50,6 @@
"org.apache.myfaces.AliasBeansScope" };
private static final String SPECIAL_TYPES_PARAMETER = "org.ajax4jsf.CONTROL_COMPONENTS";
- /**
- * Iterate over all childs of components. If component id contains in list ,
- * or, if list is empty, compotents is submitted form - render it. TODO -
- * Instead of calculate full path for every component, build current Path
- * for componet and send as parameter.
- *
- * @param context -
- * current context
- * @param component -
- * curent faces component.
- * @param ids -
- * list of Id to render.
- * @throws IOException
- * @deprecated Use {@link #encodeAjaxChildren(FacesContext,UIComponent,String,Set,Set)} instead
- */
- public void encodeAjaxChild(FacesContext context, UIComponent component, String path, Set<String> ids, Set<String> renderedAreas) throws IOException {
- encodeAjaxChildren(context, component, path, ids, renderedAreas);
- }
/* (non-Javadoc)
* @see org.ajax4jsf.renderkit.AjaxRenderer#encodeAjaxChildren(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.String, java.util.Set, java.util.Set)
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxContainerRenderer.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxContainerRenderer.java 2008-03-13 20:37:14 UTC (rev 6796)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxContainerRenderer.java 2008-03-14 00:24:19 UTC (rev 6797)
@@ -156,7 +156,6 @@
AjaxContainer ajaxContainer = (AjaxContainer) component;
if (null != ajaxParameter && ajaxParameter.equals(clientId)) {
ajaxContainer.setSubmitted(true);
- ajaxContainer.setSubmittedControlId(paramMap.get(AjaxRendererUtils.AJAX_SINGLE_ATTR));
AjaxEvent event = new AjaxEvent(component);
component.queueEvent(event);
} else {
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxViewRootRenderer.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxViewRootRenderer.java 2008-03-13 20:37:14 UTC (rev 6796)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxViewRootRenderer.java 2008-03-14 00:24:19 UTC (rev 6797)
@@ -46,23 +46,6 @@
}
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.renderkit.RendererBase#doDecode(javax.faces.context.FacesContext,
- * javax.faces.component.UIComponent)
- */
-// protected void doDecode(FacesContext context, UIComponent component) {
-// AjaxViewRoot root = (AjaxViewRoot) component;
-// if(root.isSubmitted()) {
-// // Find submitted ajax region.
-// String ajaxId = (String) context.getExternalContext().getRequestParameterMap().get(AJAX_PARAMETER_NAME);
-// String ajaxRegion = root.getAjaxRegionId(ajaxId);
-// if(null != ajaxRegion){
-// root.setSubmittedRegion(ajaxRegion);
-// }
-// }
-// }
/*
* (non-Javadoc)
@@ -73,38 +56,5 @@
return AjaxViewRoot.class;
}
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.renderkit.RendererBase#doEncodeEnd(javax.faces.context.ResponseWriter,
- * javax.faces.context.FacesContext, javax.faces.component.UIComponent)
- */
-// protected void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
-// UIComponent submittedComponent = ((AjaxViewRoot) component).getSubmittedRegion(context);
-// if (null == submittedComponent) {
-// super.doEncodeEnd(writer,context,component);
-// } else {
-// submittedComponent.encodeEnd(context);
-// }
-// }
-
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.renderkit.RendererBase#doEncodeBegin(javax.faces.context.ResponseWriter,
- * javax.faces.context.FacesContext, javax.faces.component.UIComponent)
- */
-// protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
-// // Reset instance of submitted region
-// AjaxViewRoot ajaxViewRoot = ((AjaxViewRoot) component);
-// ajaxViewRoot.resetSubmittedRegionInstance();
-// UIComponent submittedComponent = ajaxViewRoot.getSubmittedRegion(context);
-// if (null == submittedComponent) {
-// super.doEncodeBegin(writer, context, component);
-// } else {
-// submittedComponent.encodeBegin(context);
-// }
-// }
-
}
Added: trunk/framework/test/src/main/java/org/ajax4jsf/tests/MockUIComponent.java
===================================================================
--- trunk/framework/test/src/main/java/org/ajax4jsf/tests/MockUIComponent.java (rev 0)
+++ trunk/framework/test/src/main/java/org/ajax4jsf/tests/MockUIComponent.java 2008-03-14 00:24:19 UTC (rev 6797)
@@ -0,0 +1,114 @@
+/**
+ *
+ */
+package org.ajax4jsf.tests;
+
+import javax.faces.FacesException;
+import javax.faces.component.ContextCallback;
+import javax.faces.component.UIComponentBase;
+import javax.faces.context.FacesContext;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.FacesEvent;
+
+/**
+ * "probe" component, to chek runs of the component methods during tests.
+ * @author asmirnov
+ *
+ */
+public class MockUIComponent extends UIComponentBase {
+
+ private int runsProcessDecodes = 0;
+ private int runsDecode = 0;
+ private int runsBroadcast=0;
+ private int runsInvokeOnComponent=0;
+ private int runsProcessUpdates=0;
+ private int runsProcessValidators=0;
+
+ /**
+ * @return the runsProcessDecodes
+ */
+ public int getRunsProcessDecodes() {
+ return runsProcessDecodes;
+ }
+
+ /**
+ * @return the runsDecode
+ */
+ public int getRunsDecode() {
+ return runsDecode;
+ }
+
+ /**
+ * @return the runsBroadcast
+ */
+ public int getRunsBroadcast() {
+ return runsBroadcast;
+ }
+
+ /**
+ * @return the runsInvokeOnComponent
+ */
+ public int getRunsInvokeOnComponent() {
+ return runsInvokeOnComponent;
+ }
+
+ /**
+ * @return the runsProcessUpdates
+ */
+ public int getRunsProcessUpdates() {
+ return runsProcessUpdates;
+ }
+
+ /**
+ * @return the runsProcessValidators
+ */
+ public int getRunsProcessValidators() {
+ return runsProcessValidators;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.component.UIComponent#getFamily()
+ */
+ @Override
+ public String getFamily() {
+ // TODO Auto-generated method stub
+ return "org.ajax4jsf.test";
+ }
+
+ @Override
+ public void processDecodes(FacesContext context) {
+ runsProcessDecodes++;
+ super.processDecodes(context);
+ }
+
+ @Override
+ public void decode(FacesContext context) {
+ runsDecode++;
+ super.decode(context);
+ }
+
+ @Override
+ public void broadcast(FacesEvent event) throws AbortProcessingException {
+ runsBroadcast++;
+ super.broadcast(event);
+ }
+
+ @Override
+ public boolean invokeOnComponent(FacesContext context, String clientId,
+ ContextCallback callback) throws FacesException {
+ runsInvokeOnComponent++;
+ return super.invokeOnComponent(context, clientId, callback);
+ }
+
+ @Override
+ public void processUpdates(FacesContext context) {
+ runsProcessUpdates++;
+ super.processUpdates(context);
+ }
+
+ @Override
+ public void processValidators(FacesContext context) {
+ runsProcessValidators++;
+ super.processValidators(context);
+ }
+}
Property changes on: trunk/framework/test/src/main/java/org/ajax4jsf/tests/MockUIComponent.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Modified: trunk/framework/test/src/main/java/org/ajax4jsf/tests/MockViewRoot.java
===================================================================
--- trunk/framework/test/src/main/java/org/ajax4jsf/tests/MockViewRoot.java 2008-03-13 20:37:14 UTC (rev 6796)
+++ trunk/framework/test/src/main/java/org/ajax4jsf/tests/MockViewRoot.java 2008-03-14 00:24:19 UTC (rev 6797)
@@ -21,7 +21,6 @@
package org.ajax4jsf.tests;
-import javax.faces.context.FacesContext;
import javax.faces.event.PhaseId;
import org.ajax4jsf.component.AjaxViewRoot;
@@ -34,16 +33,16 @@
*/
public class MockViewRoot extends AjaxViewRoot {
- public EventsQueue getAjaxEventsQueue(FacesContext context) {
- return super.getAjaxEventsQueue(context);
+ public EventsQueue getAjaxEventsQueue() {
+ return super.getAjaxEventsQueue();
}
- public EventsQueue[] getEvents(FacesContext context) {
- return super.getEvents(context);
+ public EventsQueue[] getEvents() {
+ return super.getEvents();
}
- public EventsQueue getEventsQueue(FacesContext context, PhaseId phase) {
- return super.getEventsQueue(context, phase);
+ public EventsQueue getEventsQueue(PhaseId phase) {
+ return super.getEventsQueue(phase);
}
}
Added: trunk/framework/test/src/test/java/org/ajax4jsf/component/AjaxViewRootTest.java
===================================================================
--- trunk/framework/test/src/test/java/org/ajax4jsf/component/AjaxViewRootTest.java (rev 0)
+++ trunk/framework/test/src/test/java/org/ajax4jsf/component/AjaxViewRootTest.java 2008-03-14 00:24:19 UTC (rev 6797)
@@ -0,0 +1,289 @@
+package org.ajax4jsf.component;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.el.MethodExpression;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIPanel;
+import javax.faces.context.FacesContext;
+import javax.faces.event.PhaseEvent;
+import javax.faces.event.PhaseId;
+import javax.faces.event.PhaseListener;
+import javax.faces.render.RenderKitFactory;
+
+import org.ajax4jsf.context.AjaxContext;
+import org.ajax4jsf.context.InvokerCallback;
+import org.ajax4jsf.renderkit.AjaxContainerRenderer;
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+import org.ajax4jsf.tests.MockUIComponent;
+
+public class AjaxViewRootTest extends AbstractAjax4JsfTestCase {
+
+ /**
+ * @author asmirnov
+ *
+ */
+ public static class InvokerCallbackImpl implements InvokerCallback {
+
+ private int runsRoot = 0;
+
+ private List<UIComponent> callbackComponents = new ArrayList<UIComponent>();
+
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.context.InvokerCallback#invokeContextCallback(javax.faces.context.FacesContext, javax.faces.component.UIComponent)
+ */
+ public void invokeContextCallback(FacesContext context,
+ UIComponent component) {
+ callbackComponents.add(component);
+ }
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.context.InvokerCallback#invokeRoot(javax.faces.context.FacesContext)
+ */
+ public void invokeRoot(FacesContext context) {
+ runsRoot++;
+
+ }
+
+ }
+
+ public static final class PhaseListenerImplementation implements PhaseListener {
+ private int runsBefore = 0;
+ private int runsAfter = 0;
+ private PhaseId phase = PhaseId.ANY_PHASE;
+
+ public void afterPhase(PhaseEvent event) {
+ runsAfter++;
+ }
+
+ public void beforePhase(PhaseEvent event) {
+ runsBefore++;
+
+ }
+
+ public PhaseId getPhaseId() {
+
+ return phase;
+ }
+
+ /**
+ * @return the runsBefore
+ */
+ int getRunsBefore() {
+ return runsBefore;
+ }
+
+ /**
+ * @return the runsAfter
+ */
+ int getRunsAfter() {
+ return runsAfter;
+ }
+
+ /**
+ * @param phase the phase to set
+ */
+ void setPhaseId(PhaseId phase) {
+ this.phase = phase;
+ }
+ }
+
+ private AjaxViewRoot _ajaxRoot;
+ private PhaseListenerImplementation _testListener;
+ private PhaseListenerImplementation _phaseListener;
+ private MockUIComponent _panel;
+ private MockUIComponent _mockComponent;
+
+ public AjaxViewRootTest(String name) {
+ super(name);
+ }
+
+ public void setUp() throws Exception {
+ super.setUp();
+ _ajaxRoot = new AjaxViewRoot();
+ _ajaxRoot.setViewId("/viewId");
+ _ajaxRoot.setRenderKitId(RenderKitFactory.HTML_BASIC_RENDER_KIT);
+ _testListener = new PhaseListenerImplementation();
+ externalContext.getRequestMap().put("listener", _testListener);
+ facesContext.setViewRoot(_ajaxRoot);
+ }
+
+ public void tearDown() throws Exception {
+ _ajaxRoot = null;
+ _testListener = null;
+ super.tearDown();
+ }
+
+ public final void testProcessPhaseListeners() {
+ MethodExpression beforeExpression = application.getExpressionFactory().createMethodExpression(elContext, "#{listener.beforePhase}", null, new Class<?>[]{PhaseEvent.class});
+ MethodExpression afterExpression = application.getExpressionFactory().createMethodExpression(elContext, "#{listener.afterPhase}", null, new Class<?>[]{PhaseEvent.class});
+ _ajaxRoot.setBeforePhaseListener(beforeExpression);
+ _ajaxRoot.setAfterPhaseListener(afterExpression);
+ PhaseListenerImplementation phaseListener = new PhaseListenerImplementation();
+ _ajaxRoot.addPhaseListener(phaseListener);
+ _ajaxRoot.processPhaseListeners(facesContext, PhaseId.RESTORE_VIEW, true);
+ assertEquals(1, this._testListener.runsBefore);
+ assertEquals(0, this._testListener.runsAfter);
+ assertEquals(1, phaseListener.runsBefore);
+ assertEquals(0, phaseListener.runsAfter);
+ phaseListener.setPhaseId(PhaseId.PROCESS_VALIDATIONS);
+ _ajaxRoot.processPhaseListeners(facesContext, PhaseId.RESTORE_VIEW, false);
+ assertEquals(1, this._testListener.runsBefore);
+ assertEquals(1, this._testListener.runsAfter);
+ assertEquals(1, phaseListener.runsBefore);
+ assertEquals(0, phaseListener.runsAfter);
+ }
+
+ public final void testCreatePhaseEvent() {
+ PhaseEvent phaseEvent = _ajaxRoot.createPhaseEvent(facesContext, PhaseId.APPLY_REQUEST_VALUES);
+ assertSame(facesContext, phaseEvent.getFacesContext());
+ assertSame(PhaseId.APPLY_REQUEST_VALUES, phaseEvent.getPhaseId());
+ assertSame(lifecycle, phaseEvent.getSource());
+ }
+
+ public final void testProcessPhase() {
+ prepareView(PhaseId.APPLY_REQUEST_VALUES);
+ InvokerCallbackImpl callback = new InvokerCallbackImpl(){
+ @Override
+ public void invokeContextCallback(FacesContext context,
+ UIComponent component) {
+ super.invokeContextCallback(context, component);
+ component.processDecodes(context);
+ }
+ };
+ _ajaxRoot.processPhase(facesContext, PhaseId.APPLY_REQUEST_VALUES, callback);
+ // Check phase listeners calls.
+ assertEquals(1, this._testListener.runsBefore);
+ assertEquals(1, this._testListener.runsAfter);
+ assertEquals(1, _phaseListener.runsBefore);
+ assertEquals(1, _phaseListener.runsAfter);
+ // Check callbacks runs.
+ assertEquals(1, callback.runsRoot);
+ assertEquals(1, callback.callbackComponents.size());
+ assertSame(_panel,callback.callbackComponents.get(0));
+ assertEquals(1, _mockComponent.getRunsDecode());
+
+ }
+
+ public final void testProcessAjaxPhase() {
+ externalContext.addRequestParameterMap(AjaxContext.AJAX_CONTEXT_KEY, _ajaxRoot.getClientId(facesContext));
+ ajaxContext.decode(facesContext);
+ prepareView(PhaseId.APPLY_REQUEST_VALUES);
+ InvokerCallbackImpl callback = new InvokerCallbackImpl(){
+ @Override
+ public void invokeContextCallback(FacesContext context,
+ UIComponent component) {
+ super.invokeContextCallback(context, component);
+ component.processDecodes(context);
+ }
+ };
+ _ajaxRoot.processPhase(facesContext, PhaseId.APPLY_REQUEST_VALUES, callback);
+ // Check phase listeners calls.
+ assertEquals(1, this._testListener.runsBefore);
+ assertEquals(1, this._testListener.runsAfter);
+ assertEquals(1, _phaseListener.runsBefore);
+ assertEquals(1, _phaseListener.runsAfter);
+ // Check callbacks runs.
+ assertEquals(1, callback.runsRoot);
+ assertEquals(1, callback.callbackComponents.size());
+ assertSame(_panel,callback.callbackComponents.get(0));
+ assertEquals(1, _mockComponent.getRunsDecode());
+
+ }
+
+ public final void testProcessAjaxRegionPhase() {
+ prepareView(PhaseId.APPLY_REQUEST_VALUES);
+ externalContext.addRequestParameterMap(AjaxContainerRenderer.AJAX_PARAMETER_NAME, _mockComponent.getClientId(facesContext));
+ ajaxContext.decode(facesContext);
+ InvokerCallbackImpl callback = new InvokerCallbackImpl(){
+ @Override
+ public void invokeContextCallback(FacesContext context,
+ UIComponent component) {
+ super.invokeContextCallback(context, component);
+ component.processDecodes(context);
+ }
+ };
+ _ajaxRoot.processPhase(facesContext, PhaseId.APPLY_REQUEST_VALUES, callback);
+ // Check phase listeners calls.
+ assertEquals(1, this._testListener.runsBefore);
+ assertEquals(1, this._testListener.runsAfter);
+ assertEquals(1, _phaseListener.runsBefore);
+ assertEquals(1, _phaseListener.runsAfter);
+ // Check callbacks runs.
+ assertEquals(0, callback.runsRoot);
+ assertEquals(1, callback.callbackComponents.size());
+ assertSame(_mockComponent,callback.callbackComponents.get(0));
+ assertEquals(1, _mockComponent.getRunsDecode());
+
+ }
+ /**
+ * @param phaseId TODO
+ *
+ */
+ private void prepareView(PhaseId phaseId) {
+ MethodExpression beforeExpression = application.getExpressionFactory().createMethodExpression(elContext, "#{listener.beforePhase}", null, new Class<?>[]{PhaseEvent.class});
+ MethodExpression afterExpression = application.getExpressionFactory().createMethodExpression(elContext, "#{listener.afterPhase}", null, new Class<?>[]{PhaseEvent.class});
+ _ajaxRoot.setBeforePhaseListener(beforeExpression);
+ _ajaxRoot.setAfterPhaseListener(afterExpression);
+ _phaseListener = new PhaseListenerImplementation();
+ _phaseListener.setPhaseId(phaseId);
+ _ajaxRoot.addPhaseListener(_phaseListener);
+ _panel = new MockUIComponent();
+ _panel.setId("panel");
+ _mockComponent = new MockUIComponent();
+ _mockComponent.setId("component");
+ _panel.getChildren().add(_mockComponent);
+ _ajaxRoot.getChildren().add(_panel);
+ }
+
+
+
+ public final void testProcessDecodes() {
+ prepareView(PhaseId.APPLY_REQUEST_VALUES);
+ externalContext.addRequestParameterMap(AjaxContainerRenderer.AJAX_PARAMETER_NAME, _mockComponent.getClientId(facesContext));
+ ajaxContext.decode(facesContext);
+ _ajaxRoot.processDecodes(facesContext);
+ // Check phase listeners calls.
+ assertEquals(1, this._testListener.runsBefore);
+ assertEquals(1, this._testListener.runsAfter);
+ assertEquals(1, _phaseListener.runsBefore);
+ assertEquals(1, _phaseListener.runsAfter);
+ assertEquals(0, _panel.getRunsDecode());
+ assertEquals(1, _mockComponent.getRunsDecode());
+ }
+
+ public final void testQueueEventFacesEvent() {
+ // fail("Not yet implemented");
+ }
+
+ public final void testBroadcastEvents() {
+ // fail("Not yet implemented");
+ }
+
+ public final void testProcessEvents() {
+ // fail("Not yet implemented");
+ }
+
+ public final void testBroadcastAjaxEvents() {
+ // fail("Not yet implemented");
+ }
+
+ public final void testGetEventsQueue() {
+ // fail("Not yet implemented");
+ }
+
+ public final void testGetEvents() {
+ // fail("Not yet implemented");
+ }
+
+ public final void testGetAjaxEventsQueue() {
+ // fail("Not yet implemented");
+ }
+
+ public final void testClearEvents() {
+ // fail("Not yet implemented");
+ }
+
+}
Property changes on: trunk/framework/test/src/test/java/org/ajax4jsf/component/AjaxViewRootTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/component/UIAjaxRegion.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/component/UIAjaxRegion.java 2008-03-13 20:37:14 UTC (rev 6796)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/component/UIAjaxRegion.java 2008-03-14 00:24:19 UTC (rev 6797)
@@ -22,9 +22,11 @@
package org.ajax4jsf.component;
import java.io.IOException;
+import java.util.Iterator;
import javax.el.MethodExpression;
import javax.faces.FacesException;
+import javax.faces.component.ContextCallback;
import javax.faces.component.UIComponent;
import javax.faces.component.UIPanel;
import javax.faces.component.UIViewRoot;
@@ -47,6 +49,27 @@
private AjaxRegionBrige brige;
+ private static final ContextCallback decodeCallback= new ContextCallback(){
+ public void invokeContextCallback(FacesContext context,
+ UIComponent target) {
+ target.processDecodes(context);
+ }
+ };
+
+ private static final ContextCallback validateCallback= new ContextCallback(){
+ public void invokeContextCallback(FacesContext context,
+ UIComponent target) {
+ target.processValidators(context);
+ }
+ };
+
+ private static final ContextCallback updateCallback= new ContextCallback(){
+ public void invokeContextCallback(FacesContext context,
+ UIComponent target) {
+ target.processUpdates(context);
+ }
+ };
+
public static final String COMPONENT_TYPE = "org.ajax4jsf.AjaxRegion";
/**
@@ -56,64 +79,50 @@
brige = new AjaxRegionBrige(this);
}
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.component.UIComponentBase#encodeBegin(javax.faces.context.FacesContext)
- */
-// public void encodeBegin(FacesContext context) throws IOException {
-// UIViewRoot root = context.getViewRoot();
-// if (root instanceof AjaxViewRoot) {
-// ((AjaxViewRoot) root).addAjaxRegion(this);
-// }
-// super.encodeBegin(context);
-// }
-
- private InvokerCallback _ajaxInvoker = new InvokerCallback() {
-
- public void invokeContextCallback(FacesContext context, UIComponent component) {
- try {
- if (component instanceof AjaxContainer) {
- AjaxContainer ajax = (AjaxContainer) component;
- ajax.encodeAjax(context);
- } else {
- // Container not found, use Root for encode.
- encodeAjax(context);
- }
- } catch (IOException e) {
- throw new FacesException(e);
- }
+ @Override
+ public void processDecodes(FacesContext context) {
+ AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
+ String ajaxSingleClientId = ajaxContext.getAjaxSingleClientId();
+ // Process this component itself
+ try {
+ decode(context);
+ } catch (RuntimeException e) {
+ context.renderResponse();
+ throw e;
}
-
- public void invokeRoot(FacesContext context) {
- try {
- encodeAjax(context);
- } catch (IOException e) {
- throw new FacesException(e);
+ if (ajaxContext.isAjaxRequest() && null != ajaxSingleClientId) {
+ invokeOnComponent(context, ajaxSingleClientId, decodeCallback);
+ } else {
+ // Process all facets and children of this component
+ Iterator<UIComponent> kids = getFacetsAndChildren();
+ while (kids.hasNext()) {
+ UIComponent kid = kids.next();
+ kid.processDecodes(context);
}
}
- };
+ }
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.component.UIComponentBase#encodeChildren(javax.faces.context.FacesContext)
- */
- public void encodeChildren(FacesContext context) throws IOException {
- // If this region is single child of ViewRoot, encode Ajax response for
- // submitted container.
- UIViewRoot viewRoot = context.getViewRoot();
+ @Override
+ public void processValidators(FacesContext context) {
AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
- if ( (getParent() == viewRoot) &&
- (viewRoot instanceof AjaxViewRoot) &&
- ((AjaxViewRoot) viewRoot).isHavePage() &&
- (ajaxContext.isAjaxRequest())) {
- AjaxContextImpl.invokeOnRegionOrRoot((AjaxViewRoot) viewRoot, context, _ajaxInvoker);
+ String ajaxSingleClientId = ajaxContext.getAjaxSingleClientId();
+ if (ajaxContext.isAjaxRequest() && null != ajaxSingleClientId) {
+ invokeOnComponent(context, ajaxSingleClientId, validateCallback);
} else {
- super.encodeChildren(context);
+ super.processValidators(context);
}
}
+ @Override
+ public void processUpdates(FacesContext context) {
+ AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
+ String ajaxSingleClientId = ajaxContext.getAjaxSingleClientId();
+ if (ajaxContext.isAjaxRequest() && null != ajaxSingleClientId) {
+ invokeOnComponent(context, ajaxSingleClientId, updateCallback);
+ } else {
+ super.processUpdates(context);
+ }
+ }
/*
* (non-Javadoc)
*
@@ -242,13 +251,6 @@
}
- /**
- * @return
- * @see org.ajax4jsf.component.AjaxRegionBrige#getSubmittedControlId()
- */
- public String getSubmittedControlId() {
- return brige.getSubmittedControlId();
- }
/**
* @return
@@ -258,13 +260,6 @@
return brige.isTransient();
}
- /**
- * @param submittedControlId
- * @see org.ajax4jsf.component.AjaxRegionBrige#setSubmittedControlId(java.lang.String)
- */
- public void setSubmittedControlId(String submittedControlId) {
- brige.setSubmittedControlId(submittedControlId);
- }
/**
* @param transientFlag
Modified: trunk/ui/drag-drop/src/test/java/org/richfaces/component/DragDropTest.java
===================================================================
--- trunk/ui/drag-drop/src/test/java/org/richfaces/component/DragDropTest.java 2008-03-13 20:37:14 UTC (rev 6796)
+++ trunk/ui/drag-drop/src/test/java/org/richfaces/component/DragDropTest.java 2008-03-14 00:24:19 UTC (rev 6797)
@@ -198,7 +198,7 @@
MockViewRoot root = (MockViewRoot) facesContext.getViewRoot();
EventsQueue queue = root
- .getEventsQueue(facesContext, PhaseId.ANY_PHASE);
+ .getEventsQueue(PhaseId.ANY_PHASE);
assertNotNull(queue);
while (true) {
try {
Modified: trunk/ui/menu-components/src/test/java/org/richfaces/component/MenuItemComponentTest.java
===================================================================
--- trunk/ui/menu-components/src/test/java/org/richfaces/component/MenuItemComponentTest.java 2008-03-13 20:37:14 UTC (rev 6796)
+++ trunk/ui/menu-components/src/test/java/org/richfaces/component/MenuItemComponentTest.java 2008-03-14 00:24:19 UTC (rev 6797)
@@ -320,8 +320,7 @@
menuItem.decode(facesContext);
MockViewRoot mockViewRoot = (MockViewRoot) facesContext.getViewRoot();
- EventsQueue events = mockViewRoot.getEventsQueue(facesContext,
- PhaseId.APPLY_REQUEST_VALUES);
+ EventsQueue events = mockViewRoot.getEventsQueue(PhaseId.APPLY_REQUEST_VALUES);
assertNotNull(events);
assertEquals(1, events.size());
}
@@ -339,8 +338,7 @@
menuItem.decode(facesContext);
MockViewRoot mockViewRoot = (MockViewRoot) facesContext.getViewRoot();
- EventsQueue events = mockViewRoot.getEventsQueue(facesContext,
- PhaseId.INVOKE_APPLICATION);
+ EventsQueue events = mockViewRoot.getEventsQueue(PhaseId.INVOKE_APPLICATION);
assertNotNull(events);
assertEquals(1, events.size());
}
Modified: trunk/ui/panelbar/src/test/java/org/richfaces/component/PanelBarComponentTest.java
===================================================================
--- trunk/ui/panelbar/src/test/java/org/richfaces/component/PanelBarComponentTest.java 2008-03-13 20:37:14 UTC (rev 6796)
+++ trunk/ui/panelbar/src/test/java/org/richfaces/component/PanelBarComponentTest.java 2008-03-14 00:24:19 UTC (rev 6797)
@@ -255,8 +255,7 @@
panelBar.decode(facesContext);
MockViewRoot mockViewRoot = (MockViewRoot) facesContext.getViewRoot();
- EventsQueue events = mockViewRoot.getEventsQueue(facesContext,
- PhaseId.APPLY_REQUEST_VALUES);
+ EventsQueue events = mockViewRoot.getEventsQueue(PhaseId.APPLY_REQUEST_VALUES);
assertNotNull(events);
assertEquals(1, events.size());
@@ -275,8 +274,7 @@
panelBar.decode(facesContext);
MockViewRoot mockViewRoot = (MockViewRoot) facesContext.getViewRoot();
- EventsQueue events = mockViewRoot.getEventsQueue(facesContext,
- PhaseId.INVOKE_APPLICATION);
+ EventsQueue events = mockViewRoot.getEventsQueue(PhaseId.INVOKE_APPLICATION);
assertNotNull(events);
assertEquals(0, events.size());
}
Modified: trunk/ui/togglePanel/src/test/java/org/richfaces/component/TogglePanelComponentTest.java
===================================================================
--- trunk/ui/togglePanel/src/test/java/org/richfaces/component/TogglePanelComponentTest.java 2008-03-13 20:37:14 UTC (rev 6796)
+++ trunk/ui/togglePanel/src/test/java/org/richfaces/component/TogglePanelComponentTest.java 2008-03-14 00:24:19 UTC (rev 6797)
@@ -335,8 +335,7 @@
toggleControl.decode(facesContext);
MockViewRoot mockViewRoot = (MockViewRoot) facesContext.getViewRoot();
- EventsQueue events = mockViewRoot.getEventsQueue(facesContext,
- PhaseId.APPLY_REQUEST_VALUES);
+ EventsQueue events = mockViewRoot.getEventsQueue(PhaseId.APPLY_REQUEST_VALUES);
assertNotNull(events);
assertEquals(2, events.size());
@@ -345,8 +344,7 @@
SwitchablePanelSwitchEvent switchEvent = (SwitchablePanelSwitchEvent) event;
assertEquals(switchEvent.getValue(), "ABYBC");
- events = mockViewRoot.getEventsQueue(facesContext,
- PhaseId.INVOKE_APPLICATION);
+ events = mockViewRoot.getEventsQueue(PhaseId.INVOKE_APPLICATION);
assertNotNull(events);
assertEquals(1, events.size());
@@ -370,8 +368,7 @@
togglePanel.decode(facesContext);
MockViewRoot mockViewRoot = (MockViewRoot) facesContext.getViewRoot();
- EventsQueue events = mockViewRoot.getEventsQueue(facesContext,
- PhaseId.INVOKE_APPLICATION);
+ EventsQueue events = mockViewRoot.getEventsQueue(PhaseId.INVOKE_APPLICATION);
assertNotNull(events);
assertEquals(0, events.size());
@@ -384,8 +381,7 @@
togglePanel.decode(facesContext);
mockViewRoot = (MockViewRoot) facesContext.getViewRoot();
- events = mockViewRoot.getEventsQueue(facesContext,
- PhaseId.INVOKE_APPLICATION);
+ events = mockViewRoot.getEventsQueue(PhaseId.INVOKE_APPLICATION);
assertNotNull(events);
assertEquals(0, events.size());
}
Modified: trunk/ui/tree/src/test/java/org/richfaces/component/events/TreeEventsTest.java
===================================================================
--- trunk/ui/tree/src/test/java/org/richfaces/component/events/TreeEventsTest.java 2008-03-13 20:37:14 UTC (rev 6796)
+++ trunk/ui/tree/src/test/java/org/richfaces/component/events/TreeEventsTest.java 2008-03-14 00:24:19 UTC (rev 6797)
@@ -102,7 +102,7 @@
MockMethodBinding binding = new MockMethodBinding();
treeNode.setNodeSelectListener(binding);
- EventsQueue events = mockViewRoot.getAjaxEventsQueue(facesContext);
+ EventsQueue events = mockViewRoot.getAjaxEventsQueue();
assertNotNull(events);
assertEquals(0, events.size());
@@ -125,7 +125,7 @@
MockMethodBinding binding = new MockMethodBinding();
treeNode.setNodeSelectListener(binding);
- EventsQueue events = mockViewRoot.getAjaxEventsQueue(facesContext);
+ EventsQueue events = mockViewRoot.getAjaxEventsQueue();
assertNotNull(events);
assertEquals(0, events.size());
assertEquals(0, binding.getInvocationArgs().length);
16 years, 10 months
JBoss Rich Faces SVN: r6796 - in trunk: docs/userguide/en/src/main/docbook and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: vsukhov
Date: 2008-03-13 16:37:14 -0400 (Thu, 13 Mar 2008)
New Revision: 6796
Added:
trunk/docs/userguide/en/src/main/docbook/included/fileUpload.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/fileUpload.xml
trunk/docs/userguide/en/src/main/resources/images/fileUpload.png
trunk/docs/userguide/en/src/main/resources/images/fileUpload2.png
trunk/docs/userguide/en/src/main/resources/images/fileUpload5.png
trunk/docs/userguide/en/src/main/resources/images/fileUpload6.png
Modified:
trunk/docs/userguide/en/src/main/docbook/included/comboBox.xml
trunk/docs/userguide/en/src/main/docbook/included/componentControl.xml
trunk/docs/userguide/en/src/main/docbook/included/pickList.xml
trunk/docs/userguide/en/src/main/docbook/master.xml
trunk/docs/userguide/pom.xml
trunk/ui/togglePanel/src/main/config/component/togglePanel.xml
Log:
http://jira.jboss.com/jira/browse/RF-2198 I've corrected the description for Toggle control component.
http://jira.jboss.com/jira/browse/RF-1207 I've added fileUpload component into guide
Modified: trunk/docs/userguide/en/src/main/docbook/included/comboBox.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/comboBox.xml 2008-03-13 18:27:40 UTC (rev 6795)
+++ trunk/docs/userguide/en/src/main/docbook/included/comboBox.xml 2008-03-13 20:37:14 UTC (rev 6796)
@@ -330,7 +330,7 @@
</tgroup>
</table>
<table>
- <title>Skin parameters redefinition for a button in inactive and disable state</title>
+ <title>Skin parameters redefinition for an inactive button</title>
<tgroup cols="2">
<thead>
<row>
@@ -353,6 +353,29 @@
</tgroup>
</table>
<table>
+ <title>Skin parameters redefinition for a disabled button</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+
+ <row>
+ <entry>buttonBorderColor</entry>
+ <entry>border-top-color</entry>
+ </row>
+ <row>
+ <entry>buttonBorderColor</entry>
+ <entry>border-left-color</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+ <table>
<title>Skin parameters redefinition for a hovered button</title>
<tgroup cols="2">
<thead>
@@ -445,7 +468,7 @@
</tgroup>
</table>
<table>
- <title>Skin parameters redefinition for an input field, input field in inactive and disable state</title>
+ <title>Skin parameters redefinition for an input field</title>
<tgroup cols="2">
<thead>
<row>
@@ -471,7 +494,7 @@
</tgroup>
</table>
<table>
- <title>Skin parameters redefinition for an item and selected item</title>
+ <title>Skin parameters redefinition for an inactive input field</title>
<tgroup cols="2">
<thead>
<row>
@@ -481,6 +504,58 @@
</thead>
<tbody>
<row>
+ <entry>generalBackgroundColor</entry>
+ <entry>background-color</entry>
+ </row>
+ <row>
+ <entry>inputFieldBorderColor</entry>
+ <entry>border-bottom-color</entry>
+ </row>
+ <row>
+ <entry>inputFieldBorderColor</entry>
+ <entry>border-right-color</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+ <table>
+ <title>Skin parameters redefinition for a disabled input field</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>generalBackgroundColor</entry>
+ <entry>background-color</entry>
+ </row>
+ <row>
+ <entry>inputFieldBorderColor</entry>
+ <entry>border-bottom-color</entry>
+ </row>
+ <row>
+ <entry>inputFieldBorderColor</entry>
+ <entry>border-right-color</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+ <table>
+ <title>Skin parameters redefinition for an item</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
<entry>itemSizeFont</entry>
<entry>font-size</entry>
</row>
@@ -496,6 +571,32 @@
</tbody>
</tgroup>
</table>
+ <table>
+ <title>Skin parameters redefinition for a selected item</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>itemSizeFont</entry>
+ <entry>font-size</entry>
+ </row>
+ <row>
+ <entry>itemFamilyFont</entry>
+ <entry>font-family</entry>
+ </row>
+ <row>
+ <entry>itemTextColor</entry>
+ <entry>color</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
</section>
<section>
@@ -711,7 +812,7 @@
<section>
<title>Relevant Resources Links</title>
<para>
- <ulink url="">Here</ulink> you can see an example of <emphasis role="bold"><property><rich:comboBox></property></emphasis> usage
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/comboBox.jsf?c=comboBox">Here</ulink> you can see an example of <emphasis role="bold"><property><rich:comboBox></property></emphasis> usage
and sources for the given example.
</para>
</section>
Modified: trunk/docs/userguide/en/src/main/docbook/included/componentControl.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/componentControl.xml 2008-03-13 18:27:40 UTC (rev 6795)
+++ trunk/docs/userguide/en/src/main/docbook/included/componentControl.xml 2008-03-13 20:37:14 UTC (rev 6796)
@@ -215,8 +215,10 @@
<para>This is a result:</para>
<figure>
<title><emphasis role="bold">
+ <property><rich:toolTip></property>
+ </emphasis> shows with the help of <emphasis role="bold">
<property><rich:componentControl></property>
- </emphasis> with <emphasis><property> "for"</property></emphasis> attribute.</title>
+ </emphasis>.</title>
<mediaobject>
<imageobject>
<imagedata fileref="images/componentControl1.png"/>
Added: trunk/docs/userguide/en/src/main/docbook/included/fileUpload.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/fileUpload.desc.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/fileUpload.desc.xml 2008-03-13 20:37:14 UTC (rev 6796)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section>
+ <sectioninfo>
+ <keywordset>
+ <keyword>fileUpload</keyword>
+ </keywordset>
+ </sectioninfo>
+ <section>
+ <title>Description</title>
+ <para>The <emphasis role="bold">
+ <property><rich:fileUpload></property>
+ </emphasis> component designed to perform Ajax-ed files upload to server.
+ </para>
+ <figure>
+ <title><emphasis role="bold">
+ <property><rich:fileUpload></property>
+ </emphasis> component</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/fileUpload.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ </section>
+<section>
+ <title>Key Features</title>
+ <itemizedlist>
+ <listitem>Highly customizable look and feel</listitem>
+ <listitem>File types/File sizes restrictions</listitem>
+ <listitem>Multiple files upload support </listitem>
+ <listitem>Cancel the request possibility </listitem>
+ <listitem>One request for every upload component</listitem>
+ <listitem>Different submit modes (Server/Client)</listitem>
+ <listitem>Asynchronous mode</listitem>
+
+ </itemizedlist>
+</section>
+</section>
+
\ No newline at end of file
Added: trunk/docs/userguide/en/src/main/docbook/included/fileUpload.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/fileUpload.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/fileUpload.xml 2008-03-13 20:37:14 UTC (rev 6796)
@@ -0,0 +1,910 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section>
+ <sectioninfo>
+ <keywordset>
+ <keyword>rich:fileUpload</keyword>
+ <keyword>fileUpload</keyword>
+ </keywordset>
+ </sectioninfo>
+ <table>
+ <title>Component identification parameters</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>component-type</entry>
+
+ <entry>org.richfaces.component.FileUpload</entry>
+ </row>
+ <row>
+ <entry>component-class</entry>
+
+ <entry>org.richfaces.component.html.HtmlFileUpload</entry>
+ </row>
+ <row>
+ <entry>component-family</entry>
+
+ <entry>org.richfaces.component.FileUpload</entry>
+ </row>
+ <row>
+ <entry>renderer-type</entry>
+
+ <entry>org.richfaces.renderkit.html.FileUploadRenderer</entry>
+ </row>
+ <row>
+ <entry>tag-class</entry>
+
+ <entry>org.richfaces.taglib.FileUploadTag</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <section>
+ <title>Creating the Component with a Page Tag</title>
+ <para>To create the simplest variant on a page use the following syntax:</para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<rich:fileUpload uploadData="#{bean.data}"/>
+...]]></programlisting>
+ </section>
+ <section>
+ <title>Creating the Component Dynamically Using Java</title>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="JAVA"><![CDATA[import org.richfaces.component.html.HtmlFileUpload;
+...
+HtmlFileUpload myFileUpload = new HtmlFileUpload();
+...]]></programlisting>
+ </section>
+ <section>
+ <title>Details of Usage</title>
+
+ <!--maintenance of component orderingList-->
+
+ <para>The <emphasis role="bold">
+ <property><rich:fileUpload></property>
+ </emphasis> component consists of two parts:<itemizedlist>
+ <listitem><property>List of files</property> which contains the list of currently chosen files with possibility to manage every file.
+ </listitem>
+ <listitem>
+ <property>Component controls</property>- the bar with controls for managing the whole component.
+
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <!-- attributes of component orderingList -->
+
+ <para>
+ The <emphasis>
+ <property> "disabled"</property>
+ </emphasis>
+ attribute is used to disable all elements of the component. All the controls should be disabled too. </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<rich:fileUpload disabled="true" uploadData="#{bean.data}" />
+...]]></programlisting>
+ <para>This is a result:</para>
+ <figure>
+ <title><emphasis role="bold">
+ <property><rich:fileUpload></property>
+ </emphasis>with <emphasis>
+ <property> "disabled"</property>
+ </emphasis> attribute</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/fileUpload2.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>The <emphasis>
+ <property> "acceptedTypes"</property></emphasis> attribute is used to define file types which should be accepted to upload.
+ </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<rich:fileUpload uploadData="#{bean.data}" acceptedTypes="html"/>
+ ...]]></programlisting>
+ <para>As it could be seen in the example below, only files with "html" extension should be accepted to upload.</para>
+
+ <para>The <emphasis>
+ <property> "autoclear"</property></emphasis> attribute is used to remove automatically files from list after upload completed.</para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<rich:fileUpload uploadData="#{bean.data}" addControlLabel="myLabel" autoclear="true"
+ acceptedTypes="html"/>
+ ...]]></programlisting>
+ <para>As it could be seen in the example below, files removes from list after upload completed.</para>
+ <para>The <emphasis>
+ <property> "maxFilesQuantity"</property></emphasis> defines max number of files allowed for upload.
+ After number of files in the list is equals to this attribute – add button should be disabled.
+ Add button should not be enabled before upload of the whole list done.
+ </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<rich:fileUpload uploadData="#{bean.data}" addControlLabel="myLabel" autoclear="true" maxFilesQuantity="2"
+ acceptedTypes="html"/>
+ ...]]></programlisting>
+ <para>This is a result:</para>
+ <figure>
+ <title><emphasis role="bold">
+ <property><rich:fileUpload></property>
+ </emphasis>with <emphasis>
+ <property> "maxFilesQuantity"</property>
+ </emphasis> attribute</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/fileUpload5.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>As it could be seen in the picture below, only 2 files allows for upload.</para>
+ <para>The <emphasis>
+ <property> "fileUploadedListener"</property></emphasis> is
+ called at server side after every file uploaded and used for the file saving by end developer.
+ </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<rich:fileUpload uploadData="#{bean.data}" addControlLabel="myLabel" autoclear="true" maxFilesQuantity="2" fileUploadListener="#{bean.listener}"
+ acceptedTypes="html"/>
+ ...]]></programlisting>
+ <para>The <emphasis role="bold">
+ <property><rich:fileUpload></property>
+ </emphasis> provides using a number of handlers. The <emphasis>
+ <property> "onupload"</property></emphasis> is available to cancel the upload at client side. The <emphasis>
+ <property> "onuploadcomplete"</property></emphasis> is called after all files in from list uploaded. The <emphasis>
+ <property> "onuploadcanceled"</property></emphasis> is called after upload was canceled via cancel control. The <emphasis>
+ <property> "onerror"</property></emphasis> is if the file upload was interrupted according to any errors.</para>
+ <para>
+ There is a number of facets that define entry customization. Markup should be provided using <emphasis>
+ <property> "entry"</property></emphasis> facet. <emphasis>
+ <property> "label"</property></emphasis> facet could be used to provide displaying the progress of uploading.
+ </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<rich:fileUpload uploadData="#{bean.data}" addControlLabel="myLabel" autoclear="true" maxFilesQuantity="2" fileUploadListener="#{bean.listener}"
+ acceptedTypes="html">
+ <f:facet name="label">
+ <h:outputText value="{_KB}KB from {KB}KB uploaded --- {mm}:{ss}"></h:outputText>
+ </f:facet>
+</rich:fileUpload>
+...]]></programlisting>
+ <para>This is a result:</para>
+ <figure>
+ <title><emphasis role="bold">
+ <property><rich:fileUpload></property>
+ </emphasis>with <emphasis>
+ <property> "label"</property>
+ </emphasis> facet</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/fileUpload6.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>As it could be seen in the picture below, the label displays under the item.</para>
+ <para>Labels of <property>component controls</property> can be defined with <emphasis>
+ <property> "addControlLabel"</property></emphasis>, <emphasis>
+ <property> "clearAllControlLabel"</property></emphasis>, <emphasis>
+ <property> "clearControlLabel"</property></emphasis>, <emphasis>
+ <property> "stopEntryControlLabel"</property></emphasis>, <emphasis>
+ <property> "uploadControlLabel"</property></emphasis></para>
+ <para>The <emphasis role="bold">
+ <property><rich:fileUpload></property>
+ </emphasis> component allows to use sizes attributes:
+ <itemizedlist>
+ <listitem><emphasis>
+ <property> "listHeight"</property></emphasis> attribute specify height for list of files in pixels
+ </listitem>
+ <listitem><emphasis>
+ <property> "listWidth"</property></emphasis> attribute specify width for list of files in pixels.
+ </listitem>
+ </itemizedlist>
+ </para>
+
+
+ </section>
+
+ <!-- ordering control set>
+
+ <table>
+ <title>Keyboard usage for elements selection</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Keys and combinations </entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <Sorting API >
+ <row>
+ <entry>CTRL+click</entry>
+ <entry>Inverts selection for an item</entry>
+ </row>
+ <row>
+ <entry>SHIFT+click</entry>
+ <entry>Selects all rows from active one to a clicked row if they differ,
+ else select the active row. All other selections are cleared</entry>
+ </row>
+ <row>
+ <entry>CTRL+A</entry>
+ <entry>Selects all elements inside the list if some active element is
+ already present in a list</entry>
+ </row>
+ <row>
+ <entry>Up, Down arrows</entry>
+ <entry>Changes the active and selected elements to the next or previous in a list</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+
+ <section>
+ <title>JavaScript API</title>
+ <table>
+ <title>JavaScript API</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Function</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody-->
+ <!--Sorting API-->
+ <!--
+ <row>
+ <entry>SortAscending()</entry>
+ <entry>Sorts items in the list ascending</entry>
+ </row>
+ <row>
+ <entry>SortDescending()</entry>
+ <entry>Sorts items in the list descending</entry>
+ </row>
+ <row>
+ <entry>Sort()</entry>
+ <entry>Inverts current sorting</entry>
+ </row>
+ -->
+
+ <!--Controls common API -->
+ <!--row>
+ <entry>hide()</entry>
+ <entry>Hides ordering control</entry>
+ </row>
+ <row>
+ <entry>show()</entry>
+ <entry>Shows ordering control</entry>
+ </row>
+ <row>
+ <entry>isShown()</entry>
+ <entry>Checks if current control is shown</entry>
+ </row>
+ <row>
+ <entry>enable()</entry>
+ <entry>Enables ordering control</entry>
+ </row>
+ <row>
+ <entry>disable()</entry>
+ <entry>Disables ordering control</entry>
+ </row>
+ <row>
+ <entry>isEnabled()</entry>
+ <entry>Checksif current control is enabled</entry>
+ </row-->
+ <!--List managing API -->
+ <!--row>
+ <entry>copy()</entry>
+ <entry>Copies selected item from the source list to the target list</entry>
+ </row>
+ <row>
+ <entry>remove()</entry>
+ <entry>Removes selected item from the target list to the source list</entry>
+ </row>
+ <row>
+ <entry>copyAll()</entry>
+ <entry>Copies all items from the source list to the target list</entry>
+ </row>
+ <row>
+ <entry>removeAll()</entry>
+ <entry>Removes all items from the target list to the source list</entry>
+ </row>
+ <row>
+ <entry>getSelection()</entry>
+ <entry>Returns currently selected item</entry>
+ </row>
+ <row>
+ <entry>getItems()</entry>
+ <entry>Returns the collection of all items</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+
+ <section>
+ <title>Look-and-Feel Customization</title>
+ <para>For skinnability implementation, the components use a <emphasis>
+ <property>style class redefinition method.</property>
+ </emphasis> Default style classes are mapped on <emphasis>
+ <property>skin parameters.</property>
+ </emphasis></para>
+ <para>There are two ways to redefine the appearance of all <emphasis role="bold">
+ <property><rich:pickList></property>
+ </emphasis> components at once: <itemizedlist>
+ <listitem>Redefine the corresponding skin parameters</listitem>
+ <listitem> Add to your style sheets style classes used by a <emphasis role="bold">
+ <property><rich:pickList></property>
+ </emphasis> component</listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section>
+ <title>Skin Parameters Redefinition</title>
+
+ <table>
+ <title>Skin parameters redefinition for a list</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>generalBackgroundColor</entry>
+ <entry>background-color</entry>
+ </row>
+ <row>
+ <entry>tableBorderWidth</entry>
+ <entry>border-width</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table>
+ <title>Skin parameters redefinition for a button</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>trimColor</entry>
+ <entry>background-color</entry>
+ </row>
+ <row>
+ <entry>generalTextColor</entry>
+ <entry>color</entry>
+ </row>
+ <row>
+ <entry>generalFamilyFont</entry>
+ <entry>font-family</entry>
+ </row>
+ <row>
+ <entry>generalSizeFont</entry>
+ <entry>font-size</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+ <table>
+ <title>Skin parameters redefinition for a disabled button</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>trimColor</entry>
+ <entry>background-color</entry>
+ </row>
+ <row>
+ <entry>generalTextColor</entry>
+ <entry>color</entry>
+ </row>
+ <row>
+ <entry>generalFamilyFont</entry>
+ <entry>font-family</entry>
+ </row>
+ <row>
+ <entry>generalSizeFont</entry>
+ <entry>font-size</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table>
+ <title>Skin parameters redefinition for a pressed button</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>trimColor</entry>
+ <entry>background-color</entry>
+ </row>
+ <row>
+ <entry>generalTextColor</entry>
+ <entry>color</entry>
+ </row>
+ <row>
+ <entry>generalFamilyFont</entry>
+ <entry>font-family</entry>
+ </row>
+ <row>
+ <entry>generalSizeFont</entry>
+ <entry>font-size</entry>
+ </row>
+ <row>
+ <entry>tableBorderColor</entry>
+ <entry>border-color</entry>
+ </row>
+ <row>
+ <entry>tableBorderWidth</entry>
+ <entry>border-width</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+ <table>
+ <title>Skin parameters redefinition for a highlighted button</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>trimColor</entry>
+ <entry>background-color</entry>
+ </row>
+ <row>
+ <entry>generalTextColor</entry>
+ <entry>color</entry>
+ </row>
+ <row>
+ <entry>generalFamilyFont</entry>
+ <entry>font-family</entry>
+ </row>
+ <row>
+ <entry>generalSizeFont</entry>
+ <entry>font-size</entry>
+ </row>
+ <row>
+ <entry>tableBorderColor</entry>
+ <entry>border-color</entry>
+ </row>
+ <row>
+ <entry>tableBorderWidth</entry>
+ <entry>border-width</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+ <table>
+ <title>Skin parameters redefinition for a button selection</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>generalTextColor</entry>
+ <entry>color</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table>
+ <title>Skin parameters redefinition for a button content</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>generalFamilyFont</entry>
+ <entry>font-family</entry>
+ </row>
+ <row>
+ <entry>generalSizeFont</entry>
+ <entry>font-size</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table>
+ <title>Skin parameters redefinition for a source and target items</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>generalBackgroundColor</entry>
+ <entry>background-color</entry>
+ </row>
+ <row>
+ <entry>tableBorderColor</entry>
+ <entry>border-color</entry>
+ </row>
+ <row>
+ <entry>tableBorderWidth</entry>
+ <entry>border-width</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table>
+ <title>Skin parameters redefinition for a source and target cell</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>generalTextColor</entry>
+ <entry>color</entry>
+ </row>
+ <row>
+ <entry>generalSizeFont</entry>
+ <entry>font-size</entry>
+ </row>
+ <row>
+ <entry>generalFamilyFont</entry>
+ <entry>font-family</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table>
+ <title>Skin parameters redefinition for a controls</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>controlBorderColor</entry>
+ <entry>border-color</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+
+ </section>
+
+ <section>
+ <title>Definition of Custom Style Classes</title>
+
+ <para>The following picture illustrates how CSS classes define styles for component elements.</para>
+
+
+ <figure>
+ <title>Classes names</title>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/pickList2.png"/>
+ </imageobject>
+ </mediaobject>
+
+ </figure>
+
+ <table id="pickListC">
+ <title>Classes names that define a list representation</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Class name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>rich-picklist-list</entry>
+ <entry>Defines styles for a wrapper <table> element of a pickList</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table >
+ <title>Classes names that define a button representation</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Class name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>rich-list-picklist-button</entry>
+ <entry>Defines styles for a button</entry>
+ </row>
+ <row>
+ <entry>rich-list-picklist-button-disabled</entry>
+ <entry>Defines styles for a disabled button</entry>
+ </row>
+ <row>
+ <entry>rich-list-picklist-button-press</entry>
+ <entry>Defines styles for a pressed button</entry>
+ </row>
+ <row>
+ <entry>rich-list-picklist-button-light</entry>
+ <entry>Defines styles for a button highlight</entry>
+ </row>
+ <row>
+ <entry>rich-list-picklist-button-selection</entry>
+ <entry>Defines styles for a button selection</entry>
+ </row>
+ <row>
+ <entry>rich-list-picklist-button-content</entry>
+ <entry>Defines styles for a button content</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+
+ <table >
+ <title>Classes names that define a source and target items representation</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Class name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>rich-picklist-source-items</entry>
+ <entry>Defines styles for an item in a source list</entry>
+ </row>
+ <row>
+ <entry>rich-picklist-target-items</entry>
+ <entry>Defines styles for an item in a target list</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table >
+ <title>Classes names that define a source cell representation</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Class name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>rich-picklist-source-cell</entry>
+ <entry>Defines styles for a cell in a source list</entry>
+ </row>
+ <row>
+ <entry>rich-picklist-source-cell-selected</entry>
+ <entry>Defines styles for a selected cell in a source list</entry>
+ </row>
+ <row>
+ <entry>rich-picklist-source-cell-active</entry>
+ <entry>Defines styles for an active cell in a source list</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table >
+ <title>Classes names that define a target cell representation</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Class name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>rich-picklist-target-cel</entry>
+ <entry>Defines styles for a cell in a source list</entry>
+ </row>
+ <row>
+ <entry>rich-picklist-target-cell-selected</entry>
+ <entry>Defines styles for a selected cell in a target list</entry>
+ </row>
+ <row>
+ <entry>rich-picklist-target-cell-active</entry>
+ <entry>Defines styles for an active cell in a target list</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+
+
+ <table >
+ <title>Classes names that define a control representation</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Class name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>rich-picklist-control-disabled</entry>
+ <entry>Defines styles for a control in a disabled state</entry>
+ </row>
+ <row>
+ <entry>rich-picklist-control-copyall</entry>
+ <entry>Defines styles for a "copyAll" control</entry>
+ </row>
+ <row>
+ <entry>rich-picklist-control-copy</entry>
+ <entry>Defines styles for a "Copy" control</entry>
+ </row>
+ <row>
+ <entry>rich-picklist-control-remove</entry>
+ <entry>Defines styles for a "Remove" control</entry>
+ </row>
+ <row>
+ <entry>rich-picklist-control-removeall</entry>
+ <entry>Defines styles for a "removeAll" control</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>In order to redefine styles for all <emphasis role="bold">
+ <property><rich:pickList></property>
+ </emphasis> components on a page using CSS, it's enough to create classes with the
+ same names (possible classes could be found in the tables <link linkend="pickListC"> above</link>) and define necessary properties in them. </para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="CSS"><![CDATA[...
+.rich-picklist-list{
+ background-color:#ecf4fe;
+}
+...]]></programlisting>
+
+ <para>This is a result:</para>
+
+ <figure>
+ <title>Redefinition styles with predefined classes</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/pickListClass.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>In the example the background color for lists is changed.</para>
+
+ <para>Also it’s possible to change styles of particular <emphasis role="bold"
+ ><property><rich:pickList></property></emphasis> component. In this case you should create own style classes and use them in the corresponding <emphasis role="bold"
+ ><property><rich:pickList></property></emphasis> <property>styleClass</property> attributes. An example is placed below:</para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="CSS"><![CDATA[...
+.myClass{
+ font-weight:bold;
+}
+...]]></programlisting>
+ <para>The <emphasis><property>"styleClass"</property></emphasis> attribute for <emphasis role="bold"
+ ><property><rich:pickList></property></emphasis> is defined as it’s shown in the example below:</para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="CSS"><![CDATA[<rich:pickList ... styleClass="myClass"/>
+]]></programlisting>
+
+ <para>This is a result:</para>
+
+ <figure>
+ <title>Redefinition styles with own classes and styleClass attributes</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/pickListStyle.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>As it could be seen on the picture above, the font style for buttons is changed.</para>
+
+ </section-->
+
+ <section>
+ <title>Relevant Resources Links</title>
+ <para><ulink
+ url="http://livedemo.exadel.com/richfaces-demo/richfaces/fileUpload.jsf?c=file..."
+ >Here</ulink> you can see an example of <emphasis role="bold">
+ <property><rich:fileUpload></property>
+ </emphasis> usage and sources for the given example. </para>
+ </section>
+
+</section>
Modified: trunk/docs/userguide/en/src/main/docbook/included/pickList.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/pickList.xml 2008-03-13 18:27:40 UTC (rev 6795)
+++ trunk/docs/userguide/en/src/main/docbook/included/pickList.xml 2008-03-13 20:37:14 UTC (rev 6796)
@@ -2,8 +2,8 @@
<section>
<sectioninfo>
<keywordset>
- <keyword>rich:pickList</keyword>
- <keyword>pickList</keyword>
+ <keyword>rich:fileUpload</keyword>
+ <keyword>fileUpload</keyword>
</keywordset>
</sectioninfo>
<table>
@@ -21,27 +21,27 @@
<row>
<entry>component-type</entry>
- <entry>org.richfaces.PickList</entry>
+ <entry>org.richfaces.component.FileUpload</entry>
</row>
<row>
<entry>component-class</entry>
- <entry>org.richfaces.component.html.HtmlPickList</entry>
+ <entry>org.richfaces.component.html.HtmlFileUpload</entry>
</row>
<row>
<entry>component-family</entry>
- <entry>org.richfaces.PickList</entry>
+ <entry>org.richfaces.component.FileUpload</entry>
</row>
<row>
<entry>renderer-type</entry>
- <entry>org.richfaces.PickListRenderer</entry>
+ <entry>org.richfaces.renderkit.html.FileUploadRenderer</entry>
</row>
<row>
<entry>tag-class</entry>
- <entry>org.richfaces.taglib.PickListTag</entry>
+ <entry>org.richfaces.taglib.FileUploadTag</entry>
</row>
</tbody>
</tgroup>
@@ -54,10 +54,7 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
-<rich:pickList value="#{pickBean.listValues}">
- <f:selectItem itemValue="Bentley" itemLabel="Bentley"/>
- <f:selectItem itemValue="Audi" itemLabel="Audi"/>
-</rich:pickList>
+<rich:fileUpload uploadData="#{bean.data}"/>
...]]></programlisting>
</section>
<section>
@@ -66,9 +63,9 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="JAVA"><![CDATA[import org.richfaces.component.html.HtmlPickList;
+ <programlisting role="JAVA"><![CDATA[import org.richfaces.component.html.HtmlFileUpload;
...
-HtmlPickList myPickList = new HtmlPickList();
+HtmlFileUpload myFileUpload = new HtmlFileUpload();
...]]></programlisting>
</section>
<section>
@@ -343,7 +340,7 @@
</table>
<table>
- <title>Skin parameters redefinition for a button, button in disable state</title>
+ <title>Skin parameters redefinition for a button</title>
<tgroup cols="2">
<thead>
<row>
@@ -371,10 +368,40 @@
</tbody>
</tgroup>
+ </table>
+ <table>
+ <title>Skin parameters redefinition for a disabled button</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>trimColor</entry>
+ <entry>background-color</entry>
+ </row>
+ <row>
+ <entry>generalTextColor</entry>
+ <entry>color</entry>
+ </row>
+ <row>
+ <entry>generalFamilyFont</entry>
+ <entry>font-family</entry>
+ </row>
+ <row>
+ <entry>generalSizeFont</entry>
+ <entry>font-size</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
</table>
-
+
<table>
- <title>Skin parameters redefinition for a pressed and highlighted button</title>
+ <title>Skin parameters redefinition for a pressed button</title>
<tgroup cols="2">
<thead>
<row>
@@ -411,8 +438,45 @@
</tbody>
</tgroup>
</table>
-
<table>
+ <title>Skin parameters redefinition for a highlighted button</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>trimColor</entry>
+ <entry>background-color</entry>
+ </row>
+ <row>
+ <entry>generalTextColor</entry>
+ <entry>color</entry>
+ </row>
+ <row>
+ <entry>generalFamilyFont</entry>
+ <entry>font-family</entry>
+ </row>
+ <row>
+ <entry>generalSizeFont</entry>
+ <entry>font-size</entry>
+ </row>
+ <row>
+ <entry>tableBorderColor</entry>
+ <entry>border-color</entry>
+ </row>
+ <row>
+ <entry>tableBorderWidth</entry>
+ <entry>border-width</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+ <table>
<title>Skin parameters redefinition for a button selection</title>
<tgroup cols="2">
<thead>
Modified: trunk/docs/userguide/en/src/main/docbook/master.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/master.xml 2008-03-13 18:27:40 UTC (rev 6795)
+++ trunk/docs/userguide/en/src/main/docbook/master.xml 2008-03-13 20:37:14 UTC (rev 6796)
@@ -49,7 +49,9 @@
<!ENTITY columns_table SYSTEM "../../../target/generated/columns.xml">
<!ENTITY comboBox_table SYSTEM "../../../target/generated/combobox.xml">
<!ENTITY pickList_table SYSTEM "../../../target/generated/pickList.xml">
- <!ENTITY progressBar_table SYSTEM "../../../target/generated/progressBar.xml">
+ <!ENTITY fileUpload_table SYSTEM "../../../target/generated/fileUpload.xml">
+
+
<!ENTITY coreComponents_table SYSTEM "../../../target/generated/a4j.xml">
]>
<book>
@@ -93,6 +95,7 @@
&dropDownMenu_table;
&menuComponents_table;
&effect_table;
+&fileUpload_table;
&gmap_table;
&virtualEarth_table;
&inputNumberSlider_table;
@@ -108,7 +111,7 @@
&panelBar_table;
&panelMenu_table;
&pickList_table;
-&progressBar_table;
+
&scrollableDataTable_table;
&separator_table;
&simpleTogglePanel_table;
Added: trunk/docs/userguide/en/src/main/resources/images/fileUpload.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/userguide/en/src/main/resources/images/fileUpload.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/userguide/en/src/main/resources/images/fileUpload2.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/userguide/en/src/main/resources/images/fileUpload2.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/userguide/en/src/main/resources/images/fileUpload5.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/userguide/en/src/main/resources/images/fileUpload5.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/userguide/en/src/main/resources/images/fileUpload6.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/userguide/en/src/main/resources/images/fileUpload6.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/docs/userguide/pom.xml
===================================================================
--- trunk/docs/userguide/pom.xml 2008-03-13 18:27:40 UTC (rev 6795)
+++ trunk/docs/userguide/pom.xml 2008-03-13 20:37:14 UTC (rev 6796)
@@ -75,26 +75,37 @@
${project.version}
</version>
</artifactItem>
-
-
<artifactItem>
<groupId>
org.richfaces.ui
</groupId>
<artifactId>
+ fileUpload
+ </artifactId>
+ <version>
+ ${project.version}
+ </version>
+ </artifactItem>
+
+
+ <!--artifactItem>
+ <groupId>
+ org.richfaces.ui
+ </groupId>
+ <artifactId>
progressBar
</artifactId>
<version>
${project.version}
</version>
- </artifactItem>
+ </artifactItem-->
<artifactItem>
<groupId>
org.richfaces.ui
</groupId>
<artifactId>
- combobox
+ comboBox
</artifactId>
<version>
${project.version}
@@ -700,7 +711,7 @@
<imagePathSettingRequired>
true
</imagePathSettingRequired>
- </format >
+ </format>
<format>
<formatName>html</formatName>
<stylesheetResource>
Modified: trunk/ui/togglePanel/src/main/config/component/togglePanel.xml
===================================================================
--- trunk/ui/togglePanel/src/main/config/component/togglePanel.xml 2008-03-13 18:27:40 UTC (rev 6795)
+++ trunk/ui/togglePanel/src/main/config/component/togglePanel.xml 2008-03-13 20:37:14 UTC (rev 6796)
@@ -99,12 +99,12 @@
<property hidden="true">
<name>valid</name>
<classname>java.lang.String</classname>
- </property>
- <property>
- <name>label</name>
- <classname>java.lang.String</classname>
- <description>A localized user presentable name for this component.</description>
</property>
+ <property>
+ <name>label</name>
+ <classname>java.lang.String</classname>
+ <description>A localized user presentable name for this component.</description>
+ </property>
<!--
@@ -173,8 +173,7 @@
<name>for</name>
<classname>java.lang.String</classname>
<description>
- <![CDATA[String containing comma separated ids (in the format of a UIComponent.findComponent()
- call) of the target components.]]>
+ <![CDATA[String, which contains id (in the format of a UIComponent.findComponent() call) of the target Toggle Panel.]]>
</description>
</property>
@@ -237,7 +236,7 @@
<description>
CSS style(s) to be applied when this component is
rendered
- </description>
+ </description>
<defaultvalue>""</defaultvalue>
</property>
<property>
@@ -248,7 +247,7 @@
applied when this element is rendered. This value must
be passed through as the "class" attribute on generated
markup
- </description>
+ </description>
<defaultvalue>""</defaultvalue>
</property>
16 years, 10 months
JBoss Rich Faces SVN: r6795 - in trunk/samples/richfaces-demo/src/main: java/org/richfaces/demo and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2008-03-13 14:27:40 -0400 (Thu, 13 Mar 2008)
New Revision: 6795
Added:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/dataTableScroller/
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/dataTableScroller/SortingBean.java
trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/externalSortingUsage.xhtml
Modified:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/DataTableScrollerBean.java
trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeature.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/examples/externalMultipleSorting.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/examples/simpleSingleSorting.xhtml
Log:
Modified: trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/DataTableScrollerBean.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/DataTableScrollerBean.java 2008-03-13 17:51:09 UTC (rev 6794)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/DataTableScrollerBean.java 2008-03-13 18:27:40 UTC (rev 6795)
@@ -12,7 +12,6 @@
import org.richfaces.component.UIScrollableDataTable;
import org.richfaces.demo.datafilterslider.DemoInventoryItem;
-import org.richfaces.model.ScrollableTableDataModel.SimpleRowKey;
import org.richfaces.model.selection.SimpleSelection;
/**
@@ -29,7 +28,7 @@
private ArrayList<Facet> columns = new ArrayList<Facet>();
private static int DECIMALS = 1;
private static int ROUNDING_MODE = BigDecimal.ROUND_HALF_UP;
-
+
private List <DemoInventoryItem> allCars = null;
public DataTableScrollerBean() {
Added: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/dataTableScroller/SortingBean.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/dataTableScroller/SortingBean.java (rev 0)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/dataTableScroller/SortingBean.java 2008-03-13 18:27:40 UTC (rev 6795)
@@ -0,0 +1,189 @@
+/**
+ *
+ */
+package org.richfaces.demo.dataTableScroller;
+
+import java.util.ArrayList;
+
+import javax.faces.model.SelectItem;
+
+/**
+ * @author Ilya Shaikovsky
+ *
+ */
+public class SortingBean {
+ SelectItem[] sortByItems = new SelectItem[5];
+ SelectItem[] sortDirectionItems = new SelectItem[3];
+ private int firstSortOption=0;
+ private int secondSortOption=0;
+ private int thirdSortOption=0;
+ private int fourthSortOption=0;
+ private boolean modelSorted;
+ private boolean makeSorted;
+ private boolean priceSorted;
+ private boolean mileageSorted;
+ private String modelDirection = "UNSORTED";
+ private String makeDirection = "UNSORTED";
+ private String priceDirection = "UNSORTED";
+ private String mileageDirection = "UNSORTED";
+ ArrayList<String> prioritList = new ArrayList<String>();
+
+ public SortingBean() {
+ sortByItems[0] = new SelectItem(0,"None");
+ sortByItems[1] = new SelectItem(1,"Model");
+ sortByItems[2] = new SelectItem(2,"Price");
+ sortByItems[3] = new SelectItem(3,"Make");
+ sortByItems[4] = new SelectItem(4,"Mileage");
+
+ sortDirectionItems[0] = new SelectItem("None");
+ sortDirectionItems[1] = new SelectItem("Asc");
+ sortDirectionItems[2] = new SelectItem("Desc");
+ }
+
+ public void checkSort(int value){
+ switch (value) {
+ case 1:
+ prioritList.add("model");
+ setModelDirection("ASCENDING");
+ setModelSorted(true);
+ break;
+ case 2:
+ prioritList.add("price");
+ setPriceDirection("ASCENDING");
+ setPriceSorted(true);
+ break;
+ case 3:
+ prioritList.add("make");
+ setMakeDirection("ASCENDING");
+ setMakeSorted(true);
+ break;
+ case 4:
+ prioritList.add("mileage");
+ setMileageDirection("ASCENDING");
+ setMileageSorted(true);
+ break;
+ }
+
+ }
+
+ public String changeSorting() {
+ prioritList.clear();
+ setModelSorted(false); setModelDirection("UNSORTED");
+ setMakeSorted(false); setMakeDirection("UNSORTED");
+ setPriceSorted(false); setPriceDirection("UNSORTED");
+ setMileageSorted(false);setMileageDirection("UNSORTED");
+ checkSort(firstSortOption);
+ checkSort(secondSortOption);
+ checkSort(thirdSortOption);
+ checkSort(fourthSortOption);
+ return null;
+ }
+
+ public SelectItem[] getSortByItems() {
+ return sortByItems;
+ }
+
+ public SelectItem[] getSortDirectionItems() {
+ return sortDirectionItems;
+ }
+
+ public boolean isModelSorted() {
+ return modelSorted;
+ }
+
+ public void setModelSorted(boolean modelSorted) {
+ this.modelSorted = modelSorted;
+ }
+
+ public boolean isMakeSorted() {
+ return makeSorted;
+ }
+
+ public void setMakeSorted(boolean makeSorted) {
+ this.makeSorted = makeSorted;
+ }
+
+ public boolean isPriceSorted() {
+ return priceSorted;
+ }
+
+ public void setPriceSorted(boolean priceSorted) {
+ this.priceSorted = priceSorted;
+ }
+
+ public boolean isMileageSorted() {
+ return mileageSorted;
+ }
+
+ public void setMileageSorted(boolean mileageSorted) {
+ this.mileageSorted = mileageSorted;
+ }
+
+ public ArrayList<String> getPrioritList() {
+ return prioritList;
+ }
+
+ public String getModelDirection() {
+ return modelDirection;
+ }
+
+ public void setModelDirection(String modelDirection) {
+ this.modelDirection = modelDirection;
+ }
+
+ public String getMakeDirection() {
+ return makeDirection;
+ }
+
+ public void setMakeDirection(String makeDirection) {
+ this.makeDirection = makeDirection;
+ }
+
+ public String getPriceDirection() {
+ return priceDirection;
+ }
+
+ public void setPriceDirection(String priceDirection) {
+ this.priceDirection = priceDirection;
+ }
+
+ public String getMileageDirection() {
+ return mileageDirection;
+ }
+
+ public void setMileageDirection(String mileageDirection) {
+ this.mileageDirection = mileageDirection;
+ }
+
+ public int getFirstSortOption() {
+ return firstSortOption;
+ }
+
+ public void setFirstSortOption(int firstSortOption) {
+ this.firstSortOption = firstSortOption;
+ }
+
+ public int getSecondSortOption() {
+ return secondSortOption;
+ }
+
+ public void setSecondSortOption(int secondSortOption) {
+ this.secondSortOption = secondSortOption;
+ }
+
+ public int getThirdSortOption() {
+ return thirdSortOption;
+ }
+
+ public void setThirdSortOption(int thirdSortOption) {
+ this.thirdSortOption = thirdSortOption;
+ }
+
+ public int getFourthSortOption() {
+ return fourthSortOption;
+ }
+
+ public void setFourthSortOption(int fourthSortOption) {
+ this.fourthSortOption = fourthSortOption;
+ }
+}
Modified: trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2008-03-13 17:51:09 UTC (rev 6794)
+++ trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2008-03-13 18:27:40 UTC (rev 6795)
@@ -298,6 +298,11 @@
<managed-bean-class>org.richfaces.demo.fileUpload.FileUploadBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
+ <managed-bean>
+ <managed-bean-name>sortingBean</managed-bean-name>
+ <managed-bean-class>org.richfaces.demo.dataTableScroller.SortingBean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
<navigation-rule>
<from-view-id>/richfaces/include/examples/wstep1.xhtml</from-view-id>
<navigation-case>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeature.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeature.xhtml 2008-03-13 17:51:09 UTC (rev 6794)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeature.xhtml 2008-03-13 18:27:40 UTC (rev 6795)
@@ -11,9 +11,12 @@
<rich:tab label="Filtering Feature">
<ui:include src="/richfaces/sortingFilteringFeatures/filteringUsage.xhtml"/>
</rich:tab>
- <rich:tab label="Sorting Feature">
+ <rich:tab label="Built-in Sorting Feature">
<ui:include src="/richfaces/sortingFilteringFeatures/sortingUsage.xhtml"/>
</rich:tab>
+ <rich:tab label="External Sorting">
+ <ui:include src="/richfaces/sortingFilteringFeatures/externalSortingUsage.xhtml"/>
+ </rich:tab>
</rich:tabPanel>
</ui:define>
</ui:composition>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/examples/externalMultipleSorting.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/examples/externalMultipleSorting.xhtml 2008-03-13 17:51:09 UTC (rev 6794)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/examples/externalMultipleSorting.xhtml 2008-03-13 18:27:40 UTC (rev 6795)
@@ -0,0 +1,67 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+ <style>
+ .top{
+ vertical-align:top;
+ }
+ </style>
+
+ <h:panelGrid columns="2" columnClasses="top">
+ <rich:dataTable value="#{dataTableScrollerBean.allCars}" var="category" rows="30" id="table">
+ <rich:column id="make" sortBy="#{category.make}" sortOrder="#{sortingBean.makeDirection}">
+ <f:facet name="header"><h:outputText styleClass="headerText" value="Make" /></f:facet>
+ <h:outputText value="#{category.make}" />
+ </rich:column>
+ <rich:column id="model" sortBy="#{category.model}" sortOrder="#{sortingBean.modelDirection}">
+ <f:facet name="header"><h:outputText styleClass="headerText" value="Model" /></f:facet>
+ <h:outputText value="#{category.model}" />
+ </rich:column>
+ <rich:column id="price" sortBy="#{category.price}" sortOrder="#{sortingBean.priceDirection}">
+ <f:facet name="header"><h:outputText styleClass="headerText" value="Price" /></f:facet>
+ <h:outputText value="#{category.price}" />
+ </rich:column>
+ <rich:column id="mileage" sortBy="#{category.mileage}" sortOrder="#{sortingBean.mileageDirection}">
+ <f:facet name="header"><h:outputText styleClass="headerText" value="Mileage" /></f:facet>
+ <h:outputText value="#{category.mileage}" />
+ </rich:column>
+ <rich:column width="200px" id="vin">
+ <f:facet name="header"><h:outputText styleClass="headerText" value="VIN" /></f:facet>
+ <h:outputText value="#{category.vin}" />
+ </rich:column>
+ <rich:column id="stock">
+ <f:facet name="header"><h:outputText styleClass="headerText" value="Stock" /></f:facet>
+ <h:outputText value="#{category.stock}" />
+ </rich:column>
+ </rich:dataTable>
+ <h:form>
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="Specify Sorting Conditions:"/>
+ </f:facet>
+ <h:panelGrid columns="2">
+ <h:outputText value="First Sort Property"/>
+ <h:selectOneMenu value="#{sortingBean.firstSortOption}">
+ <f:selectItems value="#{sortingBean.sortByItems}"/>
+ </h:selectOneMenu>
+ <h:outputText value="Second Sort Property"/>
+ <h:selectOneMenu value="#{sortingBean.secondSortOption}">
+ <f:selectItems value="#{sortingBean.sortByItems}"/>
+ </h:selectOneMenu>
+ <h:outputText value="Third Sort Property"/>
+ <h:selectOneMenu value="#{sortingBean.thirdSortOption}">
+ <f:selectItems value="#{sortingBean.sortByItems}"/>
+ </h:selectOneMenu>
+ <h:outputText value="Fourth Sort Property"/>
+ <h:selectOneMenu value="#{sortingBean.fourthSortOption}">
+ <f:selectItems value="#{sortingBean.sortByItems}"/>
+ </h:selectOneMenu>
+ </h:panelGrid>
+ <a4j:commandButton value="Sort Table" reRender="table" action="#{sortingBean.changeSorting}"/>
+ </rich:panel>
+ </h:form>
+ </h:panelGrid>
+</ui:composition>
\ No newline at end of file
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/examples/simpleSingleSorting.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/examples/simpleSingleSorting.xhtml 2008-03-13 17:51:09 UTC (rev 6794)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/examples/simpleSingleSorting.xhtml 2008-03-13 18:27:40 UTC (rev 6795)
@@ -4,13 +4,24 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
+ <style>
+ .center{
+ text-align:center;
+ }
+ </style>
<h:form>
- <rich:dataTable value="#{capitalsBean.capitals}" var="cap" width="300px">
+ <rich:dataTable value="#{capitalsBean.capitals}" var="cap" width="300px" columnClasses="center">
<f:facet name="header">
<h:outputText value="Sorting Example"/>
</f:facet>
- <rich:column sortBy="#{cap.state}">
+ <rich:column>
<f:facet name="header">
+ <h:outputText value="State Flag"></h:outputText>
+ </f:facet>
+ <h:graphicImage value="#{cap.stateFlag}"/>
+ </rich:column>
+ <rich:column sortBy="#{cap.state}">
+ <f:facet name="header">
<h:outputText value="State Name"></h:outputText>
</f:facet>
<h:outputText value="#{cap.state}"></h:outputText>
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/externalSortingUsage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/externalSortingUsage.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/externalSortingUsage.xhtml 2008-03-13 18:27:40 UTC (rev 6795)
@@ -0,0 +1,29 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:rich="http://richfaces.org/rich">
+ <ui:composition template="/templates/component-sample.xhtml">
+ <ui:define name="sample">
+
+ <p>
+ SHORT DESCRIPTION
+ </p>
+
+ <div class="sample-container" >
+
+ <ui:include src="/richfaces/sortingFilteringFeatures/examples/externalMultipleSorting.xhtml"/>
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath" value="/richfaces/sortingFilteringFeatures/examples/externalMultipleSorting.xhtml"/>
+ </ui:include>
+ </div>
+
+ <p>
+ DESCRIPTION
+ </p>
+
+ </ui:define>
+
+ </ui:composition>
+</html>
16 years, 10 months
JBoss Rich Faces SVN: r6794 - in trunk/ui/inputnumber-slider/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2008-03-13 13:51:09 -0400 (Thu, 13 Mar 2008)
New Revision: 6794
Modified:
trunk/ui/inputnumber-slider/src/main/java/org/richfaces/renderkit/InputNumberSliderRendererBase.java
trunk/ui/inputnumber-slider/src/main/templates/inputNumberSlider.jspx
Log:
http://jira.jboss.com/jira/browse/RF-2487
Modified: trunk/ui/inputnumber-slider/src/main/java/org/richfaces/renderkit/InputNumberSliderRendererBase.java
===================================================================
--- trunk/ui/inputnumber-slider/src/main/java/org/richfaces/renderkit/InputNumberSliderRendererBase.java 2008-03-13 17:41:37 UTC (rev 6793)
+++ trunk/ui/inputnumber-slider/src/main/java/org/richfaces/renderkit/InputNumberSliderRendererBase.java 2008-03-13 17:51:09 UTC (rev 6794)
@@ -23,9 +23,12 @@
import java.io.IOException;
+import javax.faces.FacesException;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
+import org.ajax4jsf.renderkit.ComponentVariables;
+import org.ajax4jsf.renderkit.ComponentsVariableResolver;
import org.ajax4jsf.renderkit.RendererUtils;
import org.richfaces.component.UIInputNumberSlider;
@@ -47,5 +50,33 @@
public void writeEventHandlerFunction(FacesContext context, UIComponent component, String eventName) throws IOException{
RendererUtils.writeEventHandlerFunction(context, component, eventName);
}
+
+ public void prepareVariables(FacesContext context, UIInputNumberSlider slider) {
+ ComponentVariables variables = ComponentsVariableResolver.getVariables(this, slider);
+
+ String inputPosition = (String)slider.getAttributes().get("inputPosition");
+ if (!"right".equals(inputPosition) && !"left".equals(inputPosition)) {
+ inputPosition = "right";
+ }
+ variables.setVariable("inputPosition", inputPosition);
+ boolean disabled = attributeToBoolean(slider, "disabled");
+ boolean showInput = attributeToBoolean(slider, "showInput");
+ boolean manualInput = attributeToBoolean(slider, "enableManualInput");
+
+ variables.setVariable("showInput",new Boolean(showInput));
+ variables.setVariable("inputReadOnly",new Boolean(!manualInput));
+ variables.setVariable("inputDisabled",new Boolean(disabled));
+
+ if (!manualInput || disabled){
+ variables.setVariable("color", "color: gray;");
+ }
+ else{
+ variables.setVariable("color", "");
+ }
+
+ variables.setVariable("inputSize", slider.getAttributes().get("inputSize"));
+ variables.setVariable("style", slider.getStyle());
+ }
+
}
Modified: trunk/ui/inputnumber-slider/src/main/templates/inputNumberSlider.jspx
===================================================================
--- trunk/ui/inputnumber-slider/src/main/templates/inputNumberSlider.jspx 2008-03-13 17:41:37 UTC (rev 6793)
+++ trunk/ui/inputnumber-slider/src/main/templates/inputNumberSlider.jspx 2008-03-13 17:51:09 UTC (rev 6794)
@@ -11,44 +11,24 @@
>
<h:styles>css/slider.xcss</h:styles>
<h:scripts>new org.ajax4jsf.javascript.PrototypeScript(),script/SliderScript.js,/org/richfaces/renderkit/html/scripts/browser_info.js,/org/richfaces/renderkit/html/scripts/events.js</h:scripts>
- <f:clientid var="clientId"/>
+ <f:clientid var="clientId"/>
+
+ <f:call name="prepareVariables" />
<f:resource name="/org/richfaces/renderkit/html/images/spacer.gif" var="spacer" />
<f:resource name="org.richfaces.renderkit.html.images.SliderArrowImage" var="arrow" />
<f:resource name="org.richfaces.renderkit.html.images.SliderArrowSelectedImage" var="arrowSelected" />
- <jsp:scriptlet><![CDATA[
- String inputPosition = (String)component.getAttributes().get("inputPosition");
-
- boolean disabled = attributeToBoolean(component, "disabled");
- boolean showInput = attributeToBoolean(component, "showInput");
- boolean manualInput = attributeToBoolean(component, "enableManualInput");
-
- variables.setVariable("inputReadOnly",new Boolean(!manualInput));
- variables.setVariable("inputDisabled",new Boolean(disabled));
-
- if (!manualInput || disabled){
- variables.setVariable("color", "color: gray;");
- }
- else{
- variables.setVariable("color", "");
- }
-
- variables.setVariable("inputSize", component.getAttributes().get("inputSize"));
- variables.setVariable("style",component.getStyleValue());
-
- ]]></jsp:scriptlet>
-
- <table id="#{clientId}" border="0" cellpadding="0" cellspacing="0" class="dr-insldr rich-slider #{component.attributes['styleClass']}"
+ <table id="#{clientId}" border="0" cellpadding="0" cellspacing="0" class="dr-insldr rich-slider #{component.attributes['styleClass']}"
style="#{style}" x:passThruWithExclusions="id,boundClass,tipClass,class,width,height,style,border">
<tbody>
<tr>
<jsp:scriptlet><![CDATA[
- if ("left".equalsIgnoreCase(inputPosition)) {
+ if ("left".equalsIgnoreCase((String)variables.getVariable("inputPosition"))) {
]]></jsp:scriptlet>
<td rowspan="2" style="text-align: right; vertical-align: bottom">
<jsp:scriptlet><![CDATA[
- if (showInput) {
+ if (((Boolean)variables.getVariable("showInput")).booleanValue()) {
]]></jsp:scriptlet>
<input id="#{clientId}Input"
name="#{clientId}"
@@ -101,11 +81,11 @@
</td>
<jsp:scriptlet><![CDATA[
- if ("right".equalsIgnoreCase(inputPosition)) {
+ if ("right".equalsIgnoreCase((String)variables.getVariable("inputPosition"))) {
]]></jsp:scriptlet>
<td rowspan="2" style="text-align: left; vertical-align: bottom">
<jsp:scriptlet><![CDATA[
- if (showInput) {
+ if (((Boolean)variables.getVariable("showInput")).booleanValue()) {
]]></jsp:scriptlet>
<input id="#{clientId}Input"
name="#{clientId}"
16 years, 10 months
JBoss Rich Faces SVN: r6793 - in trunk/ui/orderingList/src/main: templates/org/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-03-13 13:41:37 -0400 (Thu, 13 Mar 2008)
New Revision: 6793
Modified:
trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ShuttleUtils.js
trunk/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx
Log:
Event.onReady was deleted (bugs RF 2238,2239)
Modified: trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ShuttleUtils.js
===================================================================
--- trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ShuttleUtils.js 2008-03-13 17:14:52 UTC (rev 6792)
+++ trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ShuttleUtils.js 2008-03-13 17:41:37 UTC (rev 6793)
@@ -9,7 +9,7 @@
} else {
window.setTimeout(
function() {
- Utils.execOnLoad(func, condition, timeout);
+ RichShuttleUtils.execOnLoad(func, condition, timeout);
},
timeout
);
Modified: trunk/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx
===================================================================
--- trunk/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx 2008-03-13 17:14:52 UTC (rev 6792)
+++ trunk/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx 2008-03-13 17:41:37 UTC (rev 6793)
@@ -103,7 +103,7 @@
<f:clientId var="cId"/>
<script type="text/javascript">
var clientId = '#{cId}';
- Event.onReady(function() {
+ RichShuttleUtils.execOnLoad(function(){
var cotrolsIdPrefix = [['up', 'disup'], ['down', 'disdown'], ['last', 'dislast'], ['first','disfirst']];
var shuttle = new Richfaces.OrderingList('#{cId}', '#{cId}internal_tab',
'#{cId}internal_header_tab', '#{cId}focusKeeper',
@@ -114,7 +114,7 @@
#{this:getRowClassesAsJSArray(context, component)});
var layoutManager = new LayoutManager('#{cId}internal_header_tab', '#{cId}internal_tab');
layoutManager.widthSynchronization();
- });
+ }, RichShuttleUtils.Condition.ElementPresent("#{cId}"), 100);
//setTimeout(init, 0);
</script>
</div>
16 years, 10 months
JBoss Rich Faces SVN: r6792 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2008-03-13 13:14:52 -0400 (Thu, 13 Mar 2008)
New Revision: 6792
Modified:
trunk/docs/userguide/en/src/main/docbook/included/recursiveTreeNodesAdaptor.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/recursiveTreeNodesAdaptor.xml
Log:
http://jira.jboss.com/jira/browse/RF-658 -description edited.
Modified: trunk/docs/userguide/en/src/main/docbook/included/recursiveTreeNodesAdaptor.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/recursiveTreeNodesAdaptor.desc.xml 2008-03-13 17:14:27 UTC (rev 6791)
+++ trunk/docs/userguide/en/src/main/docbook/included/recursiveTreeNodesAdaptor.desc.xml 2008-03-13 17:14:52 UTC (rev 6792)
@@ -7,26 +7,28 @@
</sectioninfo>
<section>
<title>Description</title>
- <para>
- The <property>rich:recursiveTreeNodesAdaptor</property> provides possibility to define data models and process nodes recursively.
- </para>
-
- <figure>
- <title>Expanded tree with recursive <emphasis role="bold"><property><rich:treeNodesAdaptor></property></emphasis></title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/recursiveTreeNodesAdaptor1.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
+ <para>
+ The <emphasis role="bold"><property><rich:recursiveTreeNodesAdaptor></property></emphasis> is
+ an extension of a <emphasis role="bold"><property><rich:treeNodesAdaptor></property></emphasis> component
+ that provides the possibility to define data models and process nodes recursively. </para>
+ <figure>
+ <title>Expanded tree with <emphasis role="bold">
+ <property><rich:recursiveTreeNodesAdaptor></property>
+ </emphasis></title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/recursiveTreeNodesAdaptor_initial.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
</section>
<section>
<title>Key Features</title>
<itemizedlist>
- <listitem>Allows to define combined data models</listitem>
- <listitem>Possibility to define nodes for processing via attributes</listitem>
- <listitem>Allows to process nodes recursively</listitem>
+ <listitem><para>Allows to define combined data models</para></listitem>
+ <listitem><para>Possibility to define nodes for processing via attributes</para></listitem>
+ <listitem><para>Allows to process nodes recursively</para></listitem>
</itemizedlist>
</section>
</section>
Modified: trunk/docs/userguide/en/src/main/docbook/included/recursiveTreeNodesAdaptor.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/recursiveTreeNodesAdaptor.xml 2008-03-13 17:14:27 UTC (rev 6791)
+++ trunk/docs/userguide/en/src/main/docbook/included/recursiveTreeNodesAdaptor.xml 2008-03-13 17:14:52 UTC (rev 6792)
@@ -46,23 +46,14 @@
<section>
<title>Creating the Component with a Page Tag</title>
- <para>To create the simplest variant of <property>rich:recursiveTreeNodesAdaptor</property> on a page, use the
- following syntax:</para>
-
- <para>
+ <para>
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:recursiveTreeNodesAdaptor var="issue" root="#{project.root}" nodes="#{model.issues}">
- ...
- <rich:treeNode>
- <!-- node content -->
- </rich:treeNode>
- <!-- Others nodes -->
- ...
- </rich:recursiveTreeNodesAdaptor>
-...
-]]></programlisting>
+<rich:tree switchType="ajax" stateAdvisor="#{treeDemoStateAdvisor}">
+ <rich:recursiveTreeNodesAdaptor roots="#{fileSystemBean.sourceRoots}" var="item" nodes="#{item.nodes}" />
+</rich:tree>
+...]]></programlisting>
</section>
<section>
@@ -80,8 +71,22 @@
<section>
<title>Details of Usage</title>
+ <para>
+ The <emphasis role="bold"><property><rich:recursiveTreeNodesAdaptor></property></emphasis> component has a
+ <emphasis><property>"roots"</property></emphasis> attribute that defines collection to use at the top of recursion.
+ </para>
+ <para>
+ The <emphasis><property>"nodes"</property></emphasis> attribute defines collection to use on another recursion levels.
+ </para>
+ <para>
+ The <emphasis><property>"var"</property></emphasis> attribute is used to access to the current collection element.
+ </para>
+ <para>
+ The <emphasis role="bold"><property><rich:recursiveTreeNodesAdaptor></property></emphasis> component can be nested without any limitations.
+ See the following example.
+ </para>
<para>
- <emphasis role="bold">The typical variant of using:</emphasis>
+ <emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
<rich:tree adviseNodeOpened="#{treeModelBean.adviseNodeOpened}" switchType="client">
@@ -117,7 +122,8 @@
...
]]></programlisting>
- </section>
+ </section>
+
<!--
<section>
<title>Details of Usage</title>
@@ -212,12 +218,13 @@
</para>
</section>
- <section>
+
+
+-->
+ <section>
<title>Relevant resources links</title>
<para>
- <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/effect.jsf?c=effect">Here</ulink>
- you can see the example of <emphasis role="bold"><rich:effect></emphasis> usage. </para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/treeNodesAdaptor.jsf?...">Here</ulink>
+ you can see the example of <emphasis role="bold"><property><rich:recursiveTreeNodesAdaptor></property></emphasis> usage. </para>
</section>
-
- -->
</section>
16 years, 10 months
JBoss Rich Faces SVN: r6791 - trunk/docs/userguide/en/src/main/resources/images.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2008-03-13 13:14:27 -0400 (Thu, 13 Mar 2008)
New Revision: 6791
Added:
trunk/docs/userguide/en/src/main/resources/images/recursiveTreeNodesAdaptor_initial.png
Log:
http://jira.jboss.com/jira/browse/RF-658 - initial screenshot changed
Added: trunk/docs/userguide/en/src/main/resources/images/recursiveTreeNodesAdaptor_initial.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/userguide/en/src/main/resources/images/recursiveTreeNodesAdaptor_initial.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
16 years, 10 months
JBoss Rich Faces SVN: r6790 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2008-03-13 13:14:00 -0400 (Thu, 13 Mar 2008)
New Revision: 6790
Modified:
trunk/docs/userguide/en/src/main/docbook/included/treeNodesAdaptor.xml
Log:
http://jira.jboss.com/jira/browse/RF-552 - code verification
Modified: trunk/docs/userguide/en/src/main/docbook/included/treeNodesAdaptor.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/treeNodesAdaptor.xml 2008-03-13 17:11:03 UTC (rev 6789)
+++ trunk/docs/userguide/en/src/main/docbook/included/treeNodesAdaptor.xml 2008-03-13 17:14:00 UTC (rev 6790)
@@ -90,36 +90,36 @@
The <emphasis><property>"var"</property></emphasis> attribute is used to access to the current collection element.
</para>
<para>
- The simple example is placed below.
+ The <emphasis role="bold"><property><rich:treeNodesAdaptor></property></emphasis> component can be nested without any limitations.
+ See the following example.
</para>
<para>
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:tree adviseNodeOpened="#{treeModelBean.adviseNodeOpened}" switchType="client">
- <rich:treeNodesAdaptor id="project" nodes="#{loaderBean.projects}" var="project">
- <rich:treeNode>
- <h:commandLink action="#{project.click}" value="Project: #{project.name}" />
- </rich:treeNode>
- <rich:treeNodesAdaptor id="srcDir" var="srcDir" nodes="#{project.srcDirs}">
- <rich:treeNode>
- <h:commandLink action="#{srcDir.click}" value="Source directory: #{srcDir.name}" />
- </rich:treeNode>
- <rich:treeNodesAdaptor id="pkg" var="pkg" nodes="#{srcDir.packages}">
- <rich:treeNode>
- <h:commandLink action="#{pkg.click}" value="Package: #{pkg.name}" />
- </rich:treeNode>
- <rich:treeNodesAdaptor id="class" var="class" nodes="#{pkg.classes}">
- <rich:treeNode>
- <h:commandLink action="#{class.click}" value="Class: #{class.name}" />
- </rich:treeNode>
- </rich:treeNodesAdaptor>
- </rich:treeNodesAdaptor>
- </rich:treeNodesAdaptor>
- </rich:treeNodesAdaptor>
- </rich:tree>
-...
-]]></programlisting>
+<rich:tree adviseNodeOpened="#{treeModelBean.adviseNodeOpened}" switchType="client">
+ <rich:treeNodesAdaptor id="project" nodes="#{loaderBean.projects}" var="project">
+ <rich:treeNode>
+ <h:commandLink action="#{project.click}" value="Project: #{project.name}" />
+ </rich:treeNode>
+ <rich:treeNodesAdaptor id="srcDir" var="srcDir" nodes="#{project.srcDirs}">
+ <rich:treeNode>
+ <h:commandLink action="#{srcDir.click}" value="Source directory: #{srcDir.name}" />
+ </rich:treeNode>
+ <rich:treeNodesAdaptor id="pkg" var="pkg" nodes="#{srcDir.packages}">
+ <rich:treeNode>
+ <h:commandLink action="#{pkg.click}" value="Package: #{pkg.name}" />
+ </rich:treeNode>
+ <rich:treeNodesAdaptor id="class" var="class" nodes="#{pkg.classes}">
+ <rich:treeNode>
+ <h:commandLink action="#{class.click}" value="Class: #{class.name}" />
+ </rich:treeNode>
+ </rich:treeNodesAdaptor>
+ </rich:treeNodesAdaptor>
+ </rich:treeNodesAdaptor>
+ </rich:treeNodesAdaptor>
+</rich:tree>
+...]]></programlisting>
</section>
<section>
16 years, 10 months