JBoss Rich Faces SVN: r3336 - in trunk: extensions/portlet/src/main/java/org/ajax4jsf/portlet/application and 6 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2007-10-11 21:04:40 -0400 (Thu, 11 Oct 2007)
New Revision: 3336
Removed:
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletWindowStates.java
Modified:
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/AjaxFacesPortlet.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/PortletAjaxContext.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortalStateManager.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletStateHolder.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletViewHandler.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletViewState.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/PortletContextImpl.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/SessionAttributesNames.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/lifecycle/ApplyValuesPhase.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/lifecycle/InvokeApplicationPhase.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/lifecycle/LifecyclePhase.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/lifecycle/PortletLifecycle.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/lifecycle/ProcessValidatorsPhase.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/lifecycle/RenderResponsePhase.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/lifecycle/RestoreViewPhase.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/lifecycle/UpdateModelPhase.java
trunk/extensions/portlet/src/test/java/org/ajax4jsf/portlet/application/PortletViewStateTestCase.java
trunk/framework/impl/src/main/java/org/ajax4jsf/application/AjaxStateManager.java
trunk/samples/ajaxPortlet/src/main/java/portal/Bean.java
trunk/samples/ajaxPortlet/src/main/webapp/WEB-INF/faces-config.xml
Log:
Portlet framework start worked with Jboss Portal 2.6
Modified: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/AjaxFacesPortlet.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/AjaxFacesPortlet.java 2007-10-11 19:00:36 UTC (rev 3335)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/AjaxFacesPortlet.java 2007-10-12 01:04:40 UTC (rev 3336)
@@ -26,13 +26,12 @@
import javax.portlet.PortletSession;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
+import javax.servlet.ServletResponse;
import org.ajax4jsf.context.AjaxContext;
import org.ajax4jsf.portlet.application.ComponentsLoader;
import org.ajax4jsf.portlet.application.ComponentsLoaderImpl;
import org.ajax4jsf.portlet.application.PortletStateHolder;
-import org.ajax4jsf.portlet.application.PortletViewState;
-import org.ajax4jsf.portlet.application.PortletWindowStates;
import org.ajax4jsf.portlet.context.AbstractExternalContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -126,9 +125,9 @@
}
FacesContext facesContext = getFacesContext(request, response);
try {
- setViewId(facesContext);
+// setViewId(facesContext);
execute(facesContext);
- saveView(facesContext);
+// saveView(facesContext);
} catch (Exception e) {
log.error("Error processing execute lifecycle", e);
throw new PortletException("Error processing execute lifecycle ", e);
@@ -137,14 +136,6 @@
}
}
- protected void saveView(FacesContext facesContext) {
- PortletStateHolder portletStateHolder = PortletStateHolder.getInstance(facesContext);
- PortletWindowStates states = portletStateHolder.getWindowStates(facesContext);
- String viewId = facesContext.getViewRoot().getViewId();
- states.setViewId(viewId);
- PortletViewState state = states.getState(viewId);
- state.save(facesContext);
- }
/*
* (non-Javadoc)
@@ -176,10 +167,11 @@
// TODO - configure html element and style/class.
writer.println("<div id='" + namespace + "'>");
// writer.flush();
- restoreView(facesContext);
+// restoreView(facesContext);
AjaxContext ajaxContext = AjaxContext.getCurrentInstance(facesContext);
- ajaxContext.getCommonAjaxParameters().put(AbstractExternalContext.ACTION__PARAMETER, facesContext.getApplication().getViewHandler().getActionURL(facesContext, facesContext.getViewRoot().getViewId()));
+ ajaxContext.getCommonAjaxParameters().put(AbstractExternalContext.ACTION__PARAMETER, response.createActionURL().toString());
ajaxContext.getCommonAjaxParameters().put(AbstractExternalContext.PORTLET_MODE_PARAMETER,request.getPortletMode().toString());
+ ajaxContext.getCommonAjaxParameters().put(AbstractExternalContext.NAMESPACE_PARAMETER, namespace);
render(facesContext);
writer.println("</div>");
PortletSession portletSession = request.getPortletSession(true);
@@ -202,22 +194,6 @@
}
}
- protected void restoreView(FacesContext facesContext) {
- PortletStateHolder portletStateHolder = PortletStateHolder.getInstance(facesContext);
- PortletWindowStates states = portletStateHolder.getWindowStates(facesContext);
- String viewId = states.getViewId();
- UIViewRoot viewRoot = null;
- if(null != viewId){
- PortletViewState viewState = states.getState(viewId);
- viewRoot = viewState.restore(facesContext,getComponentLoader());
- } else {
- viewId = portletStateHolder.getViewId(facesContext);
- }
- if(null == viewRoot){
- viewRoot = facesContext.getApplication().getViewHandler().createView(facesContext, viewId);
- }
- facesContext.setViewRoot(viewRoot);
- }
/*
* (non-Javadoc)
@@ -301,10 +277,11 @@
String namespace = null;
if (response instanceof RenderResponse) {
namespace = ((RenderResponse) response).getNamespace();
- } else if (null != externalContext.getRequestParameterMap().get(
- AbstractExternalContext.NAMESPACE_PARAMETER)) {
+ } else if (response instanceof ServletResponse) {
namespace = (String) externalContext.getRequestParameterMap().get(
AbstractExternalContext.NAMESPACE_PARAMETER);
+ } else {
+ throw new IllegalStateException("portlet Namespace not availible at this phase");
}
return namespace;
}
Modified: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/PortletAjaxContext.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/PortletAjaxContext.java 2007-10-11 19:00:36 UTC (rev 3335)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/PortletAjaxContext.java 2007-10-12 01:04:40 UTC (rev 3336)
@@ -84,6 +84,10 @@
if(null != actionUrl){
map.put(AbstractExternalContext.ACTION__PARAMETER, actionUrl);
}
+ String portletMode = (String) facesContext.getExternalContext().getRequestParameterMap().get(AbstractExternalContext.PORTLET_MODE_PARAMETER);
+ if(null != actionUrl){
+ map.put(AbstractExternalContext.PORTLET_MODE_PARAMETER, portletMode);
+ }
return map;
}
}
Modified: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortalStateManager.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortalStateManager.java 2007-10-11 19:00:36 UTC (rev 3335)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortalStateManager.java 2007-10-12 01:04:40 UTC (rev 3336)
@@ -27,40 +27,26 @@
componentLoader = new ComponentsLoaderImpl();
}
- /* (non-Javadoc)
- * @see javax.faces.application.StateManager#restoreView(javax.faces.context.FacesContext, java.lang.String, java.lang.String)
- */
- public UIViewRoot restoreView(FacesContext context, String viewId,
- String renderKitId) {
- UIViewRoot viewRoot = null;
- if(isSavingStateInClient(context)){
- viewRoot = super.restoreView(context, viewId, renderKitId);
- } else {
- PortletStateHolder portletStateHolder = PortletStateHolder.getInstance(context);
- PortletWindowStates windowStates = portletStateHolder.getWindowStates(context);
- PortletViewState viewState = windowStates.getState(viewId);
- viewRoot = viewState.restore(context,componentLoader);
- }
- // TODO - implement portal-specific view state.
- return viewRoot;
-
+
+ protected SerializedView saveStateInSession(FacesContext context,
+ Object treeStructure, Object state) {
+ PortletViewState windowState = PortletStateHolder.getInstance(context).getWindowState(context);
+ windowState.setTreeStructure(treeStructure);
+ windowState.setComponentsState(state);
+ windowState.setViewRoot(context.getViewRoot());
+ String viewId = context.getViewRoot().getViewId();
+ windowState.setViewId(viewId);
+ return new SerializedView(viewId,null);
}
- public SerializedView saveSerializedView(FacesContext context) {
- SerializedView serializedView = null;
- if(isSavingStateInClient(context)){
- serializedView = super.saveSerializedView(context);
- } else {
- // TODO - implement portal-specific view state saving.
- PortletStateHolder portletStateHolder = PortletStateHolder.getInstance(context);
- PortletWindowStates windowStates = portletStateHolder.getWindowStates(context);
- String viewId = context.getViewRoot().getViewId();
- windowStates.setViewId(viewId);
- PortletViewState viewState = windowStates.getState(viewId);
- viewState.save(context);
- serializedView=new SerializedView(viewId,null);
- }
- return serializedView;
+ @Override
+ protected Object[] restoreStateFromSession(FacesContext context,
+ String viewId, String renderKitId) {
+ Object[] state = new Object[2];
+ PortletViewState windowState = PortletStateHolder.getInstance(context).getWindowState(context);
+ state[0]=windowState.getTreeStructure();
+ state[1]=windowState.getComponentsState();
+ return state;
}
public boolean isSavingStateInClient(FacesContext context) {
Modified: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletStateHolder.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletStateHolder.java 2007-10-11 19:00:36 UTC (rev 3335)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletStateHolder.java 2007-10-12 01:04:40 UTC (rev 3336)
@@ -96,14 +96,8 @@
}
// Second - find stored viewId for a current state and namespace.
if (null == viewId) {
- viewId = getWindowStates(context).getViewId();
+ viewId = getWindowState(context).getViewId();
}
- // Third - check a request attribute
- if (null == viewId) {
- viewId = (String) context.getExternalContext()
- .getRequestParameterMap().get(
- AbstractExternalContext.VIEW_ID_PARAMETER);
- }
// If none of above happen, try to get default viewId for a current
// mode.
if (null == viewId) {
@@ -132,16 +126,15 @@
* @param context
* @return
*/
- public PortletWindowStates getWindowStates(FacesContext context) {
- String portletNamespace = AjaxFacesPortlet.getPortletNamespace(context);
+ public PortletViewState getWindowState(FacesContext context) {
PortletMode portletMode = AjaxFacesPortlet.getPortletMode(context);
if (null == portletMode) {
portletMode = lastMode;
}
- StateKey windowKey = new StateKey(portletMode, portletNamespace);
- PortletWindowStates state = (PortletWindowStates) states.get(windowKey);
+ StateKey windowKey = new StateKey(portletMode);
+ PortletViewState state = (PortletViewState) states.get(windowKey);
if (null == state) {
- state = new PortletWindowStates();
+ state = new PortletViewState();
states.put(windowKey, state);
}
return state;
@@ -160,7 +153,14 @@
private PortletMode mode;
private String namespace;
+
+
+ public StateKey(PortletMode mode) {
+ super();
+ this.mode = mode;
+ }
+
/**
* @param mode
* @param namespace
Modified: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletViewHandler.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletViewHandler.java 2007-10-11 19:00:36 UTC (rev 3335)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletViewHandler.java 2007-10-12 01:04:40 UTC (rev 3336)
@@ -29,6 +29,11 @@
super(parent);
}
+
+ public void initView(FacesContext context) throws FacesException {
+ super.initView(context);
+ }
+
public UIViewRoot createView(FacesContext facesContext, String viewId) {
AjaxContext ajaxContext = AjaxContext.getCurrentInstance(facesContext);
boolean ajaxRequest = ajaxContext.isAjaxRequest(facesContext);
@@ -56,8 +61,8 @@
if (response instanceof RenderResponse) {
RenderResponse renderResponse = (RenderResponse) response;
PortletURL portletURL = renderResponse.createActionURL();
- portletURL.setParameter(AbstractExternalContext.VIEW_ID_PARAMETER, context.getViewRoot().getViewId());
- portletURL.setParameter(AbstractExternalContext.NAMESPACE_PARAMETER, renderResponse.getNamespace());
+// portletURL.setParameter(AbstractExternalContext.VIEW_ID_PARAMETER, context.getViewRoot().getViewId());
+// portletURL.setParameter(AbstractExternalContext.NAMESPACE_PARAMETER, renderResponse.getNamespace());
return portletURL.toString();
} else if(null!=portalActionURL){
return portalActionURL;
Modified: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletViewState.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletViewState.java 2007-10-11 19:00:36 UTC (rev 3335)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletViewState.java 2007-10-12 01:04:40 UTC (rev 3336)
@@ -41,20 +41,45 @@
private Object componentsState;
private UIViewRoot viewRoot;
+
+ private String viewId;
+
+ private Map requestScopeBeans;
- public void save(FacesContext facesContext) {
- UIViewRoot viewRoot = facesContext.getViewRoot();
- // setViewRoot(viewRoot);
- TreeStrutureNode rootNode = new TreeStrutureNode();
- rootNode.apply(viewRoot);
- setTreeStructure(rootNode);
- setComponentsState(viewRoot.processSaveState(facesContext));
- saveMessages(facesContext);
- // facesContext.getExternalContext().getSessionMap().put(PortletViewState.SAVED_VIEW_ATTRIBUTE,
- // this);
- }
/**
+ * @return the requestScopeBeans
+ */
+ public Map getRequestScopeBeans() {
+ return requestScopeBeans;
+ }
+
+
+ /**
+ * @param requestScopeBeans the requestScopeBeans to set
+ */
+ public void setRequestScopeBeans(Map requestScopeBeans) {
+ this.requestScopeBeans = requestScopeBeans;
+ }
+
+
+ /**
+ * @return the viewId
+ */
+ public String getViewId() {
+ return viewId;
+ }
+
+
+ /**
+ * @param viewId the viewId to set
+ */
+ public void setViewId(String viewId) {
+ this.viewId = viewId;
+ }
+
+
+ /**
* @param facesContext
*/
public void saveMessages(FacesContext facesContext) {
@@ -69,23 +94,7 @@
}
}
- public UIViewRoot restore(FacesContext facesContext,ComponentsLoader loader) {
- // facesContext.setViewRoot(getViewRoot());
- TreeStrutureNode structure = (TreeStrutureNode) getTreeStructure();
- UIViewRoot root = null;
- if (null != structure) {
- root = (UIViewRoot) structure.restore(loader);
- root.processRestoreState(facesContext, getComponentsState());
- // facesContext.setViewRoot(root);
- if (facesContext.getExternalContext().getRequest() instanceof RenderRequest) {
- restoreMessages(facesContext);
- }
-
- }
- return root;
- }
-
/**
* @param facesContext
*/
@@ -183,62 +192,4 @@
this.treeStructure = treeStructure;
}
- protected static class TreeStrutureNode implements Serializable {
- /**
- *
- */
- private static final long serialVersionUID = -9038742487716977254L;
-
- private Map facets = new HashMap();
-
- private List children = new ArrayList();
-
- private String type;
-
- private String id;
-
- public void apply(UIComponent component) {
- type = component.getClass().getName();
- id = component.getId();
- Map componentFacets = component.getFacets();
- for (Iterator i = componentFacets.entrySet().iterator(); i
- .hasNext();) {
- Entry element = (Entry) i.next();
- UIComponent f = (UIComponent) element.getValue();
- if (!f.isTransient()) {
- TreeStrutureNode facet = new TreeStrutureNode();
- facet.apply(f);
- facets.put(element.getKey(), facet);
-
- }
- }
- for (Iterator i = component.getChildren().iterator(); i.hasNext();) {
- UIComponent child = (UIComponent) i.next();
- if (!child.isTransient()) {
- TreeStrutureNode t = new TreeStrutureNode();
- t.apply(child);
- children.add(t);
-
- }
- }
- }
-
- public UIComponent restore(ComponentsLoader loader) {
- UIComponent component;
- component = loader.createComponent(type);
- component.setId(id);
- for (Iterator i = facets.entrySet().iterator(); i.hasNext();) {
- Entry element = (Entry) i.next();
- UIComponent facet = ((TreeStrutureNode) element.getValue())
- .restore(loader);
- component.getFacets().put((String) element.getKey(), facet);
- }
- for (Iterator i = children.iterator(); i.hasNext();) {
- TreeStrutureNode node = (TreeStrutureNode) i.next();
- UIComponent child = node.restore(loader);
- component.getChildren().add(child);
- }
- return component;
- }
- }
}
Deleted: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletWindowStates.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletWindowStates.java 2007-10-11 19:00:36 UTC (rev 3335)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletWindowStates.java 2007-10-12 01:04:40 UTC (rev 3336)
@@ -1,52 +0,0 @@
-/**
- *
- */
-package org.ajax4jsf.portlet.application;
-
-import java.io.Serializable;
-import java.util.Map;
-
-import org.apache.commons.collections.map.LRUMap;
-
-/**
- * @author asmirnov
- *
- */
-public class PortletWindowStates implements Serializable {
-
- /**
- *
- */
- private static final long serialVersionUID = 3239697059998528947L;
-
- private String viewId;
-
- private Map viewStates;
-
- public PortletWindowStates() {
- viewStates = new LRUMap();
- }
-
- /**
- * @return the viewId
- */
- public String getViewId() {
- return viewId;
- }
-
- /**
- * @param viewId the viewId to set
- */
- public void setViewId(String viewId) {
- this.viewId = viewId;
- }
-
- public PortletViewState getState(String viewId) {
- PortletViewState state = (PortletViewState) viewStates.get(viewId);
- if(null == state){
- state = new PortletViewState();
- viewStates.put(viewId, state);
- }
- return state;
- }
-}
Modified: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/PortletContextImpl.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/PortletContextImpl.java 2007-10-11 19:00:36 UTC (rev 3335)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/PortletContextImpl.java 2007-10-12 01:04:40 UTC (rev 3336)
@@ -35,283 +35,289 @@
*
*/
public class PortletContextImpl extends AbstractExternalContext {
-
- private String namespace;
- public PortletContextImpl(PortletContext context, PortletRequest request,
- PortletResponse response) {
- super(context, request, response);
- }
-
- public void setResponseCharacterEncoding(String encoding) {
- // Do nothing
- }
-
- public String getResponseCharacterEncoding() {
- PortletResponse portletResponse = getPortletResponse();
- if (portletResponse instanceof RenderResponse) {
+ private String namespace;
+
+ public PortletContextImpl(PortletContext context, PortletRequest request,
+ PortletResponse response) {
+ super(context, request, response);
+ }
+
+ public void setResponseCharacterEncoding(String encoding) {
+ // Do nothing
+ }
+
+ public String getResponseCharacterEncoding() {
+ PortletResponse portletResponse = getPortletResponse();
+ if (portletResponse instanceof RenderResponse) {
RenderResponse renderResponse = (RenderResponse) portletResponse;
return renderResponse.getCharacterEncoding();
- }else {
+ } else {
return null;
}
- }
-
-
- public String getResponseContentType() {
- PortletResponse portletResponse = getPortletResponse();
- if (portletResponse instanceof RenderResponse) {
+ }
+
+ public String getResponseContentType() {
+ PortletResponse portletResponse = getPortletResponse();
+ if (portletResponse instanceof RenderResponse) {
RenderResponse renderResponse = (RenderResponse) portletResponse;
return renderResponse.getContentType();
- }else {
+ } else {
return null;
}
- }
+ }
- public void setRequestCharacterEncoding(String encoding)
- throws UnsupportedEncodingException {
- PortletRequest portletRequest = getPortletRequest();
- if (portletRequest instanceof ActionRequest) {
- ActionRequest actionRequest = (ActionRequest) portletRequest;
- actionRequest.setCharacterEncoding(encoding);
+ public void setRequestCharacterEncoding(String encoding)
+ throws UnsupportedEncodingException {
+ PortletRequest portletRequest = getPortletRequest();
+ if (portletRequest instanceof ActionRequest) {
+ try {
+ ActionRequest actionRequest = (ActionRequest) portletRequest;
+ actionRequest.setCharacterEncoding(encoding);
+
+ } catch (IllegalStateException e) {
+ // TODO: handle exception
+ }
}
- }
-
- public String getRequestCharacterEncoding() {
- PortletRequest portletRequest = getPortletRequest();
- if (portletRequest instanceof ActionRequest) {
+ }
+
+ public String getRequestCharacterEncoding() {
+ PortletRequest portletRequest = getPortletRequest();
+ if (portletRequest instanceof ActionRequest) {
ActionRequest actionRequest = (ActionRequest) portletRequest;
return actionRequest.getCharacterEncoding();
} else {
return null;
}
- }
-
-
- public String getRequestContentType() {
- return null;
- }
+ }
- private PortletContext getPortletContext() {
- return (PortletContext) getContext();
- }
+ public String getRequestContentType() {
+ return null;
+ }
- private PortletRequest getPortletRequest() {
- return (PortletRequest) getRequest();
- }
+ private PortletContext getPortletContext() {
+ return (PortletContext) getContext();
+ }
- private PortletResponse getPortletResponse() {
- return (PortletResponse) getResponse();
- }
+ private PortletRequest getPortletRequest() {
+ return (PortletRequest) getRequest();
+ }
- public String getInitParameter(String name) {
- return getPortletContext().getInitParameter(name);
- }
+ private PortletResponse getPortletResponse() {
+ return (PortletResponse) getResponse();
+ }
- protected String getNamespace() {
- if (null == namespace) {
- if (getResponse() instanceof RenderResponse) {
- namespace = ((RenderResponse) getResponse()).getNamespace();
- } else if (null != getRequestParameter(NAMESPACE_PARAMETER)) {
- namespace = (String) getRequestParameter(NAMESPACE_PARAMETER);
- } else {
- namespace = "";
- }
+ public String getInitParameter(String name) {
+ return getPortletContext().getInitParameter(name);
}
- return namespace;
- }
- public URL getResource(String path) throws MalformedURLException {
- return getPortletContext().getResource(path);
- }
+ protected String getNamespace() {
+ if (null == namespace) {
+ if (getResponse() instanceof RenderResponse) {
+ namespace = ((RenderResponse) getResponse()).getNamespace();
+ } else {
+ throw new IllegalStateException(
+ "Portlet namespace not availible in processAction phase");
+ }
+ }
+ return namespace;
+ }
- public InputStream getResourceAsStream(String path) {
- return getPortletContext().getResourceAsStream(path);
- }
+ public URL getResource(String path) throws MalformedURLException {
+ return getPortletContext().getResource(path);
+ }
- public Set getResourcePaths(String path) {
- return getPortletContext().getResourcePaths(path);
- }
+ public InputStream getResourceAsStream(String path) {
+ return getPortletContext().getResourceAsStream(path);
+ }
- protected Enumeration enumerateRequestParameterNames() {
- return getPortletRequest().getParameterNames();
- }
+ public Set getResourcePaths(String path) {
+ return getPortletContext().getResourcePaths(path);
+ }
- protected Object getContextAttribute(String name) {
- return getPortletContext().getAttribute(name);
- }
+ protected Enumeration enumerateRequestParameterNames() {
+ return getPortletRequest().getParameterNames();
+ }
- protected Enumeration getContextAttributeNames() {
- return getPortletContext().getAttributeNames();
- }
+ protected Object getContextAttribute(String name) {
+ return getPortletContext().getAttribute(name);
+ }
- protected Enumeration getInitParametersNames() {
- return getPortletContext().getInitParameterNames();
- }
+ protected Enumeration getContextAttributeNames() {
+ return getPortletContext().getAttributeNames();
+ }
- protected Object getRequestAttribute(String name) {
- return getPortletRequest().getAttribute(name);
- }
+ protected Enumeration getInitParametersNames() {
+ return getPortletContext().getInitParameterNames();
+ }
- protected Enumeration getRequestAttributeNames() {
- return getPortletRequest().getAttributeNames();
- }
+ protected Object getRequestAttribute(String name) {
+ return getPortletRequest().getAttribute(name);
+ }
- public Map getRequestParameterValuesMap() {
- return getPortletRequest().getParameterMap();
- }
+ protected Enumeration getRequestAttributeNames() {
+ return getPortletRequest().getAttributeNames();
+ }
- protected Object getRequestParameterValues(String name) {
- return getPortletRequest().getParameterValues(name);
- }
+ public Map getRequestParameterValuesMap() {
+ return getPortletRequest().getParameterMap();
+ }
- protected Object getRequestHeader(String name) {
- return getPortletRequest().getProperty(name);
- }
+ protected Object getRequestParameterValues(String name) {
+ return getPortletRequest().getParameterValues(name);
+ }
- protected Enumeration getRequestHeaderNames() {
- return getPortletRequest().getPropertyNames();
- }
+ protected Object getRequestHeader(String name) {
+ return getPortletRequest().getProperty(name);
+ }
- protected String[] getRequestHeaderValues(String name) {
- Enumeration properties = getPortletRequest().getProperties(name);
- List values = new ArrayList();
- while (properties.hasMoreElements()) {
- Object value = (Object) properties.nextElement();
- values.add(value);
+ protected Enumeration getRequestHeaderNames() {
+ return getPortletRequest().getPropertyNames();
}
- return (String[]) values.toArray(EMPTY_STRING_ARRAY);
- }
- protected Object getRequestParameter(String name) {
- return getPortletRequest().getParameter(name);
- }
+ protected String[] getRequestHeaderValues(String name) {
+ Enumeration properties = getPortletRequest().getProperties(name);
+ List values = new ArrayList();
+ while (properties.hasMoreElements()) {
+ Object value = (Object) properties.nextElement();
+ values.add(value);
+ }
+ return (String[]) values.toArray(EMPTY_STRING_ARRAY);
+ }
- protected Object getSessionAttribute(String name) {
- return getPortletRequest().getPortletSession(true).getAttribute(name,PortletSession.PORTLET_SCOPE);
- }
+ protected Object getRequestParameter(String name) {
+ return getPortletRequest().getParameter(name);
+ }
- protected Enumeration getSessionAttributeNames() {
- return getPortletRequest().getPortletSession(true).getAttributeNames(PortletSession.PORTLET_SCOPE);
- }
+ protected Object getSessionAttribute(String name) {
+ return getPortletRequest().getPortletSession(true).getAttribute(name,
+ PortletSession.PORTLET_SCOPE);
+ }
- protected void removeContextAttribute(String name) {
- getPortletContext().removeAttribute(name);
- }
+ protected Enumeration getSessionAttributeNames() {
+ return getPortletRequest().getPortletSession(true).getAttributeNames(
+ PortletSession.PORTLET_SCOPE);
+ }
- protected void removeRequestAttribute(String name) {
- getPortletRequest().removeAttribute(name);
- }
+ protected void removeContextAttribute(String name) {
+ getPortletContext().removeAttribute(name);
+ }
- protected void removeSessionAttribute(String name) {
- getPortletRequest().getPortletSession(true).removeAttribute(name,PortletSession.PORTLET_SCOPE);
- }
+ protected void removeRequestAttribute(String name) {
+ getPortletRequest().removeAttribute(name);
+ }
- protected void setContextAttribute(String name, Object value) {
- getPortletContext().setAttribute(name, value);
- }
+ protected void removeSessionAttribute(String name) {
+ getPortletRequest().getPortletSession(true).removeAttribute(name,
+ PortletSession.PORTLET_SCOPE);
+ }
- protected void setRequestAttribute(String name, Object value) {
- getPortletRequest().setAttribute(name, value);
- }
+ protected void setContextAttribute(String name, Object value) {
+ getPortletContext().setAttribute(name, value);
+ }
- protected void setSessionAttribute(String name, Object value) {
- getPortletRequest().getPortletSession(true).setAttribute(name, value,PortletSession.PORTLET_SCOPE);
- }
+ protected void setRequestAttribute(String name, Object value) {
+ getPortletRequest().setAttribute(name, value);
+ }
- public void dispatch(String path) throws IOException {
- if (null == path) {
- throw new NullPointerException("Path to new view is null");
+ protected void setSessionAttribute(String name, Object value) {
+ getPortletRequest().getPortletSession(true).setAttribute(name, value,
+ PortletSession.PORTLET_SCOPE);
}
- if (!(getRequest() instanceof RenderRequest && getResponse() instanceof RenderResponse)) {
- throw new IllegalStateException(
- "Dispatch to new view not at render phase");
+
+ public void dispatch(String path) throws IOException {
+ if (null == path) {
+ throw new NullPointerException("Path to new view is null");
+ }
+ if (!(getRequest() instanceof RenderRequest && getResponse() instanceof RenderResponse)) {
+ throw new IllegalStateException(
+ "Dispatch to new view not at render phase");
+ }
+ PortletRequestDispatcher dispatcher = getPortletContext()
+ .getRequestDispatcher(path);
+ if (null == dispatcher) {
+ throw new IllegalStateException(
+ "Dispatcher for render request is not created");
+ }
+ try {
+ dispatcher.include((RenderRequest) getRequest(),
+ (RenderResponse) getResponse());
+ } catch (PortletException e) {
+ throw new FacesException(e);
+ }
}
- PortletRequestDispatcher dispatcher = getPortletContext()
- .getRequestDispatcher(path);
- if (null == dispatcher) {
- throw new IllegalStateException(
- "Dispatcher for render request is not created");
+
+ public String encodeActionURL(String url) {
+ if (null == url) {
+ throw new NullPointerException();
+ }
+ return url;
}
- try {
- dispatcher.include((RenderRequest) getRequest(),
- (RenderResponse) getResponse());
- } catch (PortletException e) {
- throw new FacesException(e);
+
+ public String encodeResourceURL(String url) {
+ return getPortletResponse().encodeURL(url);
}
- }
- public String encodeActionURL(String url) {
- if (null == url) {
- throw new NullPointerException();
+ public String getAuthType() {
+ return getPortletRequest().getAuthType();
}
- return url;
- }
- public String encodeResourceURL(String url) {
- return getPortletResponse().encodeURL(url);
- }
+ public String getRemoteUser() {
+ return getPortletRequest().getRemoteUser();
+ }
- public String getAuthType() {
- return getPortletRequest().getAuthType();
- }
+ public String getRequestContextPath() {
+ return getPortletRequest().getContextPath();
+ }
- public String getRemoteUser() {
- return getPortletRequest().getRemoteUser();
- }
+ public Locale getRequestLocale() {
+ return getPortletRequest().getLocale();
+ }
- public String getRequestContextPath() {
- return getPortletRequest().getContextPath();
- }
+ public Iterator getRequestLocales() {
+ return new EnumerationIterator(getPortletRequest().getLocales());
+ }
- public Locale getRequestLocale() {
- return getPortletRequest().getLocale();
- }
+ public String getRequestPathInfo() {
+ String pathInfo = (String) getRequestParameter(VIEW_ID_PARAMETER);
+ if (null == pathInfo) {
+ pathInfo = (String) getRequestAttribute(VIEW_ID_PARAMETER);
+ }
+ return pathInfo;
+ }
- public Iterator getRequestLocales() {
- return new EnumerationIterator(getPortletRequest().getLocales());
- }
+ public String getRequestServletPath() {
+ return null;
+ }
- public String getRequestPathInfo() {
- String pathInfo = (String) getRequestParameter(VIEW_ID_PARAMETER);
- if(null== pathInfo){
- pathInfo = (String) getRequestAttribute(VIEW_ID_PARAMETER);
+ public Object getSession(boolean create) {
+ return getPortletRequest().getPortletSession();
}
- return pathInfo;
- }
- public String getRequestServletPath() {
- return null;
- }
+ public Principal getUserPrincipal() {
+ return getPortletRequest().getUserPrincipal();
+ }
- public Object getSession(boolean create) {
- return getPortletRequest().getPortletSession();
- }
+ public boolean isUserInRole(String role) {
+ return getPortletRequest().isUserInRole(role);
+ }
- public Principal getUserPrincipal() {
- return getPortletRequest().getUserPrincipal();
- }
+ public void log(String message) {
+ getPortletContext().log(message);
+ }
- public boolean isUserInRole(String role) {
- return getPortletRequest().isUserInRole(role);
- }
+ public void log(String message, Throwable exception) {
+ getPortletContext().log(message, exception);
+ }
- public void log(String message) {
- getPortletContext().log(message);
- }
-
- public void log(String message, Throwable exception) {
- getPortletContext().log(message, exception);
- }
-
- public void redirect(String url) throws IOException {
- if (null == url) {
- throw new NullPointerException("Path to redirect is null");
+ public void redirect(String url) throws IOException {
+ if (null == url) {
+ throw new NullPointerException("Path to redirect is null");
+ }
+ if (!(getRequest() instanceof ActionRequest && getResponse() instanceof ActionResponse)) {
+ throw new IllegalStateException(
+ "Redirect to new url not at action phase");
+ }
+ ((ActionResponse) getResponse()).sendRedirect(url);
}
- if (!(getRequest() instanceof ActionRequest && getResponse() instanceof ActionResponse)) {
- throw new IllegalStateException(
- "Redirect to new url not at action phase");
- }
- ((ActionResponse) getResponse()).sendRedirect(url);
- }
}
Modified: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/SessionAttributesNames.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/SessionAttributesNames.java 2007-10-11 19:00:36 UTC (rev 3335)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/SessionAttributesNames.java 2007-10-12 01:04:40 UTC (rev 3336)
@@ -49,7 +49,7 @@
while (names.hasMoreElements() && null == next) {
String name = (String) names.nextElement();
if(name.startsWith(prefix)){
- next = name.substring(0, prefix.length());
+ next = name.substring(prefix.length());
}
}
}
Modified: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/lifecycle/ApplyValuesPhase.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/lifecycle/ApplyValuesPhase.java 2007-10-11 19:00:36 UTC (rev 3335)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/lifecycle/ApplyValuesPhase.java 2007-10-12 01:04:40 UTC (rev 3336)
@@ -20,7 +20,7 @@
*/
public ApplyValuesPhase(Lifecycle lifecycle) {
super(lifecycle);
- nextPhase = new UpdateModelPhase(lifecycle);
+ nextPhase = new ProcessValidatorsPhase(lifecycle);
}
/* (non-Javadoc)
@@ -33,7 +33,7 @@
/* (non-Javadoc)
* @see org.ajax4jsf.portlet.lifecycle.LifecyclePhase#executePhase(javax.faces.context.FacesContext)
*/
- protected void executePhase(FacesContext context) {
+ public void executePhase(FacesContext context) {
context.getViewRoot().processDecodes(context);
}
Modified: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/lifecycle/InvokeApplicationPhase.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/lifecycle/InvokeApplicationPhase.java 2007-10-11 19:00:36 UTC (rev 3335)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/lifecycle/InvokeApplicationPhase.java 2007-10-12 01:04:40 UTC (rev 3336)
@@ -31,7 +31,7 @@
/* (non-Javadoc)
* @see org.ajax4jsf.portlet.lifecycle.LifecyclePhase#executePhase(javax.faces.context.FacesContext)
*/
- protected void executePhase(FacesContext context) {
+ public void executePhase(FacesContext context) {
context.getViewRoot().processApplication(context);
}
Modified: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/lifecycle/LifecyclePhase.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/lifecycle/LifecyclePhase.java 2007-10-11 19:00:36 UTC (rev 3335)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/lifecycle/LifecyclePhase.java 2007-10-12 01:04:40 UTC (rev 3336)
@@ -84,7 +84,7 @@
/**
* @param context
*/
- protected abstract void executePhase(FacesContext context);
+ public abstract void executePhase(FacesContext context);
/**
Modified: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/lifecycle/PortletLifecycle.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/lifecycle/PortletLifecycle.java 2007-10-11 19:00:36 UTC (rev 3335)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/lifecycle/PortletLifecycle.java 2007-10-12 01:04:40 UTC (rev 3336)
@@ -3,14 +3,23 @@
*/
package org.ajax4jsf.portlet.lifecycle;
+import java.io.Serializable;
import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
import javax.faces.FacesException;
import javax.faces.context.FacesContext;
import javax.faces.event.PhaseListener;
import javax.faces.lifecycle.Lifecycle;
+import javax.portlet.PortletRequest;
+import org.ajax4jsf.portlet.application.PortletStateHolder;
+import org.ajax4jsf.portlet.application.PortletViewState;
+
/**
* @author asmirnov
*
@@ -80,6 +89,26 @@
*/
public void execute(FacesContext context) throws FacesException {
executePhase.execute(context);
+ // TODO - in the portlet mode, save state
+ Object request = context.getExternalContext().getRequest();
+ if(request instanceof PortletRequest){
+ context.getApplication().getStateManager().saveSerializedView(context);
+ }
+ // TODO - save request scope variables and Faces Messages.
+ PortletViewState windowState = PortletStateHolder.getInstance(context).getWindowState(context);
+ windowState.saveMessages(context);
+ HashMap requestScopeBeans = new HashMap();
+ for (Iterator iterator = context.getExternalContext().getRequestMap().entrySet().iterator(); iterator.hasNext();) {
+ Entry entry = (Entry) iterator.next();
+ String paramName = entry.getKey().toString();
+ Object bean = entry.getValue();
+ if(!paramName.contains(".") && bean instanceof Serializable){
+ requestScopeBeans.put(paramName, bean);
+ }
+ }
+ if(requestScopeBeans.size()>0){
+ windowState.setRequestScopeBeans(requestScopeBeans);
+ }
}
/**
@@ -88,6 +117,17 @@
* @see javax.faces.lifecycle.Lifecycle#render(javax.faces.context.FacesContext)
*/
public void render(FacesContext context) throws FacesException {
+ // TODO - in the portlet mode, restore state, request scope variables and Faces Messages.
+ Object request = context.getExternalContext().getRequest();
+ if(request instanceof PortletRequest){
+ executePhase.executePhase(context);
+ PortletViewState windowState = PortletStateHolder.getInstance(context).getWindowState(context);
+ windowState.restoreMessages(context);
+ Map requestScopeBeans = windowState.getRequestScopeBeans();
+ if(null != requestScopeBeans){
+ context.getExternalContext().getRequestMap().putAll(requestScopeBeans);
+ }
+ }
renderPhase.execute(context);
}
Modified: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/lifecycle/ProcessValidatorsPhase.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/lifecycle/ProcessValidatorsPhase.java 2007-10-11 19:00:36 UTC (rev 3335)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/lifecycle/ProcessValidatorsPhase.java 2007-10-12 01:04:40 UTC (rev 3336)
@@ -34,7 +34,7 @@
/* (non-Javadoc)
* @see org.ajax4jsf.portlet.lifecycle.LifecyclePhase#executePhase(javax.faces.context.FacesContext)
*/
- protected void executePhase(FacesContext context) {
+ public void executePhase(FacesContext context) {
context.getViewRoot().processValidators(context);
}
Modified: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/lifecycle/RenderResponsePhase.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/lifecycle/RenderResponsePhase.java 2007-10-11 19:00:36 UTC (rev 3335)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/lifecycle/RenderResponsePhase.java 2007-10-12 01:04:40 UTC (rev 3336)
@@ -34,7 +34,7 @@
/* (non-Javadoc)
* @see org.ajax4jsf.portlet.lifecycle.LifecyclePhase#executePhase(javax.faces.context.FacesContext)
*/
- protected void executePhase(FacesContext context) {
+ public void executePhase(FacesContext context) {
try {
context.getApplication().getViewHandler().
renderView(context, context.getViewRoot());
Modified: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/lifecycle/RestoreViewPhase.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/lifecycle/RestoreViewPhase.java 2007-10-11 19:00:36 UTC (rev 3335)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/lifecycle/RestoreViewPhase.java 2007-10-12 01:04:40 UTC (rev 3336)
@@ -7,6 +7,7 @@
import javax.el.ELContext;
import javax.el.ValueExpression;
+import javax.faces.FactoryFinder;
import javax.faces.application.ViewHandler;
import javax.faces.component.UICommand;
import javax.faces.component.UIComponent;
@@ -14,16 +15,20 @@
import javax.faces.context.FacesContext;
import javax.faces.event.PhaseId;
import javax.faces.lifecycle.Lifecycle;
+import javax.faces.render.RenderKit;
+import javax.faces.render.RenderKitFactory;
+import javax.servlet.ServletRequest;
+import org.ajax4jsf.portlet.application.PortletStateHolder;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* @author asmirnov
- *
+ *
*/
public class RestoreViewPhase extends LifecyclePhase {
-
+
private static final Log _log = LogFactory.getLog(RestoreViewPhase.class);
private final LifecyclePhase nextPhase;
@@ -36,33 +41,44 @@
nextPhase = new ApplyValuesPhase(lifecycle);
}
- /* (non-Javadoc)
- * @see org.ajax4jsf.portlet.lifecycle.LifecyclePhase#executeNextPhase(javax.faces.context.FacesContext, javax.faces.event.PhaseListener[])
+ public void execute(FacesContext context) {
+ context.getApplication().getViewHandler().initView(context);
+ super.execute(context);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.portlet.lifecycle.LifecyclePhase#executeNextPhase(javax.faces.context.FacesContext,
+ * javax.faces.event.PhaseListener[])
*/
protected void executeNextPhase(FacesContext context) {
nextPhase.execute(context);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.ajax4jsf.portlet.lifecycle.LifecyclePhase#executePhase(javax.faces.context.FacesContext)
*/
- protected void executePhase(FacesContext context) {
+ public void executePhase(FacesContext context) {
// Check pre-created ViewRoot.
UIViewRoot viewRoot = context.getViewRoot();
ELContext elContext = context.getELContext();
- if(null != viewRoot){
- if(_log.isDebugEnabled()){
+ if (null != viewRoot) {
+ if (_log.isDebugEnabled()) {
_log.debug("Found created UIViewRoot in facesContext");
}
viewRoot.setLocale(context.getExternalContext().getRequestLocale());
- processBindings(elContext,viewRoot);
+ processBindings(elContext, viewRoot);
} else {
// Restore or Create new view.
String viewId = calculateViewId(context);
ViewHandler viewHandler = context.getApplication().getViewHandler();
- if(isFacesRequest(context)){
+ if (isFacesRequest(context)) {
+ // TODO - check for a null and throw exception.
viewRoot = viewHandler.restoreView(context, viewId);
- if(null != viewRoot){
+ if (null != viewRoot) {
processBindings(elContext, viewRoot);
}
} else {
@@ -73,30 +89,49 @@
}
private boolean isFacesRequest(FacesContext context) {
- // TODO Auto-generated method stub
- return false;
+ // Check request for a "postback"
+ String renderKitId = context.getApplication().getViewHandler()
+ .calculateRenderKitId(context);
+ return getRenderKit(context, renderKitId).getResponseStateManager()
+ .isPostback(context);
}
+ private RenderKit getRenderKit(FacesContext context, String renderKitId) {
+ // TODO - cache renderKitFactory instance.
+ RenderKitFactory renderKitFactory = (RenderKitFactory) FactoryFinder
+ .getFactory(FactoryFinder.RENDER_KIT_FACTORY);
+ return renderKitFactory.getRenderKit(context, renderKitId);
+ }
+
private String calculateViewId(FacesContext context) {
- String viewId = context.getExternalContext().getRequestPathInfo();
- if(null == viewId){
- viewId = context.getExternalContext().getRequestServletPath();
+ String viewId;
+ if (context.getExternalContext().getRequest() instanceof ServletRequest) {
+ viewId = context.getExternalContext().getRequestPathInfo();
+ if (null == viewId) {
+ viewId = context.getExternalContext().getRequestServletPath();
+ }
+
+ } else {
+ viewId = PortletStateHolder.getInstance(context).getViewId(context);
}
return viewId;
}
private void processBindings(ELContext elContext, UIComponent component) {
ValueExpression binding = component.getValueExpression("binding");
- if(null != binding){
+ if (null != binding) {
binding.setValue(elContext, component);
}
- for (Iterator iterator = component.getFacetsAndChildren(); iterator.hasNext();) {
+ for (Iterator iterator = component.getFacetsAndChildren(); iterator
+ .hasNext();) {
UIComponent child = (UIComponent) iterator.next();
processBindings(elContext, child);
}
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.ajax4jsf.portlet.lifecycle.LifecyclePhase#getPhaseId()
*/
protected PhaseId getPhaseId() {
Modified: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/lifecycle/UpdateModelPhase.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/lifecycle/UpdateModelPhase.java 2007-10-11 19:00:36 UTC (rev 3335)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/lifecycle/UpdateModelPhase.java 2007-10-12 01:04:40 UTC (rev 3336)
@@ -33,9 +33,8 @@
/* (non-Javadoc)
* @see org.ajax4jsf.portlet.lifecycle.LifecyclePhase#executePhase(javax.faces.context.FacesContext)
*/
- protected void executePhase(FacesContext context) {
- // TODO Auto-generated method stub
-
+ public void executePhase(FacesContext context) {
+ context.getViewRoot().processUpdates(context);
}
/* (non-Javadoc)
Modified: trunk/extensions/portlet/src/test/java/org/ajax4jsf/portlet/application/PortletViewStateTestCase.java
===================================================================
--- trunk/extensions/portlet/src/test/java/org/ajax4jsf/portlet/application/PortletViewStateTestCase.java 2007-10-11 19:00:36 UTC (rev 3335)
+++ trunk/extensions/portlet/src/test/java/org/ajax4jsf/portlet/application/PortletViewStateTestCase.java 2007-10-12 01:04:40 UTC (rev 3336)
@@ -4,16 +4,12 @@
import java.util.Map;
import javax.faces.application.FacesMessage;
-import javax.faces.application.FacesMessage.Severity;
import javax.faces.component.UIInput;
import javax.faces.component.UIOutput;
import javax.faces.component.UIViewRoot;
import org.ajax4jsf.portlet.AbstractAjax4jsfPortletTestCase;
-import org.ajax4jsf.portlet.application.PortletViewState.TreeStrutureNode;
-import junit.framework.TestCase;
-
public class PortletViewStateTestCase extends AbstractAjax4jsfPortletTestCase {
ComponentsLoaderImpl loader;
@@ -32,15 +28,6 @@
super.tearDown();
}
- public final void testSave() {
- setupActionRequest();
- setupTree();
- PortletViewState state = new PortletViewState();
- state.save(facesContext);
- assertNotNull(state.getComponentsState());
- Object treeStructure = state.getTreeStructure();
- assertTrue(treeStructure instanceof TreeStrutureNode);
- }
/**
*
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/application/AjaxStateManager.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/application/AjaxStateManager.java 2007-10-11 19:00:36 UTC (rev 3335)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/application/AjaxStateManager.java 2007-10-12 01:04:40 UTC (rev 3336)
@@ -225,24 +225,25 @@
ResponseStateManager responseStateManager = getRenderKit(context,
renderKitId).getResponseStateManager();
TreeStrutureNode treeStructure = null;
- Object state = null;
+ Object[] state = null;
if (isSavingStateInClient(context)) {
treeStructure = (TreeStrutureNode) responseStateManager
.getTreeStructureToRestore(context, viewId);
// viewRoot = parent.restoreView(context, viewId, renderKitId);
- state = responseStateManager.getComponentStateToRestore(context);
+ state = (Object[]) responseStateManager.getComponentStateToRestore(context);
} else {
Object[] serializedView = restoreStateFromSession(context, viewId,
renderKitId);
if (null != serializedView) {
treeStructure = (TreeStrutureNode) serializedView[0];
- state = serializedView[1];
+ state = (Object[]) serializedView[1];
}
}
if (null != treeStructure) {
viewRoot = (UIViewRoot) treeStructure.restore(componentLoader);
if (null != viewRoot && null != state) {
- viewRoot.processRestoreState(context, state);
+ viewRoot.processRestoreState(context, state[0]);
+ restoreAdditionalState(context, state[1]);
}
}
return viewRoot;
@@ -324,41 +325,66 @@
SerializedView serializedView = null;
UIViewRoot viewRoot = context.getViewRoot();
if (!viewRoot.isTransient()) {
- TreeStrutureNode treeState = new TreeStrutureNode();
- treeState.apply(context, viewRoot, new HashSet());
- Object state = viewRoot.processSaveState(context);
+ TreeStrutureNode treeStructure = new TreeStrutureNode();
+ treeStructure.apply(context, viewRoot, new HashSet());
+ Object treeState = viewRoot.processSaveState(context);
+ Object state[]={treeState,getAdditionalState(context)};
if (isSavingStateInClient(context)) {
- serializedView = new SerializedView(treeState, state);
+ serializedView = new SerializedView(treeStructure, state);
} else {
- ExternalContext externalContext = context.getExternalContext();
- Object session = externalContext.getSession(true);
- synchronized (session) {
- LRUMap viewStates = (LRUMap) externalContext
- .getSessionMap().get(VIEW_STATES_MAP);
- if (null == viewStates) {
- viewStates = new LRUMap(
- getNumberOfViews(externalContext));
- externalContext.getSessionMap().put(VIEW_STATES_MAP,
- viewStates);
- }
- Object id = getNextViewId(context);
- LRUMap logicalViewsMap = (LRUMap) viewStates.get(viewRoot
- .getViewId());
- if (null == logicalViewsMap) {
- logicalViewsMap = new LRUMap(
- getNumberOfViews(externalContext));
- }
- // Renew last seen view.
- viewStates.put(viewRoot.getViewId(), logicalViewsMap);
- logicalViewsMap.put(id, new Object[] { treeState, state });
- serializedView = new SerializedView(id, null);
- }
+ serializedView = saveStateInSession(context, treeStructure,
+ state);
}
}
return serializedView;
}
+ /**
+ * @param context
+ * @param treeStructure
+ * @param state
+ * @return
+ */
+ protected SerializedView saveStateInSession(FacesContext context,
+ Object treeStructure, Object state) {
+ SerializedView serializedView;
+ UIViewRoot viewRoot = context.getViewRoot();
+ ExternalContext externalContext = context.getExternalContext();
+ Object session = externalContext.getSession(true);
+ synchronized (session) {
+ LRUMap viewStates = (LRUMap) externalContext
+ .getSessionMap().get(VIEW_STATES_MAP);
+ if (null == viewStates) {
+ viewStates = new LRUMap(
+ getNumberOfViews(externalContext));
+ externalContext.getSessionMap().put(VIEW_STATES_MAP,
+ viewStates);
+ }
+ Object id = getNextViewId(context);
+ LRUMap logicalViewsMap = (LRUMap) viewStates.get(viewRoot
+ .getViewId());
+ if (null == logicalViewsMap) {
+ logicalViewsMap = new LRUMap(
+ getNumberOfViews(externalContext));
+ }
+ // Renew last seen view.
+ viewStates.put(viewRoot.getViewId(), logicalViewsMap);
+ logicalViewsMap.put(id, new Object[] { treeStructure, state });
+ serializedView = new SerializedView(id, null);
+ }
+ return serializedView;
+ }
+
+
+ protected Object getAdditionalState(FacesContext context){
+ return null;
+ }
+
+ protected void restoreAdditionalState(FacesContext context,Object state){
+
+ }
+
protected Object getNextViewId(FacesContext context) {
AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
if (ajaxContext.isAjaxRequest(context)) {
Modified: trunk/samples/ajaxPortlet/src/main/java/portal/Bean.java
===================================================================
--- trunk/samples/ajaxPortlet/src/main/java/portal/Bean.java 2007-10-11 19:00:36 UTC (rev 3335)
+++ trunk/samples/ajaxPortlet/src/main/java/portal/Bean.java 2007-10-12 01:04:40 UTC (rev 3336)
@@ -14,6 +14,10 @@
private String text ="";
+ public Bean() {
+ text="start";
+ counter=1;
+ }
/**
* @return the counter
*/
Modified: trunk/samples/ajaxPortlet/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/samples/ajaxPortlet/src/main/webapp/WEB-INF/faces-config.xml 2007-10-11 19:00:36 UTC (rev 3335)
+++ trunk/samples/ajaxPortlet/src/main/webapp/WEB-INF/faces-config.xml 2007-10-12 01:04:40 UTC (rev 3336)
@@ -21,16 +21,6 @@
<to-view-id>/jsf/start.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
- <render-kit>
- <renderer>
- <description>override the viewroot</description>
- <component-family>javax.faces.ViewRoot</component-family>
- <renderer-type>javax.faces.ViewRoot</renderer-type>
- <renderer-class>
- org.ajax4jsf.portlet.renderkit.portlet.PortletAjaxViewRootRenderer
- </renderer-class>
- </renderer>
- </render-kit>
<application>
<view-handler>
org.ajax4jsf.portlet.application.PortletViewHandler
@@ -46,6 +36,9 @@
<faces-context-factory>
org.ajax4jsf.portlet.context.FacesContextFactoryImpl
</faces-context-factory>
+ <lifecycle-factory>
+ org.ajax4jsf.portlet.lifecycle.PortletLifecycleFactory
+ </lifecycle-factory>
</factory>
<managed-bean>
17 years, 2 months
JBoss Rich Faces SVN: r3335 - branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2007-10-11 15:00:36 -0400 (Thu, 11 Oct 2007)
New Revision: 3335
Modified:
branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/GridBody.js
Log:
RF-1077
Modified: branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/GridBody.js
===================================================================
--- branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/GridBody.js 2007-10-11 18:41:20 UTC (rev 3334)
+++ branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/GridBody.js 2007-10-11 19:00:36 UTC (rev 3335)
@@ -160,6 +160,7 @@
this.fTable = $(gridId + ":f")
this.nTable = $(gridId + ":n")
this.controlCreated = true;
+ this.sizeBox.setHeight(this.templNormal.getElement().offsetHeight);
},
parseTemplate: function(templFrozen, templNormal) {
if(!templNormal || !templNormal.rows || templNormal.rows.length===0) {
@@ -241,7 +242,6 @@
this.contentBox.moveTo(frozenContentWidth, 0);
this.sizeBox.moveTo(0, 0);
this.sizeBox.setWidth(totalWidth);
- this.sizeBox.setHeight(this.templNormal.getElement().offsetHeight);
this.scrollBox.setWidth(this.getWidth()+1);
this.scrollBox.setHeight(this.getHeight()+1);
17 years, 2 months
JBoss Rich Faces SVN: r3334 - trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2007-10-11 14:41:20 -0400 (Thu, 11 Oct 2007)
New Revision: 3334
Modified:
trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/GridBody.js
Log:
RF-1077
Modified: trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/GridBody.js
===================================================================
--- trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/GridBody.js 2007-10-11 16:30:26 UTC (rev 3333)
+++ trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/GridBody.js 2007-10-11 18:41:20 UTC (rev 3334)
@@ -160,6 +160,7 @@
this.fTable = $(gridId + ":f")
this.nTable = $(gridId + ":n")
this.controlCreated = true;
+ this.sizeBox.setHeight(this.templNormal.getElement().offsetHeight);
},
parseTemplate: function(templFrozen, templNormal) {
if(!templNormal || !templNormal.rows || templNormal.rows.length===0) {
@@ -241,7 +242,6 @@
this.contentBox.moveTo(frozenContentWidth, 0);
this.sizeBox.moveTo(0, 0);
this.sizeBox.setWidth(totalWidth);
- this.sizeBox.setHeight(this.templNormal.getElement().offsetHeight);
this.scrollBox.setWidth(this.getWidth()+1);
this.scrollBox.setHeight(this.getHeight()+1);
17 years, 2 months
JBoss Rich Faces SVN: r3333 - in trunk: ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2007-10-11 12:30:26 -0400 (Thu, 11 Oct 2007)
New Revision: 3333
Modified:
trunk/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp
trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
Log:
RF-1013, RF-1094
Modified: trunk/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp
===================================================================
--- trunk/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp 2007-10-11 16:25:18 UTC (rev 3332)
+++ trunk/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp 2007-10-11 16:30:26 UTC (rev 3333)
@@ -20,6 +20,9 @@
.Selecteddayclass {
background-color: #0087FF;
}
+ .even-day {
+ background-color: #44aa00;
+ }
</style>
</head>
<body>
Modified: trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
===================================================================
--- trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-10-11 16:25:18 UTC (rev 3332)
+++ trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-10-11 16:30:26 UTC (rev 3333)
@@ -421,7 +421,10 @@
// "scroll" - change current month
// "select" - change current month and select date
+ // isDayEnabled - end-developer JS function
+ // dayStyleClass - end-developer JS function that provide style class for day's cells.
+
this.id = id;
this.params = parameters;
if (!this.params.showWeekDaysBar) this.params.showWeekDaysBar = true;
@@ -443,6 +446,10 @@
this.selectedDate = this.params.selectedDate;
if (typeof this.params.boundaryDatesMode=="string") this.params.boundaryDatesMode = this.params.boundaryDatesMode.toLowerCase();
+
+ //
+ if (typeof this.params.isDayEnabled != "function") this.params.isDayEnabled = function (context) {return true;};
+ if (typeof this.params.dayStyleClass != "function") this.params.dayStyleClass = function (context) {return "";};
this.todayDate = new Date();
@@ -806,7 +813,7 @@
if (obj)
{
var daydata = this.days[parseInt(obj.id.substr(this.DATE_ELEMENT_ID.length),10)];
- if (daydata._month==0)
+ if (daydata.enabled && daydata._month==0)
{
var date=new Date(this.currentDate);
date.setDate(daydata.day);
@@ -837,7 +844,7 @@
{
var daydata = this.days[parseInt(obj.id.substr(this.DATE_ELEMENT_ID.length),10)];
//var date = new Date(this.currentDate.getFullYear(), this.currentDate.getMonth()+daydata._month, daydata.day);
- if (this.invokeEvent("datemouseover", obj, e, daydata.date))
+ if (this.invokeEvent("datemouseover", obj, e, daydata.date) && daydata.enabled)
{
if (daydata._month==0) Element.addClassName(obj,'rich-calendar-hover');
}
@@ -850,7 +857,7 @@
{
var daydata = this.days[parseInt(obj.id.substr(this.DATE_ELEMENT_ID.length),10)];
//var date = new Date(this.currentDate.getFullYear(), this.currentDate.getMonth()+daydata._month, daydata.day);
- if (this.invokeEvent("datemouseout", obj, e, daydata.date))
+ if (this.invokeEvent("datemouseout", obj, e, daydata.date) && daydata.enabled)
{
if (daydata._month==0) Element.removeClassName(obj,'rich-calendar-hover');
}
@@ -859,16 +866,15 @@
load:function(daysData, isAjaxMode) {
// startDate,
- // days:array[]
+ // daysData:array[]
// {
- // data
- // enabled boolean or function
- // isEnabled function
+ // day
+ // enabled boolean
// text1: 'Meeting...',
// text2: 'Meeting...'
// tooltip
// hasTooltip
- // dayStyleClass
+ // styleClass
// }
if (!$(this.id).component) return;
@@ -1039,7 +1045,7 @@
element = element.nextSibling;
}
- var weekdaycounter = this.params.firstWeekDay;
+ var weekdaycounter = this.params.firstWeekDay;
while (element)
{
@@ -1053,16 +1059,48 @@
dataobj.component = this;
dataobj.isCurrentMonth = (dataobj._month==0);
dataobj.weekDayNumber = weekdaycounter;
+
+ // call user function to get day state
+ if (dataobj.enabled != false) dataobj.enabled = this.params.isDayEnabled(dataobj);
+ // call user function to custom class style
+ if (!dataobj.styleClass) dataobj.customStyleClass = this.params.dayStyleClass(dataobj);
+ else
+ {
+ var styleclass = this.params.dayStyleClass(dataobj);
+ dataobj.customStyleClass = dataobj.styleClass
+ if (styleclass) dataobj.customStyleClass += " " + styleclass;
+ }
+
+ element.innerHTML = this.evaluateMarkup(this.params.dayListMarkup, dataobj );
if (weekdaycounter==6) weekdaycounter=0; else weekdaycounter++;
- element.innerHTML = this.evaluateMarkup(this.params.dayListMarkup, dataobj );
// class styles
e = Element.classNames(element);
- if (dataobj._month!=0) { e.add('rich-calendar-boundary-dates'); if (boundaryDatesModeFlag) e.add('rich-calendar-btn'); else e.remove('rich-calendar-btn');}
+ // remove custom style class
+ if (element.rich && element.rich.customStyleClass)
+ {
+ element.rich.customStyleClass.split(' ').each(function(name){e.remove(name);});
+ element.rich.customStyleClass = null;
+ }
+
+ if (dataobj._month!=0)
+ {
+ e.add('rich-calendar-boundary-dates');
+ if (boundaryDatesModeFlag)
+ e.add('rich-calendar-btn');
+ else
+ e.remove('rich-calendar-btn');}
else
{
e.remove('rich-calendar-boundary-dates');
- e.add('rich-calendar-btn');
+ if (dataobj.enabled) e.add('rich-calendar-btn'); else e.remove('rich-calendar-btn');
+
+ // add custom style class
+ if (dataobj.customStyleClass)
+ {
+ e.add(dataobj.customStyleClass);
+ element.rich = {customStyleClass: dataobj.customStyleClass};
+ }
}
// TODO make some optimization with rich-calendar-today class
17 years, 2 months
JBoss Rich Faces SVN: r3332 - in trunk/test-applications/facelets/src/main/webapp: TogglePanel and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ayanul
Date: 2007-10-11 12:25:18 -0400 (Thu, 11 Oct 2007)
New Revision: 3332
Modified:
trunk/test-applications/facelets/src/main/webapp/SuggestionBox/SuggestionBox.xhtml
trunk/test-applications/facelets/src/main/webapp/TogglePanel/TogglePanel.xhtml
trunk/test-applications/facelets/src/main/webapp/Tooltip/Tooltip.xhtml
Log:
cosmetic fix
Modified: trunk/test-applications/facelets/src/main/webapp/SuggestionBox/SuggestionBox.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/SuggestionBox/SuggestionBox.xhtml 2007-10-11 14:48:04 UTC (rev 3331)
+++ trunk/test-applications/facelets/src/main/webapp/SuggestionBox/SuggestionBox.xhtml 2007-10-11 16:25:18 UTC (rev 3332)
@@ -8,7 +8,7 @@
</f:verbatim>
<h:inputText id="text" />
<rich:suggestionbox id="suggestionBoxId" for="text"
- zindex="#{sb.zindex}" rules="#{sb.rules}"
+ zindex="#{sb.zindex}" rules="#{sb.rules}" styleClass="styleClass"
suggestionAction="#{sb.autocomplete}" var="result"
width="#{sb.width}" height="#{sb.height}" border="#{sb.border}"
cellpadding="#{sb.cellpadding}" cellspacing="#{sb.cellspacing}"
Modified: trunk/test-applications/facelets/src/main/webapp/TogglePanel/TogglePanel.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/TogglePanel/TogglePanel.xhtml 2007-10-11 14:48:04 UTC (rev 3331)
+++ trunk/test-applications/facelets/src/main/webapp/TogglePanel/TogglePanel.xhtml 2007-10-11 16:25:18 UTC (rev 3332)
@@ -55,9 +55,12 @@
</rich:panel>
</f:facet>
</rich:togglePanel>
- <br />
- <br />
-
+
+ <f:verbatim>
+ <br />
+ <br />
+ </f:verbatim>
+
<rich:togglePanel id="panel2" switchType="#{togglePanel.switchType}"
initialState="#{togglePanel.initialState}"
stateOrder="#{togglePanel.stateOrder}">
@@ -195,7 +198,6 @@
<a4j:support event="onclick" reRender="panel1,panel2"></a4j:support>
</h:selectOneRadio>
</h:panelGrid>
- <h:commandLink value="Back" action="main"></h:commandLink>
<ui:debug hotkey="L"></ui:debug>
</h:form>
Modified: trunk/test-applications/facelets/src/main/webapp/Tooltip/Tooltip.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/Tooltip/Tooltip.xhtml 2007-10-11 14:48:04 UTC (rev 3331)
+++ trunk/test-applications/facelets/src/main/webapp/Tooltip/Tooltip.xhtml 2007-10-11 16:25:18 UTC (rev 3332)
@@ -132,11 +132,6 @@
<a4j:support event="onclick" reRender="tooltipID" />
</h:selectBooleanCheckbox>
</h:panelGrid>
- <!-- h:inputText value="ddd"
- onclick="toolTipAttach();alert(document.getElementById('lkjl'))" /-->
- <f:verbatim>
- <br />
- </f:verbatim>
</h:form>
17 years, 2 months
JBoss Rich Faces SVN: r3330 - trunk/test-applications/facelets/src/main/webapp/Calendar.
by richfaces-svn-commits@lists.jboss.org
Author: ayanul
Date: 2007-10-11 10:46:43 -0400 (Thu, 11 Oct 2007)
New Revision: 3330
Modified:
trunk/test-applications/facelets/src/main/webapp/Calendar/Calendar.xhtml
Log:
Modified: trunk/test-applications/facelets/src/main/webapp/Calendar/Calendar.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/Calendar/Calendar.xhtml 2007-10-11 14:35:58 UTC (rev 3329)
+++ trunk/test-applications/facelets/src/main/webapp/Calendar/Calendar.xhtml 2007-10-11 14:46:43 UTC (rev 3330)
@@ -3,76 +3,134 @@
xmlns:rich="http://richfaces.org/rich"
xmlns:h="http://java.sun.com/jsf/html">
-
<rich:messages showDetail="true"></rich:messages>
+
+ <h:panelGrid columns="2">
+ <h:outputText value="Client mode" />
+ <h:outputText value="Ajax mode" />
- <f:verbatim>
- <br />
- </f:verbatim>
-
- <rich:calendar id="calendarID" dataModel="#{calendarDataModel}"
- locale="#{calendarBean.locale}" popup="#{calendarBean.popup}"
- datePattern="#{calendarBean.pattern}"
- weekDayLabels="#{calendarBean.weekDayLabels}"
- weekDayLabelsShort="#{calendarBean.weekDayLabelsShort}"
- monthLabels="#{calendarBean.monthLabels}"
- monthLabelsShort="#{calendarBean.monthLabelsShort}"
- value="#{calendarBean.selectedDate}"
- currentDate="#{calendarBean.currentDate}"
- jointPoint="#{calendarBean.jointPoint}"
- direction="#{calendarBean.direction}"
- enableManualInput="#{calendarBean.enableManualInput}"
- showInput="#{calendarBean.showInput}" buttonLabel="#{calendarBean.label}"
- boundaryDatesMode="#{calendarBean.boundary}"
- currentDateChangeListener="#{calendarBean.dcl}"
- valueChangeListener="#{calendarBean.ddd}" reRender="counter"
- inputClass="ic" buttonClass="bc"
- ajaxSingle="#{calendarBean.ajaxSingle}"
- buttonIcon="#{calendarBean.icon}"
- buttonIconDisabled="#{icon.iconFileManagerReject}"
- disabled="#{calendarBean.disabled}"
- bypassUpdates="#{calendarBean.bypassUpdates}"
- height="#{calendarBean.height}"
- width="#{calendarBean.width}"
- zindex="#{calendarBean.zindex}"
- toolTipMode="#{calendarBean.toolTipMode}"
- rendered="#{calendarBean.rendered}"
- focus="popupModeID"
- mode="#{calendarBean.mode}"
- required="#{calendarBean.required}"
- requiredMessage="Required Message"
- >
+ <rich:calendar id="calendarClientID" dataModel="#{calendarDataModel}"
+ locale="#{calendarBean.locale}" popup="#{calendarBean.popup}"
+ preloadDateRangeBegin="#{calendarBean.prDateRangeBegin}"
+ preloadDateRangeEnd="#{calendarBean.prDateRangeEnd}"
+ datePattern="#{calendarBean.pattern}"
+ weekDayLabels="#{calendarBean.weekDayLabels}"
+ weekDayLabelsShort="#{calendarBean.weekDayLabelsShort}"
+ monthLabels="#{calendarBean.monthLabels}"
+ monthLabelsShort="#{calendarBean.monthLabelsShort}"
+ value="#{calendarBean.selectedDate}"
+ currentDate="#{calendarBean.currentDate}"
+ jointPoint="#{calendarBean.jointPoint}"
+ direction="#{calendarBean.direction}"
+ enableManualInput="#{calendarBean.enableManualInput}"
+ showInput="#{calendarBean.showInput}" buttonLabel="#{calendarBean.label}"
+ boundaryDatesMode="#{calendarBean.boundary}"
+ currentDateChangeListener="#{calendarBean.dcl}"
+ valueChangeListener="#{calendarBean.ddd}" reRender="counter"
+ inputClass="ic" buttonClass="bc"
+ ajaxSingle="#{calendarBean.ajaxSingle}"
+ buttonIcon="#{calendarBean.icon}"
+ buttonIconDisabled="#{icon.iconFileManagerReject}"
+ disabled="#{calendarBean.disabled}"
+ bypassUpdates="#{calendarBean.bypassUpdates}"
+ height="#{calendarBean.height}"
+ width="#{calendarBean.width}"
+ zindex="#{calendarBean.zindex}"
+ toolTipMode="#{calendarBean.toolTipMode}"
+ rendered="#{calendarBean.rendered}"
+ focus="popupModeID"
+ mode="client"
+ required="#{calendarBean.required}"
+ requiredMessage="Required Message"
+ >
+ <f:facet name="weekDay">
+ <f:verbatim><span style="padding: 2px; font-size: 4" >{weekDayLabel + weekDayLabelShort}</span></f:verbatim>
+ </f:facet>
+
+ <f:facet name="optionalHeader">
+ <h:outputText value="optionalHeader Facet" />
+ </f:facet>
+
+ <f:facet name="optionalFooter">
+ <h:outputText value="optionalFooter Facet" />
+ </f:facet>
+
+ <f:validator validatorId="org.richfaces.CalendarValidator" />
- <f:facet name="weekDay">
- <f:verbatim><span style="padding: 2px; font-size: 4" >{weekDayLabel + weekDayLabelShort}</span></f:verbatim>
- </f:facet>
-
- <f:facet name="optionalHeader">
- <h:outputText value="optionalHeader Facet" />
- </f:facet>
+ <h:panelGrid columns="2">
+ <f:verbatim>
+ <span style="padding: 2px;">{day}</span>
+ </f:verbatim>
+ <h:panelGrid>
+ <h:outputText styleClass="smallText" value="{data.enLabel}" />
+ <h:outputText styleClass="smallText" value="{data.frLabel}" />
+ <h:outputText styleClass="smallText" value="{data.deLabel}" />
+ </h:panelGrid>
+ </h:panelGrid>
+ </rich:calendar>
+ <rich:calendar id="calendarAjaxID" dataModel="#{calendarDataModel}"
+ locale="#{calendarBean.locale}" popup="#{calendarBean.popup}"
+ datePattern="#{calendarBean.pattern}"
+ weekDayLabels="#{calendarBean.weekDayLabels}"
+ weekDayLabelsShort="#{calendarBean.weekDayLabelsShort}"
+ monthLabels="#{calendarBean.monthLabels}"
+ monthLabelsShort="#{calendarBean.monthLabelsShort}"
+ value="#{calendarBean.selectedDate}"
+ currentDate="#{calendarBean.currentDate}"
+ jointPoint="#{calendarBean.jointPoint}"
+ direction="#{calendarBean.direction}"
+ enableManualInput="#{calendarBean.enableManualInput}"
+ showInput="#{calendarBean.showInput}" buttonLabel="#{calendarBean.label}"
+ boundaryDatesMode="#{calendarBean.boundary}"
+ currentDateChangeListener="#{calendarBean.dcl}"
+ valueChangeListener="#{calendarBean.ddd}" reRender="counter"
+ inputClass="ic" buttonClass="bc"
+ ajaxSingle="#{calendarBean.ajaxSingle}"
+ buttonIcon="#{calendarBean.icon}"
+ buttonIconDisabled="#{icon.iconFileManagerReject}"
+ disabled="#{calendarBean.disabled}"
+ bypassUpdates="#{calendarBean.bypassUpdates}"
+ height="#{calendarBean.height}"
+ width="#{calendarBean.width}"
+ zindex="#{calendarBean.zindex}"
+ toolTipMode="#{calendarBean.toolTipMode}"
+ rendered="#{calendarBean.rendered}"
+ focus="popupModeID"
+ mode="ajax"
+ required="#{calendarBean.required}"
+ requiredMessage="Required Message">
+ <f:facet name="weekDay">
+ <f:verbatim><span style="padding: 2px; font-size: 4" >{weekDayLabel + weekDayLabelShort}</span></f:verbatim>
+ </f:facet>
+
+ <f:facet name="optionalHeader">
+ <h:outputText value="optionalHeader Facet" />
+ </f:facet>
+
+ <f:facet name="optionalFooter">
+ <h:outputText value="optionalFooter Facet" />
+ </f:facet>
+
+ <f:validator validatorId="org.richfaces.CalendarValidator" />
- <f:facet name="optionalFooter">
- <h:outputText value="optionalFooter Facet" />
- </f:facet>
+ <h:panelGrid columns="2">
+ <f:verbatim>
+ <span style="padding: 2px;">{day}</span>
+ </f:verbatim>
+ <h:panelGrid>
+ <h:outputText styleClass="smallText" value="{data.enLabel}" />
+ <h:outputText styleClass="smallText" value="{data.frLabel}" />
+ <h:outputText styleClass="smallText" value="{data.deLabel}" />
+ </h:panelGrid>
+ </h:panelGrid>
+ </rich:calendar>
+ </h:panelGrid>
- <f:validator validatorId="org.richfaces.CalendarValidator" />
+
<h:panelGrid columns="2">
- <f:verbatim>
- <span style="padding: 2px;">{day}</span>
- </f:verbatim>
- <h:panelGrid>
- <h:outputText styleClass="smallText" value="{data.enLabel}" />
- <h:outputText styleClass="smallText" value="{data.frLabel}" />
- <h:outputText styleClass="smallText" value="{data.deLabel}" />
- </h:panelGrid>
- </h:panelGrid>
- </rich:calendar>
-
- <h:panelGrid columns="2">
<h:outputText value="Select Locale:" />
- <h:selectOneRadio onchange="submit()" value="en/US"
- valueChangeListener="#{calendarBean.selectLocale}">
+ <h:selectOneRadio onchange="submit()" value="en/US">
<f:selectItem itemLabel="US" itemValue="en/US" />
<f:selectItem itemLabel="DE" itemValue="de/DE" />
<f:selectItem itemLabel="FR" itemValue="fr/FR" />
@@ -88,7 +146,7 @@
<f:selectItem itemLabel="none" itemValue="none"/>
<f:selectItem itemLabel="day labels" itemValue="long"/>
<f:selectItem itemLabel="day labels short" itemValue="short"/>
- <a4j:support event="onclick" reRender="calendarID"></a4j:support>
+ <a4j:support event="onclick" reRender="calendarClientID,calendarAjaxID"></a4j:support>
</h:selectOneRadio>
<h:outputText value="Custom month labels" />
@@ -96,12 +154,11 @@
<f:selectItem itemLabel="none" itemValue="none"/>
<f:selectItem itemLabel="day labels" itemValue="long"/>
<f:selectItem itemLabel="day labels short" itemValue="short"/>
- <a4j:support event="onclick" reRender="calendarID"></a4j:support>
+ <a4j:support event="onclick" reRender="calendarClientID,calendarAjaxID"></a4j:support>
</h:selectOneRadio>
<h:outputText value="Select Date Pattern:" />
- <h:selectOneMenu value="MMM d, yyyy" onchange="submit()"
- valueChangeListener="#{calendarBean.selectPattern}">
+ <h:selectOneMenu value="MMM d, yyyy" onchange="submit()">
<f:selectItem itemLabel="d/M/yy" itemValue="d/M/yy" />
<f:selectItem itemLabel="dd/M/yy" itemValue="dd/M/yy" />
<f:selectItem itemLabel="d/MMM/y" itemValue="d/MMM/y" />
@@ -113,12 +170,6 @@
<h:commandButton type="button" value="Select Date"
onclick="$(this.form.id+':calendarID').component.selectDate(this.form[this.form.id+':selectdate'].value);" />
- <h:outputText value="Mode:" />
- <h:selectOneRadio value="#{calendarBean.mode}" onclick="submit();">
- <f:selectItem itemLabel="client" itemValue="client"/>
- <f:selectItem itemLabel="ajax" itemValue="ajax"/>
- </h:selectOneRadio>
-
<h:outputText value="Preload date range begin(d.m.y)" />
<h:inputText value="#{calendarBean.preloadDateRangeBegin}" onchange="submit();"/>
@@ -127,17 +178,17 @@
<h:outputText value="z-index:" />
<h:inputText value="#{calendarBean.zindex}">
- <a4j:support event="onchange" reRender="calendarID"></a4j:support>
+ <a4j:support event="onchange" reRender="calendarClientID,calendarAjaxID"></a4j:support>
</h:inputText>
<h:outputText value="Height:" />
<h:inputText value="#{calendarBean.height}">
- <a4j:support event="onchange" reRender="calendarID"></a4j:support>
+ <a4j:support event="onchange" reRender="calendarClientID,calendarAjaxID"></a4j:support>
</h:inputText>
<h:outputText value="Width:" />
<h:inputText value="#{calendarBean.width}">
- <a4j:support event="onchange" reRender="calendarID"></a4j:support>
+ <a4j:support event="onchange" reRender="calendarClientID,calendarAjaxID"></a4j:support>
</h:inputText>
<h:outputText value="reRender (counter):" />
@@ -148,8 +199,7 @@
<h:outputText value="Select Popup Joint Point:" />
<h:selectOneRadio onchange="submit()"
- value="#{calendarBean.jointPoint}"
- valueChangeListener="#{calendarBean.selectJointPoint}">
+ value="#{calendarBean.jointPoint}">
<f:selectItem itemLabel="bottom-right" itemValue="bottom-right" />
<f:selectItem itemLabel="bottom-left" itemValue="bottom-left" />
<f:selectItem itemLabel="top-right" itemValue="top-right" />
@@ -158,8 +208,7 @@
<h:outputText value="Select Popup Direction:" />
<h:selectOneRadio onchange="submit()"
- value="#{calendarBean.direction}"
- valueChangeListener="#{calendarBean.selectDirection}">
+ value="#{calendarBean.direction}">
<f:selectItem itemLabel="bottom-right" itemValue="bottom-right" />
<f:selectItem itemLabel="bottom-left" itemValue="bottom-left" />
<f:selectItem itemLabel="top-right" itemValue="top-right" />
@@ -217,9 +266,5 @@
<f:verbatim></f:verbatim>
<h:commandButton value="Submit" />
</h:panelGrid>
-
- <f:verbatim>
- <br />
- </f:verbatim>
</h:form>
17 years, 2 months
JBoss Rich Faces SVN: r3329 - trunk/test-applications/facelets/src/main/webapp/pages/Select.
by richfaces-svn-commits@lists.jboss.org
Author: ayanul
Date: 2007-10-11 10:35:58 -0400 (Thu, 11 Oct 2007)
New Revision: 3329
Modified:
trunk/test-applications/facelets/src/main/webapp/pages/Select/Map.xhtml
trunk/test-applications/facelets/src/main/webapp/pages/Select/SelectOneMenuPage.xhtml
Log:
Modified: trunk/test-applications/facelets/src/main/webapp/pages/Select/Map.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/pages/Select/Map.xhtml 2007-10-11 13:15:54 UTC (rev 3328)
+++ trunk/test-applications/facelets/src/main/webapp/pages/Select/Map.xhtml 2007-10-11 14:35:58 UTC (rev 3329)
@@ -17,13 +17,17 @@
<ui:include src="/pages/RichMenu/RichMenu.xhtml"/>
</div>
- <div id="divID" style="position: absolute; top:60px; left: 10px; z-index: 1">
+ <div id="divPageID" style="position: absolute; background-color:gray; top:60px; left: 10px; z-index: 2">
+ <ui:include src="${richBean.src}" />
+ </div>
+
+ <iframe src="banner.html" width="468" height="60" align="center">
+
+ </iframe>
+
+ <div id="divID" style="position: relative; top:60px; left: 10px; z-index: 1">
<ui:include src="/pages/Select/SelectOneMenuPage.xhtml" />
</div>
-
- <div id="divPageID" style="position: absolute; top:90px;">
- <ui:include src="${richBean.src}" />
- </div>
</body>
</f:view>
</html>
Modified: trunk/test-applications/facelets/src/main/webapp/pages/Select/SelectOneMenuPage.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/pages/Select/SelectOneMenuPage.xhtml 2007-10-11 13:15:54 UTC (rev 3328)
+++ trunk/test-applications/facelets/src/main/webapp/pages/Select/SelectOneMenuPage.xhtml 2007-10-11 14:35:58 UTC (rev 3329)
@@ -3,7 +3,11 @@
xmlns:h="http://java.sun.com/jsf/html"
xmlns:rich="http://richfaces.org/rich">
- <h:panelGrid columns="7" cellpadding="20px" cellspacing="30px">
+ <h:panelGrid columns="12" cellpadding="0" cellspacing="0" border="0">
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
<h:selectOneMenu value="selectItem" >
<f:selectItem itemLabel="selectItem" itemValue="test" />
</h:selectOneMenu>
@@ -171,5 +175,697 @@
<h:selectOneMenu value="selectItem" >
<f:selectItem itemLabel="selectItem" itemValue="test" />
</h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
+
+ <h:selectOneMenu value="selectItem" >
+ <f:selectItem itemLabel="selectItem" itemValue="test" />
+ </h:selectOneMenu>
</h:panelGrid>
</h:form>
17 years, 2 months
JBoss Rich Faces SVN: r3328 - trunk/samples/calendar-sample/src/main/java/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: akushunin
Date: 2007-10-11 09:15:54 -0400 (Thu, 11 Oct 2007)
New Revision: 3328
Modified:
trunk/samples/calendar-sample/src/main/java/org/richfaces/CalendarDataModelImpl.java
Log:
RF-1093
Modified: trunk/samples/calendar-sample/src/main/java/org/richfaces/CalendarDataModelImpl.java
===================================================================
--- trunk/samples/calendar-sample/src/main/java/org/richfaces/CalendarDataModelImpl.java 2007-10-11 13:15:05 UTC (rev 3327)
+++ trunk/samples/calendar-sample/src/main/java/org/richfaces/CalendarDataModelImpl.java 2007-10-11 13:15:54 UTC (rev 3328)
@@ -69,9 +69,11 @@
item.setDay(c.get(Calendar.DAY_OF_MONTH));*/
if (new Random().nextInt(10) > 5) {
- item.setEnabled(true);
+ item.setEnabled(true);
+
} else {
item.setEnabled(false);
+ item.setStyleClass("rich-calendar-boundary-dates");
}
item.setData(data);
17 years, 2 months
JBoss Rich Faces SVN: r3327 - in trunk/ui/calendar/src/main: java/org/richfaces/component and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: akushunin
Date: 2007-10-11 09:15:05 -0400 (Thu, 11 Oct 2007)
New Revision: 3327
Modified:
trunk/ui/calendar/src/main/config/component/calendar.xml
trunk/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
Log:
RF-1093
Modified: trunk/ui/calendar/src/main/config/component/calendar.xml
===================================================================
--- trunk/ui/calendar/src/main/config/component/calendar.xml 2007-10-11 12:35:21 UTC (rev 3326)
+++ trunk/ui/calendar/src/main/config/component/calendar.xml 2007-10-11 13:15:05 UTC (rev 3327)
@@ -472,6 +472,39 @@
</description>
<defaultvalue>0</defaultvalue>
</property>
+
+ <property>
+ <name>cellWidth</name>
+ <classname>int</classname>
+ <description>
+ attribute to set fixed cells width
+ </description>
+ </property>
+
+ <property>
+ <name>cellHeight</name>
+ <classname>int</classname>
+ <description>
+ attribute to set fixed cells height
+ </description>
+ </property>
+
+ <property>
+ <name>dayStyleClass</name>
+ <classname>java.lang.String</classname>
+ <description>
+ Should be binded to some JS function that will provide style classes
+ for special sets of days highlighting.
+ </description>
+ </property>
+
+ <property>
+ <name>isDayEnabled</name>
+ <classname>java.lang.String</classname>
+ <description>
+ Should be binded to some JS function that returns day state.
+ </description>
+ </property>
</component>
&listeners;
Modified: trunk/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java
===================================================================
--- trunk/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java 2007-10-11 12:35:21 UTC (rev 3326)
+++ trunk/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java 2007-10-11 13:15:05 UTC (rev 3327)
@@ -158,12 +158,27 @@
public abstract int getVerticalOffset();
public abstract void setVerticalOffset(int verticalOffset);
-
+
public abstract int getHorizontalOffset();
public abstract void setHorizontalOffset(int horizontalOffset);
+ public abstract String getDayStyleClass();
+ public abstract void setDayStyleClass(String DayStyleClass);
+
+ public abstract String getIsDayEnabled();
+
+ public abstract void setIsDayEnabled(String isDayEnabled);
+
+ public abstract int getCellHeight();
+
+ public abstract void setCellHeight(int cellHeight);
+
+ public abstract int getCellWidth();
+
+ public abstract void setCellWidth(int cellWidth);
+
// TODO onclick add users onclick
// currentDate processing -------------------------------------------------
Modified: trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
===================================================================
--- trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2007-10-11 12:35:21 UTC (rev 3326)
+++ trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2007-10-11 13:15:05 UTC (rev 3327)
@@ -149,12 +149,44 @@
throws IOException {
}
-
+
+ public void writeDayStyleClass(FacesContext context, UIComponent component) throws IOException{
+
+ UICalendar calendar = (UICalendar) component;
+ String dayStyleClass = (String) calendar.getAttributes().get("dayStyleClass");
+ if(dayStyleClass!=null && dayStyleClass.length()!=0){
+ ResponseWriter writer = context.getResponseWriter();
+ writer.writeText("dayStyleClass: "+dayStyleClass+", ", null);
+ //getUtils().writeAttribute(writer, "dayStyleClass",dayStyleClass+',');
+ }
+
+ }
+ public void writeIsDayEnabled(FacesContext context, UIComponent component)throws IOException{
+ UICalendar calendar = (UICalendar) component;
+ String isDayEnabled = (String) calendar.getAttributes().get("isDayEnabled");
+ if(isDayEnabled!=null && isDayEnabled.length()!=0){
+ ResponseWriter writer = context.getResponseWriter();
+ writer.writeText("isDayEnabled: "+isDayEnabled+", ", null);
+ }
+ }
+
public void writeMarkupScriptBody(FacesContext context,
UIComponent component, boolean children) throws IOException {
writeScriptBody(context, component, children);
}
-
+
+ public void writeOptionalFacetMarkupScriptBody(FacesContext context,
+ UIComponent component, String facetName) throws IOException{
+
+ UIComponent facet = component.getFacet(facetName);
+ if (facet != null && facet.isRendered()) {
+ ResponseWriter writer = context.getResponseWriter();
+ writer.writeText(", " + facetName + MARKUP_SUFFIX + ": "+"[new E('b',{},", null);
+ writeMarkupScriptBody(context, facet, false);
+ writer.writeText(")]",null);
+ }
+ }
+
public void writeFacetMarkupScriptBody(FacesContext context,
UIComponent component, String facetName) throws IOException {
Modified: trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
===================================================================
--- trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-10-11 12:35:21 UTC (rev 3326)
+++ trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-10-11 13:15:05 UTC (rev 3327)
@@ -17,8 +17,7 @@
style="z-index: #{component.attributes['zindex']}; #{component.attributes['style']}"
class="rich-calendar-popup #{component.attributes['styleClass']}"
x:passThruWithExclusions="value,name,type,id,styleClass,class,style">
- <script
- type="text/javascript">
+ <script type="text/javascript">
new Calendar('#{clientId}', {
<jsp:scriptlet>/*<![CDATA[*/
@@ -49,6 +48,10 @@
ajaxSingle: #{component.attributes['ajaxSingle']},
verticalOffset:'#{component.verticalOffset}',
horizontalOffset: '#{component.horizontalOffset}',
+ cellHeight:'#{component.cellHeight}',
+ cellWidth:'#{component.cellWidth}',
+ <f:call name="writeDayStyleClass"/>
+ <f:call name="writeIsDayEnabled"/>
<f:call name="writeSymbols" />,
firstWeekDay: #{this:getFirstWeekDay(context, component)},
minDaysInFirstWeek: #{this:getMinDaysInFirstWeek(context, component)}
@@ -61,7 +64,19 @@
<f:call name="writeEventHandlerFunction"><f:parameter value="oncollapse" /></f:call>
<f:call name="writeEventHandlerFunction"><f:parameter value="oncurrentdateselect" /></f:call>
- <jsp:scriptlet> /*<![CDATA[*/
+
+
+ <jsp:scriptlet>/*<![CDATA[*/
+ if (component.getChildCount() != 0) {
+ /*]]>*/</jsp:scriptlet>
+ ,dayListMarkup:
+ <jsp:scriptlet>/*<![CDATA[*/
+ writeMarkupScriptBody(context, component, true);
+ }
+ /*]]>*/</jsp:scriptlet>
+
+
+ <jsp:scriptlet> /*<![CDATA[*/
if (component.getFacet("optionalHeader")!= null&& component.getFacet("optionalHeader").isRendered()){
/*]]>*/ </jsp:scriptlet>
,headerOptionalMarkup: [new E('b',{},
@@ -84,20 +99,11 @@
<jsp:scriptlet> /*<![CDATA[*/
}
/*]]>*/ </jsp:scriptlet>
-
- <jsp:scriptlet>/*<![CDATA[*/
- if (component.getChildCount() != 0) {
- /*]]>*/</jsp:scriptlet>
- ,dayListMarkup:
- <jsp:scriptlet>/*<![CDATA[*/
- writeMarkupScriptBody(context, component, true);
- }
- /*]]>*/</jsp:scriptlet>
<f:call name="writeFacetMarkupScriptBody"><f:parameter value="weekDay" /></f:call>
<f:call name="writeFacetMarkupScriptBody"><f:parameter value="weekNumber" /></f:call>
<f:call name="writeFacetMarkupScriptBody"><f:parameter value="header" /></f:call>
- <f:call name="writeFacetMarkupScriptBody"><f:parameter value="footer" /></f:call>
+ <f:call name="writeFacetMarkupScriptBody"><f:parameter value="footer" /></f:call>
}).load(
<jsp:scriptlet>/*<![CDATA[*/
@@ -108,8 +114,7 @@
<f:call name="addPopupToAjaxRendered" />
- <span id="#{clientId}Popup">
- <jsp:scriptlet>
+ <span id="#{clientId}Popup"> <jsp:scriptlet>
<![CDATA[
boolean popup = getUtils().isBooleanAttribute(component, "popup");
if (!popup) {
@@ -136,13 +141,14 @@
variables.setVariable("disabled",new Boolean(disabled));
]]>
- </jsp:scriptlet>
- <f:resource name="org.richfaces.renderkit.html.iconimages.CalendarIcon" var="icon"/>
- <f:resource name="org.richfaces.renderkit.html.iconimages.DisabledCalendarIcon" var="disabledIcon"/>
- <input id="#{clientId}InputDate" name="#{clientId}InputDate"
+ </jsp:scriptlet> <f:resource
+ name="org.richfaces.renderkit.html.iconimages.CalendarIcon" var="icon" />
+ <f:resource
+ name="org.richfaces.renderkit.html.iconimages.DisabledCalendarIcon"
+ var="disabledIcon" /> <input id="#{clientId}InputDate"
+ name="#{clientId}InputDate"
value="#{this:getInputValue(context,component)}" type="#{type}"
- readonly="#{manualInput}"
- disabled="#{disabled}"
+ readonly="#{manualInput}" disabled="#{disabled}"
accesskey="#{component.attributes['accesskey']}"
maxlength="#{component.attributes['maxlength']}"
onchange="#{component.attributes['oninputchange']}"
@@ -156,8 +162,7 @@
size="#{component.attributes['inputSize']}"
style="vertical-align: middle; #{component.attributes['inputStyle']}"
class="rich-calendar-input #{component.attributes['inputClass']}"
- tabindex="#{component.attributes['tabindex']}"> </input>
- <jsp:scriptlet>
+ tabindex="#{component.attributes['tabindex']}"> </input> <jsp:scriptlet>
<![CDATA[
String buttonIcon = org.richfaces.component.util.ViewUtil.getResourceURL((String) component.getAttributes().get("buttonIcon"),context);
String buttonIconDisabled = org.richfaces.component.util.ViewUtil.getResourceURL((String) component.getAttributes().get("buttonIconDisabled"),context);
@@ -167,14 +172,12 @@
variables.setVariable("buttonIcon",buttonIcon);
if(buttonLabel==null || buttonLabel.length()==0){
]]>
- </jsp:scriptlet>
- <img id="#{clientId}PopupButton" class="rich-calendar-button #{component.attributes['buttonClass']}"
- accesskey="#{component.attributes['accesskey']}"
- name="#{clientId}"
+ </jsp:scriptlet> <img id="#{clientId}PopupButton"
+ class="rich-calendar-button #{component.attributes['buttonClass']}"
+ accesskey="#{component.attributes['accesskey']}" name="#{clientId}"
style="vertical-align: middle"
tabindex="#{component.attributes['tabindex']}">
-
- <jsp:scriptlet>
+ <jsp:scriptlet>
<![CDATA[
if(!disabled){
@@ -197,33 +200,23 @@
}
}
]]>
- </jsp:scriptlet>
-
- </img>
- <jsp:scriptlet>
+ </jsp:scriptlet> </img> <jsp:scriptlet>
<![CDATA[
}
else{
]]>
</jsp:scriptlet>
- <button
- type="button"
- id="#{clientId}PopupButton"
- name="#{clientId}"
+ <button type="button" id="#{clientId}PopupButton" name="#{clientId}"
onclick="$('#{clientId}').component.doSwitch();return true; #{component.attributes['oninputclick']}"
style="vertical-align: middle"
class="rich-calendar-button #{component.attributes['buttonClass']}"
- tabindex="#{component.attributes['tabindex']}"
- disabled="#{disabled}">
- #{buttonLabel}
- </button>
- <jsp:scriptlet>
+ tabindex="#{component.attributes['tabindex']}" disabled="#{disabled}">
+ #{buttonLabel}</button>
+ <jsp:scriptlet>
<![CDATA[
}
]]>
- </jsp:scriptlet>
-
- <jsp:scriptlet>
+ </jsp:scriptlet> <jsp:scriptlet>
<![CDATA[
}
]]>
17 years, 2 months