From adffaces-commits-return-1931-apmail-incubator-adffaces-commits-archive=incubator.apache.org@incubator.apache.org Fri Feb 02 01:04:38 2007 Return-Path: Delivered-To: apmail-incubator-adffaces-commits-archive@locus.apache.org Received: (qmail 9038 invoked from network); 2 Feb 2007 01:04:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Feb 2007 01:04:38 -0000 Received: (qmail 55707 invoked by uid 500); 2 Feb 2007 01:04:44 -0000 Delivered-To: apmail-incubator-adffaces-commits-archive@incubator.apache.org Received: (qmail 55686 invoked by uid 500); 2 Feb 2007 01:04:44 -0000 Mailing-List: contact adffaces-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: adffaces-dev@incubator.apache.org Delivered-To: mailing list adffaces-commits@incubator.apache.org Received: (qmail 55555 invoked by uid 99); 2 Feb 2007 01:04:44 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Feb 2007 17:04:44 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Feb 2007 17:04:32 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 0BD1A1A982B; Thu, 1 Feb 2007 17:02:03 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r502428 [6/44] - in /incubator/adffaces/branches/faces-1_2-070201: ./ plugins/ plugins/maven-faces-plugin/ plugins/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/ plugins/maven-faces-plugin/src/main/java/org/... Date: Fri, 02 Feb 2007 01:01:25 -0000 To: adffaces-commits@incubator.apache.org From: awiner@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070202010203.0BD1A1A982B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-demo/pom.xml URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-demo/pom.xml?view=diff&rev=502428&r1=502427&r2=502428 ============================================================================== --- incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-demo/pom.xml (original) +++ incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-demo/pom.xml Thu Feb 1 17:00:47 2007 @@ -18,7 +18,7 @@ org.apache.myfaces.trinidad trinidad - incubator-m1-SNAPSHOT + incubator-1.2-m1-SNAPSHOT 4.0.0 @@ -61,7 +61,7 @@ mail 1.4 - + javax.activation activation @@ -72,38 +72,14 @@ javax.servlet jstl 1.1.2 - runtime + provided - javax.servlet @@ -128,15 +104,16 @@ - org.apache.myfaces.core - myfaces-api - compile + javax.faces + jsf-api + provided + - org.apache.myfaces.core - myfaces-impl - runtime + javax.faces + jsf-impl + provided @@ -159,12 +136,13 @@ javax.faces jsf-api 1.1_02 + provided javax.faces jsf-impl 1.1_02 - runtime + provided @@ -198,4 +176,4 @@ - \ No newline at end of file + Modified: incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-demo/src/main/java/org/apache/myfaces/trinidaddemo/DemoCommandNavigationItemBean.java URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-demo/src/main/java/org/apache/myfaces/trinidaddemo/DemoCommandNavigationItemBean.java?view=diff&rev=502428&r1=502427&r2=502428 ============================================================================== --- incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-demo/src/main/java/org/apache/myfaces/trinidaddemo/DemoCommandNavigationItemBean.java (original) +++ incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-demo/src/main/java/org/apache/myfaces/trinidaddemo/DemoCommandNavigationItemBean.java Thu Feb 1 17:00:47 2007 @@ -23,9 +23,6 @@ import javax.faces.component.UIComponent; import javax.faces.event.ActionEvent; -import org.apache.myfaces.trinidad.bean.FacesBean; -import org.apache.myfaces.trinidad.bean.PropertyKey; -import org.apache.myfaces.trinidad.component.UIXCommand; import org.apache.myfaces.trinidad.component.UIXNavigationHierarchy; import org.apache.myfaces.trinidad.context.RequestContext; @@ -53,16 +50,11 @@ } } - List children = parent.getChildren(); - for (UIXCommand child : children) + List children = parent.getChildren(); + for (UIComponent child : children) { - FacesBean childFacesBean = child.getFacesBean(); - FacesBean.Type type = childFacesBean.getType(); - PropertyKey selectedKey = type.findKey("selected"); - if (selectedKey != null) - { - childFacesBean.setProperty(selectedKey, (child == actionItem)); - } + child.getAttributes().put("selected", + child == actionItem); } RequestContext adfContext = RequestContext.getCurrentInstance(); Modified: incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-demo/src/main/java/org/apache/myfaces/trinidaddemo/composite/DateFieldAsRenderer.java URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-demo/src/main/java/org/apache/myfaces/trinidaddemo/composite/DateFieldAsRenderer.java?view=diff&rev=502428&r1=502427&r2=502428 ============================================================================== --- incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-demo/src/main/java/org/apache/myfaces/trinidaddemo/composite/DateFieldAsRenderer.java (original) +++ incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-demo/src/main/java/org/apache/myfaces/trinidaddemo/composite/DateFieldAsRenderer.java Thu Feb 1 17:00:47 2007 @@ -62,7 +62,7 @@ { _addChildren(context, component); - Map attrs = component.getAttributes(); + Map attrs = component.getAttributes(); if (Boolean.TRUE.equals(attrs.get("readOnly")) || Boolean.TRUE.equals(attrs.get("disabled"))) return; Modified: incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-demo/src/main/webapp/components/selectRangeChoiceBar.jspx URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-demo/src/main/webapp/components/selectRangeChoiceBar.jspx?view=diff&rev=502428&r1=502427&r2=502428 ============================================================================== --- incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-demo/src/main/webapp/components/selectRangeChoiceBar.jspx (original) +++ incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-demo/src/main/webapp/components/selectRangeChoiceBar.jspx Thu Feb 1 17:00:47 2007 @@ -21,6 +21,7 @@ @@ -58,9 +59,9 @@ - + - + Modified: incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-demo/src/main/webapp/demos/progressSteps.jspx URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-demo/src/main/webapp/demos/progressSteps.jspx?view=diff&rev=502428&r1=502427&r2=502428 ============================================================================== --- incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-demo/src/main/webapp/demos/progressSteps.jspx (original) +++ incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-demo/src/main/webapp/demos/progressSteps.jspx Thu Feb 1 17:00:47 2007 @@ -21,6 +21,7 @@ @@ -39,7 +40,7 @@ + text="Progress steps demo using c:forEach and BoundedRangeModel"> @@ -59,7 +60,7 @@ - - + @@ -86,7 +87,7 @@ - - + Modified: incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-demo/src/main/webapp/email/showMessage.jspx URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-demo/src/main/webapp/email/showMessage.jspx?view=diff&rev=502428&r1=502427&r2=502428 ============================================================================== --- incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-demo/src/main/webapp/email/showMessage.jspx (original) +++ incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-demo/src/main/webapp/email/showMessage.jspx Thu Feb 1 17:00:47 2007 @@ -20,6 +20,7 @@ --> @@ -78,19 +79,19 @@ - - + - - + - - + Modified: incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-demo/src/main/webapp/surveydemo/surveyPage1.jspx URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-demo/src/main/webapp/surveydemo/surveyPage1.jspx?view=diff&rev=502428&r1=502427&r2=502428 ============================================================================== --- incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-demo/src/main/webapp/surveydemo/surveyPage1.jspx (original) +++ incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-demo/src/main/webapp/surveydemo/surveyPage1.jspx Thu Feb 1 17:00:47 2007 @@ -20,6 +20,7 @@ --> @@ -28,7 +29,7 @@ - + Modified: incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-demo/src/main/webapp/surveydemo/surveyPage5.jspx URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-demo/src/main/webapp/surveydemo/surveyPage5.jspx?view=diff&rev=502428&r1=502427&r2=502428 ============================================================================== --- incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-demo/src/main/webapp/surveydemo/surveyPage5.jspx (original) +++ incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-demo/src/main/webapp/surveydemo/surveyPage5.jspx Thu Feb 1 17:00:47 2007 @@ -20,6 +20,7 @@ --> Modified: incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-demo/src/main/webapp/surveydemo/surveyResults.jspx URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-demo/src/main/webapp/surveydemo/surveyResults.jspx?view=diff&rev=502428&r1=502427&r2=502428 ============================================================================== --- incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-demo/src/main/webapp/surveydemo/surveyResults.jspx (original) +++ incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-demo/src/main/webapp/surveydemo/surveyResults.jspx Thu Feb 1 17:00:47 2007 @@ -20,6 +20,7 @@ --> Modified: incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/pom.xml URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/pom.xml?view=diff&rev=502428&r1=502427&r2=502428 ============================================================================== --- incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/pom.xml (original) +++ incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/pom.xml Thu Feb 1 17:00:47 2007 @@ -18,7 +18,7 @@ org.apache.myfaces.trinidad trinidad - incubator-m1-SNAPSHOT + incubator-1.2-m1-SNAPSHOT 4.0.0 @@ -115,6 +115,7 @@ org.apache.myfaces.trinidadinternal.facelets.TrinidadComponentHandler org.apache org.apache + 1.2 true @@ -194,6 +195,11 @@ + jstl + jstl + + + org.apache.myfaces.trinidad trinidad-build @@ -204,8 +210,8 @@ - org.apache.myfaces.core - myfaces-api + javax.faces + jsf-api @@ -240,11 +246,13 @@ test + commons-beanutils Modified: incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/conf/META-INF/tr-base.tld URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/conf/META-INF/tr-base.tld?view=diff&rev=502428&r1=502427&r2=502428 ============================================================================== --- incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/conf/META-INF/tr-base.tld (original) +++ incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/conf/META-INF/tr-base.tld Thu Feb 1 17:00:47 2007 @@ -18,203 +18,139 @@ under the License. --> - - + + + Apache Trinidad Core 11-m3 - 1.2 tr http://myfaces.apache.org/trinidad - Apache Trinidad Core org.apache.myfaces.trinidadinternal.webapp.TrinidadListenerImpl - - attribute - org.apache.myfaces.trinidadinternal.taglib.AttributeTag - empty - - The Attribute tag adds a property with the specified name and value - to the component associated with the parent tag. It behaves the same - as the JSF Attribute tag except that it creates a value binding for - expressions instead of immediately evaluating it. - - - name - false - - the name of the attribute - - - - value - false - - the value of the attribute - - - - - - - validator - org.apache.myfaces.trinidadinternal.taglib.ValidatorTag - empty - - The Validator tag adds a new validator instance to the component - associated with the parent tag. The new validator instance is found - by evaluating a binding expression, or looking up a validator ID. - This implements the JSF 1.2 definition of <f:validator>. - - - validatorId - false - - the ID of a validator instance registered in faces-config.xml - - - - binding - false - - the value binding expression to a property that returns a - ValidatorInstance. - - - - forEach org.apache.myfaces.trinidadinternal.taglib.ForEachTag -The forEach tag is a replacement for the JSTL &lt;c:forEach&gt; tag - that works with Apache Trinidad components. Today, &lt;c:forEach&gt; cannot - be used with any JSF components or tags. This tag brings that functionality - to JSF, but it is limited to Apache Trinidad tags. This tag also has several limitations not found in &lt;c:forEach&gt;: - <ul> - <li>&lt;tr:forEach&gt; does not currently support scenarios where the size of the "items" list or array changes from one request to the next. It may be possible to work around this in specific scenarios by manually deleting all children of the parent component (&lt;tr:selectOneListbox&gt; in the above example), but this has not yet been tested.</li> - <li>&lt;tr:forEach&gt; does not support arbitrary java.util.Collections; it can only iterate over java.util.Lists or arrays.</li> - <li>&lt;tr:forEach&gt; executes at the time the JSP tag executes. So it - does not have access to any EL variables that are created by JSF components. - For example, the &lt;tr:table&gt; creates an EL variable using the value of - the "var" attribute. However, this EL variable is not available -to &lt;tr:forEach&gt; - </li> - </ul> +The forEach tag is a replacement for the JSTL &lt;c:forEach&gt; tag. +As of JSF 1.2/JSP 2.1/JSTL 1.2, the regular &lt;c:forEach&gt; tag +does work with JSF components. However, it does not support varStatus +with JSF! (Unlike c:forEach, tr:forEach doesn't currently support anything +for "items" other than arrays and lists.) - items - false the items over which iteration takes place + items + - var - false the name of the variable to expose + var + false - varStatus - false Name of the exported scoped variable for the status of the iteration. + varStatus + false - begin - false the beginning index + begin + false - end - false the ending index + end + false - step - false the number of steps per iteration + step + false - + - setActionListener - org.apache.myfaces.trinidadinternal.taglib.listener.SetActionListenerTag - empty The setActionListener tag provides a declarative syntax for assigning values before an action fires + setActionListener + org.apache.myfaces.trinidadinternal.taglib.listener.SetActionListenerTag + empty - to - true - false the target for the value; must be an EL expression + to + true + - from - true - false the source of the value; can be an EL expression or a constant value + from + true + - returnActionListener - org.apache.myfaces.trinidadinternal.taglib.listener.ReturnActionListenerTag - empty The returnActionListener tag is a declarative way to allow an action source to return a value from a dialog or process. + returnActionListener + org.apache.myfaces.trinidadinternal.taglib.listener.ReturnActionListenerTag + empty - value - false The value to return as the dialog/process result. This can be an EL expression or a constant value. + value + - resetActionListener - org.apache.myfaces.trinidadinternal.taglib.listener.ResetActionListenerTag - empty The resetActionListener tag provides a declarative syntax for resetting values before an action fires + resetActionListener + org.apache.myfaces.trinidadinternal.taglib.listener.ResetActionListenerTag + empty - componentRef - org.apache.myfaces.trinidadinternal.taglib.ComponentRefTag The componentRef tag adds declarative components onto the current @@ -224,69 +160,68 @@ + componentRef + org.apache.myfaces.trinidadinternal.taglib.ComponentRefTag - componentType - true - false Identifies which declarative component to use. All the available components must be declared in a region-metadata.xml file. + componentType + true + - id - true - false This ID must be unique within this page. + id + true - value - false - false A value to pass to the component definition. + value + false + - rendered - false - false Whether or not this component is rendered. + rendered + false + - componentDef - org.apache.myfaces.trinidadinternal.taglib.ComponentDefTag The componentDef tag is used to define a component. Its primary purpose is defining a "var" property so that the definition can refer to attributes on this component's usage. + componentDef + org.apache.myfaces.trinidadinternal.taglib.ComponentDefTag - var - false the variable name to use when referencing attributes, that may be set on this new component. + var + false - facetRef - org.apache.myfaces.trinidadinternal.taglib.FacetRefTag The facetRef tag is used to copy facets from a component and paste them into its @@ -296,12 +231,14 @@ <tr:componentDef>. In other words, a single facet cannot be used more than once. + facetRef + org.apache.myfaces.trinidadinternal.taglib.FacetRefTag - facetName - false the facet name to copy + facetName + false Modified: incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/conf/META-INF/trh-base.tld URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/conf/META-INF/trh-base.tld?view=diff&rev=502428&r1=502427&r2=502428 ============================================================================== --- incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/conf/META-INF/trh-base.tld (original) +++ incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/conf/META-INF/trh-base.tld Thu Feb 1 17:00:47 2007 @@ -18,13 +18,13 @@ under the License. --> - - + + Apache Trinidad HTML 11-m3 - 1.2 trh http://myfaces.apache.org/trinidad/html - Apache Trinidad HTML Modified: incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/ViewHandlerImpl.java URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/ViewHandlerImpl.java?view=diff&rev=502428&r1=502427&r2=502428 ============================================================================== --- incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/ViewHandlerImpl.java (original) +++ incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/ViewHandlerImpl.java Thu Feb 1 17:00:47 2007 @@ -33,6 +33,7 @@ import javax.faces.FacesException; import javax.faces.application.ViewHandler; +import javax.faces.application.ViewHandlerWrapper; import javax.faces.component.UIViewRoot; import javax.faces.context.ExternalContext; import javax.faces.context.FacesContext; @@ -56,10 +57,9 @@ * @todo Rename something less generic * @todo Support extension mapping (*.faces) * @todo The modification detection only works for a single user. That's - * OK for now, because it's intended for use while developing, not while - * deployed - yet it's on all the time. Hrm. + * OK for now, because it's intended for use while developing */ -public class ViewHandlerImpl extends ViewHandler +public class ViewHandlerImpl extends ViewHandlerWrapper { static public final String ALTERNATE_VIEW_HANDLER = "org.apache.myfaces.trinidad.ALTERNATE_VIEW_HANDLER"; @@ -72,16 +72,9 @@ _loadInternalViews(); } - @Override - public Locale calculateLocale(FacesContext context) - { - return _delegate.calculateLocale(context); - } - - @Override - public String calculateRenderKitId(FacesContext context) + protected ViewHandler getWrapped() { - return _delegate.calculateRenderKitId(context); + return _delegate; } @Override @@ -120,13 +113,13 @@ } } - return _delegate.createView(context, viewId); + return super.createView(context, viewId); } @Override public String getActionURL(FacesContext context, String viewId) { - String actionURL = _delegate.getActionURL(context, viewId); + String actionURL = super.getActionURL(context, viewId); RequestContext afContext = RequestContext.getCurrentInstance(); if (afContext != null) { @@ -143,7 +136,7 @@ FacesContext context, String path) { - return _delegate.getResourceURL(context, path); + return super.getResourceURL(context, path); } @@ -178,7 +171,7 @@ } else { - _delegate.renderView(context, viewToRender); + super.renderView(context, viewToRender); } if (service != null) @@ -262,7 +255,7 @@ return null; } - UIViewRoot result = _delegate.restoreView(context, viewId); + UIViewRoot result = super.restoreView(context, viewId); // If we've successfully restored a view, then assume that // this is a postback request. if (result != null) @@ -291,7 +284,7 @@ service.isStateless(context)) return; - _delegate.writeState(context); + super.writeState(context); } synchronized private void _initIfNeeded(FacesContext context) Modified: incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/binding/AccessKeyBinding.java URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/binding/AccessKeyBinding.java?view=diff&rev=502428&r1=502427&r2=502428 ============================================================================== --- incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/binding/AccessKeyBinding.java (original) +++ incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/binding/AccessKeyBinding.java Thu Feb 1 17:00:47 2007 @@ -18,8 +18,11 @@ */ package org.apache.myfaces.trinidadinternal.binding; -import javax.faces.context.FacesContext; -import javax.faces.el.ValueBinding; +import java.io.Serializable; + +import javax.el.ValueExpression; +import javax.el.ELContext; +import javax.el.PropertyNotWritableException; import org.apache.myfaces.trinidadinternal.util.nls.StringUtils; @@ -30,25 +33,25 @@ * * @author The Oracle ADF Faces Team */ -public class AccessKeyBinding extends ValueBindingAdapter +public class AccessKeyBinding extends ValueExpression implements Serializable { /** * Constructor purely for serialization. */ public AccessKeyBinding() { - super(null); } - public AccessKeyBinding(ValueBinding base) + public AccessKeyBinding(ValueExpression expr) { - super(base); + _base = expr; } + @Override - public Object getValue(FacesContext context) + public Object getValue(ELContext context) { - Object o = super.getValue(context); + Object o = _base.getValue(context); if (o == null) return null; @@ -61,8 +64,51 @@ } @Override - public Class getType(FacesContext context) + public void setValue(ELContext context, Object value) + { + throw new PropertyNotWritableException(); + } + + @Override + public Class getType(ELContext context) + { + return Character.class; + } + + @Override + public Class getExpectedType() { return Character.class; } + + @Override + public boolean isReadOnly(ELContext context) + { + return true; + } + + + @Override + public boolean isLiteralText() + { + return false; + } + + @Override + public String getExpressionString() + { + return null; + } + + public int hashCode() + { + return 0; + } + + public boolean equals(Object o) + { + return (o == this); + } + + private ValueExpression _base; } Modified: incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/binding/StripAccessKeyBinding.java URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/binding/StripAccessKeyBinding.java?view=diff&rev=502428&r1=502427&r2=502428 ============================================================================== --- incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/binding/StripAccessKeyBinding.java (original) +++ incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/binding/StripAccessKeyBinding.java Thu Feb 1 17:00:47 2007 @@ -18,8 +18,11 @@ */ package org.apache.myfaces.trinidadinternal.binding; -import javax.faces.context.FacesContext; -import javax.faces.el.ValueBinding; +import java.io.Serializable; + +import javax.el.ValueExpression; +import javax.el.ELContext; +import javax.el.PropertyNotWritableException; import org.apache.myfaces.trinidadinternal.util.nls.StringUtils; @@ -30,25 +33,18 @@ * * @author The Oracle ADF Faces Team */ -public class StripAccessKeyBinding extends ValueBindingAdapter +public class StripAccessKeyBinding extends ValueExpression implements Serializable { - /** - * Constructor purely for serialization. - */ - public StripAccessKeyBinding() - { - super(null); - } - public StripAccessKeyBinding(ValueBinding base) + public StripAccessKeyBinding(ValueExpression base) { - super(base); + _base = base; } @Override - public Object getValue(FacesContext context) + public Object getValue(ELContext context) { - Object o = super.getValue(context); + Object o = _base.getValue(context); if (o == null) return null; @@ -61,8 +57,50 @@ } @Override - public Class getType(FacesContext context) + public void setValue(ELContext context, Object value) + { + throw new PropertyNotWritableException(); + } + + @Override + public Class getType(ELContext context) + { + return Character.class; + } + + @Override + public Class getExpectedType() + { + return Character.class; + } + + @Override + public boolean isReadOnly(ELContext context) { - return String.class; + return true; } + + @Override + public boolean isLiteralText() + { + return false; + } + + @Override + public String getExpressionString() + { + return null; + } + + public int hashCode() + { + return 0; + } + + public boolean equals(Object o) + { + return (o == this); + } + + private ValueExpression _base; } Modified: incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/DialogServiceImpl.java URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/DialogServiceImpl.java?view=diff&rev=502428&r1=502427&r2=502428 ============================================================================== --- incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/DialogServiceImpl.java (original) +++ incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/DialogServiceImpl.java Thu Feb 1 17:00:47 2007 @@ -24,10 +24,11 @@ import java.util.List; import java.util.Map; +import javax.el.ValueExpression; + import javax.faces.component.UIComponent; import javax.faces.component.UIViewRoot; import javax.faces.context.FacesContext; -import javax.faces.el.ValueBinding; import javax.faces.render.RenderKit; import org.apache.myfaces.trinidad.context.RequestContext; @@ -212,8 +213,9 @@ FacesContext context = _getFacesContext(); if (TrinidadFilterImpl.isExecutingDialogReturn(context)) { - Map parameterMap = context.getExternalContext().getRequestParameterMap(); - Object returnParam = parameterMap.get(_RETURN_PARAM); + Map parameterMap = + context.getExternalContext().getRequestParameterMap(); + String returnParam = parameterMap.get(_RETURN_PARAM); if (returnParam == null) return null; @@ -412,9 +414,9 @@ @SuppressWarnings("unchecked") private void _executeBindings(FacesContext context, UIComponent component) { - ValueBinding binding = component.getValueBinding("binding"); - if (binding != null) - binding.setValue(context, component); + ValueExpression expression = component.getValueExpression("binding"); + if (expression != null) + expression.setValue(context.getELContext(), component); Iterator kids = component.getFacetsAndChildren(); while (kids.hasNext()) Modified: incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/FacesContextFactoryImpl.java URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/FacesContextFactoryImpl.java?view=diff&rev=502428&r1=502427&r2=502428 ============================================================================== --- incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/FacesContextFactoryImpl.java (original) +++ incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/FacesContextFactoryImpl.java Thu Feb 1 17:00:47 2007 @@ -21,6 +21,8 @@ import java.io.IOException; import java.util.Iterator; +import javax.el.ELContext; + import javax.faces.application.Application; import javax.faces.application.FacesMessage; import javax.faces.component.UIViewRoot; @@ -257,6 +259,11 @@ _base.release(); } + public ELContext getELContext() + { + return _base.getELContext(); + } + private final FacesContext _base; private final ExternalContext _external; private String _renderKitId; Modified: incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/RequestContextImpl.java URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/RequestContextImpl.java?view=diff&rev=502428&r1=502427&r2=502428 ============================================================================== --- incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/RequestContextImpl.java (original) +++ incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/RequestContextImpl.java Thu Feb 1 17:00:47 2007 @@ -202,7 +202,7 @@ if (Boolean.TRUE.equals(requestMap.get(FORCED_PARTIAL_KEY))) return true; - Map parameters = context.getExternalContext().getRequestParameterMap(); + Map parameters = context.getExternalContext().getRequestParameterMap(); if ("true".equals(parameters.get(XhtmlConstants.PARTIAL_PARAM))) return true; @@ -496,6 +496,17 @@ } } + /** + * Returns the set of partial targets related to a given UIComponent. + */ + @Override + public Set getPartialTargets(UIComponent source) + { + HashSet set = new HashSet(); + _addPartialTargets(set, source); + return set; + } + @Override public void addPartialTriggerListeners (UIComponent listener, @@ -744,6 +755,33 @@ return _partialListeners; } + + // + // Recursively builds up the set of partial targets of + // a given component + // + private void _addPartialTargets( + Set sofar, UIComponent from) + { + Map> pl = _getPartialListeners(); + Set listeners = pl.get(from); + if (listeners == null) + return; + + for (UIComponent target : listeners) + { + // If we haven't encountered this target yet, add + // it, and continue recursively. + if (!sofar.contains(target)) + { + sofar.add(target); + _addPartialTargets(sofar, target); + } + } + } + + + static private UIComponent _findRelativeComponent( UIComponent from, Modified: incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java?view=diff&rev=502428&r1=502427&r2=502428 ============================================================================== --- incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java (original) +++ incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java Thu Feb 1 17:00:47 2007 @@ -35,7 +35,7 @@ import javax.faces.context.FacesContext; import javax.faces.convert.Converter; import javax.faces.convert.ConverterException; -import javax.faces.el.ValueBinding; +import javax.el.ValueExpression; import org.apache.myfaces.trinidad.context.RenderingContext; import org.apache.myfaces.trinidad.convert.ClientConverter; @@ -113,10 +113,10 @@ UIComponent component, String strValue, Object value) { assert value != null; - ValueBinding binding = component.getValueBinding("value"); - if (binding != null) + ValueExpression expression = component.getValueExpression("value"); + if (expression != null) { - Class expectedType = binding.getType(context); + Class expectedType = expression.getType(context.getELContext()); // Sometimes the type might be null, if it cannot be determined: if ((expectedType != null) && (!expectedType.isAssignableFrom(value.getClass()))) @@ -163,10 +163,8 @@ if (clientId != null) { // =-=AEW Only if Javascript... - // -= Simon Lessard =- - // FIXME: JSF 1.2 specifies - Map requestMap = context.getExternalContext() - .getRequestMap(); + Map requestMap = + context.getExternalContext().getRequestMap(); // this fetch could be at the place where we append, but has been // moved ahead to optimize use of StringBuffer @@ -547,7 +545,7 @@ // RenderingContext key indicating the _dateFormat object // has been created - private static final Object _PATTERN_WRITTEN_KEY = "org.apache.myfaces.trinidadinternal.convert.DateTimeConverter._PATTERN_WRITTEN"; + private static final String _PATTERN_WRITTEN_KEY = "org.apache.myfaces.trinidadinternal.convert.DateTimeConverter._PATTERN_WRITTEN"; // String indicating that NO_JS_PATTERN is available private static final String _NO_JS_PATTERN = new String(); Modified: incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/ReturnActionListenerTag.java URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/ReturnActionListenerTag.java?view=diff&rev=502428&r1=502427&r2=502428 ============================================================================== --- incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/ReturnActionListenerTag.java (original) +++ incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/ReturnActionListenerTag.java Thu Feb 1 17:00:47 2007 @@ -58,10 +58,10 @@ ValueExpression valueExp = _value.getValueExpression(faceletContext, Object.class); ActionSource actionSource = (ActionSource)parent; ReturnActionListener listener = new ReturnActionListener(); - listener.setValueBinding(ReturnActionListener.VALUE_KEY, new LegacyValueBinding(valueExp)); + listener.setValueExpression(ReturnActionListener.VALUE_KEY, valueExp); actionSource.addActionListener(listener); } } private final TagAttribute _value; -} \ No newline at end of file +} Modified: incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/SetActionListenerTag.java URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/SetActionListenerTag.java?view=diff&rev=502428&r1=502427&r2=502428 ============================================================================== --- incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/SetActionListenerTag.java (original) +++ incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/SetActionListenerTag.java Thu Feb 1 17:00:47 2007 @@ -27,14 +27,12 @@ import com.sun.facelets.FaceletContext; import com.sun.facelets.FaceletException; -import com.sun.facelets.el.LegacyValueBinding; import com.sun.facelets.tag.TagAttribute; import com.sun.facelets.tag.TagConfig; import com.sun.facelets.tag.TagHandler; import com.sun.facelets.tag.jsf.ComponentSupport; /** - * @todo it should be removed after we consume JSF1.2. * @author Emmanuel Pirsch */ public class SetActionListenerTag extends TagHandler @@ -60,10 +58,10 @@ Object.class); ActionSource actionSource= (ActionSource) parent; SetActionListener listener = new SetActionListener(); - listener.setValueBinding(SetActionListener.FROM_KEY, - new LegacyValueBinding(fromExpression)); - listener.setValueBinding(SetActionListener.TO_KEY, - new LegacyValueBinding(toExpression)); + listener.setValueExpression(SetActionListener.FROM_KEY, + fromExpression); + listener.setValueExpression(SetActionListener.TO_KEY, + toExpression); actionSource.addActionListener(listener); } } Modified: incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/TrinidadListenersTagRule.java URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/TrinidadListenersTagRule.java?view=diff&rev=502428&r1=502427&r2=502428 ============================================================================== --- incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/TrinidadListenersTagRule.java (original) +++ incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/TrinidadListenersTagRule.java Thu Feb 1 17:00:47 2007 @@ -42,9 +42,9 @@ { public static final MetaRule Instance = new TrinidadListenersTagRule(); - private static class ListenerPropertyMetadata extends Metadata + private static class ListenerMBPropertyMetadata extends Metadata { - public ListenerPropertyMetadata(Method method, TagAttribute attribute, Class[] paramList) + public ListenerMBPropertyMetadata(Method method, TagAttribute attribute, Class[] paramList) { _method = method; _attribute = attribute; @@ -77,6 +77,42 @@ private final TagAttribute _attribute; private Class[] _paramList; } + + private static class ListenerMEPropertyMetadata extends Metadata + { + public ListenerMEPropertyMetadata(Method method, TagAttribute attribute, Class[] paramList) + { + _method = method; + _attribute = attribute; + _paramList = paramList; + } + + @Override + @SuppressWarnings("deprecation") + public void applyMetadata(FaceletContext ctx, Object instance) + { + MethodExpression expr = + _attribute.getMethodExpression(ctx, null, _paramList); + + try + { + _method.invoke(instance, + new Object[]{expr}); + } + catch (InvocationTargetException e) + { + throw new TagAttributeException(_attribute, e.getCause()); + } + catch (Exception e) + { + throw new TagAttributeException(_attribute, e); + } + } + + private final Method _method; + private final TagAttribute _attribute; + private Class[] _paramList; + } @Override @@ -85,7 +121,11 @@ TagAttribute attribute, MetadataTarget meta) { - if ((meta.getPropertyType(name) == MethodBinding.class) && + Class metaType = meta.getPropertyType(name); + boolean isMethodBinding = (metaType == MethodBinding.class); + boolean isMethodExpression = (metaType == MethodExpression.class); + + if ((isMethodBinding || isMethodExpression) && name.endsWith("Listener")) { // OK, we're trying to call setFooListener() @@ -113,8 +153,12 @@ return null; // And go - return new ListenerPropertyMetadata(m, attribute, - new Class[]{eventClass}); + if (isMethodBinding) + return new ListenerMBPropertyMetadata(m, attribute, + new Class[]{eventClass}); + else + return new ListenerMEPropertyMetadata(m, attribute, + new Class[]{eventClass}); } } return null; Modified: incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/io/IndentingResponseWriter.java URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/io/IndentingResponseWriter.java?view=diff&rev=502428&r1=502427&r2=502428 ============================================================================== --- incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/io/IndentingResponseWriter.java (original) +++ incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/io/IndentingResponseWriter.java Thu Feb 1 17:00:47 2007 @@ -113,6 +113,16 @@ * Writes a String, escaped properly for this method. */ @Override + public void writeText(Object text, UIComponent component, String componentPropertyName) throws IOException + { + _seeIfJustEndedElement(); + super.writeText(text, component, componentPropertyName); + } + + /** + * Writes a String, escaped properly for this method. + */ + @Override public void writeText(Object text, String componentPropertyName) throws IOException { _seeIfJustEndedElement(); Modified: incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/io/ResponseWriterDecorator.java URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/io/ResponseWriterDecorator.java?view=diff&rev=502428&r1=502427&r2=502428 ============================================================================== --- incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/io/ResponseWriterDecorator.java (original) +++ incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/io/ResponseWriterDecorator.java Thu Feb 1 17:00:47 2007 @@ -127,6 +127,15 @@ getResponseWriter().writeComment(comment); } + + + @Override + public void writeText(Object text, UIComponent component, + String propertyName) + throws IOException + { + getResponseWriter().writeText(text, component, propertyName); + } @Override public void writeText(Object text, String componentPropertyName) throws IOException Modified: incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/menu/ItemNode.java URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/menu/ItemNode.java?view=diff&rev=502428&r1=502427&r2=502428 ============================================================================== --- incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/menu/ItemNode.java (original) +++ incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/menu/ItemNode.java Thu Feb 1 17:00:47 2007 @@ -74,7 +74,7 @@ { // Value of action is EL method binding, so we // need to evaluate it - value = (String)MenuUtils.getBoundValue(value); + value = MenuUtils.getBoundValue(value, String.class); } // Post me as the selected Node for the request @@ -113,7 +113,7 @@ { // Value of action is EL method binding, so we // need to evaluate it - value = (String)MenuUtils.getBoundValue(value); + value = MenuUtils.getBoundValue(value, String.class); setActionListener(value); } @@ -150,7 +150,7 @@ { // Value of action is EL method binding, so we // need to evaluate it - value = (String)MenuUtils.getBoundValue(value); + value = MenuUtils.getBoundValue(value, String.class); setLaunchListener(value); } @@ -187,7 +187,7 @@ { // Value of action is EL method binding, so we // need to evaluate it - value = (String)MenuUtils.getBoundValue(value); + value = MenuUtils.getBoundValue(value, String.class); setReturnListener(value); } @@ -373,7 +373,7 @@ { // Value of action is EL method binding, so we // need to evaluate it - value = (String)MenuUtils.getBoundValue(value); + value = MenuUtils.getBoundValue(value, String.class); } // Appending nodeId to URL so that we can identify the node @@ -409,7 +409,7 @@ { // Value of destination is EL value binding, so we // need to evaluate it - value = (String)MenuUtils.getBoundValue(value); + value = MenuUtils.getBoundValue(value, String.class); setTargetFrame(value); } Modified: incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/menu/MenuContentHandlerImpl.java URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/menu/MenuContentHandlerImpl.java?view=diff&rev=502428&r1=502427&r2=502428 ============================================================================== --- incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/menu/MenuContentHandlerImpl.java (original) +++ incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/menu/MenuContentHandlerImpl.java Thu Feb 1 17:00:47 2007 @@ -260,7 +260,8 @@ // into another menu model. _saveModelData(); - XMLMenuModel menuModel = (XMLMenuModel)MenuUtils.getBoundValue(expr); + XMLMenuModel menuModel = (XMLMenuModel)MenuUtils.getBoundValue(expr, + Object.class); // Now must pop the values cause we are back to the parent // model. Modified: incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/menu/MenuNode.java URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/menu/MenuNode.java?view=diff&rev=502428&r1=502427&r2=502428 ============================================================================== --- incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/menu/MenuNode.java (original) +++ incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/menu/MenuNode.java Thu Feb 1 17:00:47 2007 @@ -754,13 +754,13 @@ elVar = str.substring(0, str.indexOf('.')); String elKey = str.substring(str.indexOf('.')); String elStr = elVar + getHandlerId() + elKey; - String elVal = (String)MenuUtils.getBoundValue(elStr); + String elVal = MenuUtils.getBoundValue(elStr, String.class); return elVal; } else { // We have some other EL expression - return (String)MenuUtils.getBoundValue(str); + return MenuUtils.getBoundValue(str, String.class); } } Modified: incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/menu/MenuUtils.java URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/menu/MenuUtils.java?view=diff&rev=502428&r1=502427&r2=502428 ============================================================================== --- incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/menu/MenuUtils.java (original) +++ incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/menu/MenuUtils.java Thu Feb 1 17:00:47 2007 @@ -30,8 +30,6 @@ import java.util.Set; import javax.faces.context.FacesContext; -import javax.faces.el.ValueBinding; - import javax.faces.webapp.UIComponentTag; import org.apache.myfaces.trinidad.logging.TrinidadLogger; @@ -47,7 +45,7 @@ MenuUtils() {} //======================================================================= - // Bound Value/EL Binding utilities + // Bound Value/EL Expression utilities //======================================================================= /** @@ -55,18 +53,17 @@ * * @param elExpression - String representing an EL expression */ - static Object getBoundValue(String elExpression) + static T getBoundValue(String elExpression, Class desiredClass) { - Object retVal = null; - try { - // Value of rendered is EL method binding, so we - // need to evaluate it - FacesContext ctx = FacesContext.getCurrentInstance(); - ValueBinding binding = - ctx.getApplication().createValueBinding(elExpression); - retVal = binding.getValue(ctx); + if (desiredClass == null) + throw new NullPointerException(); + + FacesContext ctx = FacesContext.getCurrentInstance(); + return (T) ctx.getApplication().evaluateExpressionGet(ctx, + elExpression, + desiredClass); } catch (Exception ex) { @@ -74,7 +71,6 @@ " is invalid or returned a bad value.\n", ex); return null; } - return retVal; } /** @@ -99,7 +95,7 @@ && UIComponentTag.isValueReference(boolStr) ) { - Boolean bValue = (Boolean) getBoundValue(boolStr); + Boolean bValue = getBoundValue(boolStr, Boolean.class); return bValue.booleanValue(); } else @@ -123,7 +119,7 @@ && UIComponentTag.isValueReference(propVal) ) { - String elVal = (String) getBoundValue(propVal); + String elVal = getBoundValue(propVal, String.class); return elVal; } return propVal; @@ -141,7 +137,7 @@ && UIComponentTag.isValueReference(propVal) ) { - Integer elVal = (Integer) getBoundValue(propVal); + Integer elVal = getBoundValue(propVal, Integer.class); return elVal.intValue(); } return Integer.parseInt(propVal); @@ -205,7 +201,7 @@ // if _bundleName is an EL, then get its value if (UIComponentTag.isValueReference(resBundle)) { - bundleName = (String)MenuUtils.getBoundValue(resBundle); + bundleName = MenuUtils.getBoundValue(resBundle, String.class); } else { Modified: incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/CoreResponseStateManager.java URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/CoreResponseStateManager.java?view=diff&rev=502428&r1=502427&r2=502428 ============================================================================== --- incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/CoreResponseStateManager.java (original) +++ incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/CoreResponseStateManager.java Thu Feb 1 17:00:47 2007 @@ -70,7 +70,10 @@ ResponseWriter rw = context.getResponseWriter(); rw.startElement("input", null); rw.writeAttribute("type", "hidden", null); - rw.writeAttribute("name", _STATE_FIELD_NAME, null); + rw.writeAttribute("name", VIEW_STATE_PARAM, null); + // Don't write out the ID, as it can be written + // out twice + // rw.writeAttribute("id", VIEW_STATE_PARAM, null); String s = encodeSerializedViewAsString(serializedView); rw.writeAttribute("value", s, null); @@ -78,6 +81,16 @@ rw.endElement("input"); } + @Override + /** + * A request is a postback if it contains the state parameter. + */ + public boolean isPostback(FacesContext context) + { + Map requestParams = context.getExternalContext().getRequestParameterMap(); + return requestParams.containsKey(VIEW_STATE_PARAM); + } + protected String encodeSerializedViewAsString( StateManager.SerializedView serializedView) throws IOException @@ -147,7 +160,7 @@ Map requestParamMap = context.getExternalContext().getRequestParameterMap(); - String stateString = requestParamMap.get(_STATE_FIELD_NAME); + String stateString = requestParamMap.get(VIEW_STATE_PARAM); if (stateString == null) return null; @@ -197,8 +210,6 @@ return view; } - - static private final String _STATE_FIELD_NAME = "org.apache.myfaces.trinidad.faces.STATE"; /* Test code for dumping out the page's state Modified: incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/EditableValueRenderer.java URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/EditableValueRenderer.java?view=diff&rev=502428&r1=502427&r2=502428 ============================================================================== --- incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/EditableValueRenderer.java (original) +++ incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/EditableValueRenderer.java Thu Feb 1 17:00:47 2007 @@ -22,12 +22,13 @@ import java.util.Iterator; +import javax.el.ValueExpression; + import javax.faces.component.EditableValueHolder; import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; import javax.faces.convert.Converter; import javax.faces.convert.ConverterException; -import javax.faces.el.ValueBinding; import javax.faces.validator.Validator; import org.apache.myfaces.trinidad.logging.TrinidadLogger; @@ -230,15 +231,15 @@ if (Boolean.TRUE.equals(o)) return true; - // Now, if the ValueBinding underlying the value says it's + // Now, if the ValueExpression underlying the value says it's // read-only, then again, it is. - ValueBinding vb = getValueBinding(bean); - if ((vb != null) && vb.isReadOnly(context)) + ValueExpression ve = getValueExpression(bean); + if ((ve != null) && ve.isReadOnly(context.getELContext())) { if (_LOG.isFiner()) { _LOG.finer("Value expression {0} is read-only", - vb.getExpressionString()); + ve.getExpressionString()); } return true; Modified: incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputColorRenderer.java URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputColorRenderer.java?view=diff&rev=502428&r1=502427&r2=502428 ============================================================================== --- incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputColorRenderer.java (original) +++ incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputColorRenderer.java Thu Feb 1 17:00:47 2007 @@ -77,7 +77,7 @@ { FacesBean bean = getFacesBean(component); // If there's a non-default action, then just launch away - if (getAction(bean) != null) + if (getActionExpression(bean) != null) { super.queueActionEvent(context, component); } @@ -298,7 +298,7 @@ // If the field has an action, use the default behavior. Or, // if the field doesn't support launching a window at all, // use the default behavior. - if ((getAction(bean) != null) || + if ((getActionExpression(bean) != null) || !Boolean.TRUE.equals( arc.getAgent().getCapabilities().get(TrinidadAgent.CAP_MULTIPLE_WINDOWS))) return super.getLaunchOnclick(context, arc, component, bean); Modified: incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputDateRenderer.java URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputDateRenderer.java?view=diff&rev=502428&r1=502427&r2=502428 ============================================================================== --- incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputDateRenderer.java (original) +++ incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputDateRenderer.java Thu Feb 1 17:00:47 2007 @@ -77,7 +77,7 @@ { FacesBean bean = getFacesBean(component); // If there's a non-default action, then just launch away - if (getAction(bean) != null) + if (getActionExpression(bean) != null) { super.queueActionEvent(context, component); } @@ -352,7 +352,7 @@ // If the field has an action, use the default behavior. Or, // if the field doesn't support launching a window at all, // use the default behavior. - if ((getAction(bean) != null) || + if ((getActionExpression(bean) != null) || !Boolean.TRUE.equals( arc.getAgent().getCapabilities().get(TrinidadAgent.CAP_MULTIPLE_WINDOWS))) return super.getLaunchOnclick(context, arc, component, bean); Modified: incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputListOfValuesRenderer.java URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputListOfValuesRenderer.java?view=diff&rev=502428&r1=502427&r2=502428 ============================================================================== --- incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputListOfValuesRenderer.java (original) +++ incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputListOfValuesRenderer.java Thu Feb 1 17:00:47 2007 @@ -63,7 +63,7 @@ super.findTypeConstants(type); _searchDescKey = type.findKey("searchDesc"); _iconKey = type.findKey("icon"); - _actionKey = type.findKey("action"); + _actionExpressionKey = type.findKey("actionExpression"); } // @@ -360,9 +360,9 @@ return true; } - protected Object getAction(FacesBean bean) + protected Object getActionExpression(FacesBean bean) { - return bean.getProperty(_actionKey); + return bean.getProperty(_actionExpressionKey); } protected String getSearchDesc( @@ -395,7 +395,7 @@ return "af|inputListOfValues::content"; } - private PropertyKey _actionKey; + private PropertyKey _actionExpressionKey; private PropertyKey _iconKey; private PropertyKey _searchDescKey; Modified: incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleSelectManyRenderer.java URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleSelectManyRenderer.java?view=diff&rev=502428&r1=502427&r2=502428 ============================================================================== --- incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleSelectManyRenderer.java (original) +++ incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleSelectManyRenderer.java Thu Feb 1 17:00:47 2007 @@ -26,14 +26,14 @@ import java.util.Arrays; import java.util.List; +import javax.el.ValueExpression; + import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; import javax.faces.context.ResponseWriter; import javax.faces.convert.Converter; import javax.faces.convert.ConverterException; -import javax.faces.el.ValueBinding; - import javax.faces.model.SelectItem; import org.apache.myfaces.trinidad.logging.TrinidadLogger; @@ -95,10 +95,10 @@ converter = getDefaultConverter(context, bean); Class modelClass = null; - ValueBinding binding = getValueBinding(bean); - if (binding != null) + ValueExpression expression = getValueExpression(bean); + if (expression != null) { - modelClass = binding.getType(context); + modelClass = expression.getType(context.getELContext()); } boolean valuePassThru = getValuePassThru(getFacesBean(component)); @@ -147,11 +147,11 @@ FacesContext context, FacesBean bean) { - ValueBinding binding = getValueBinding(bean); - if (binding == null) + ValueExpression expression = getValueExpression(bean); + if (expression == null) return null; - Class type = binding.getType(context); + Class type = expression.getType(context.getELContext()); if ((type == null) || type.isAssignableFrom(List.class)) return null; Modified: incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ValueRenderer.java URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ValueRenderer.java?view=diff&rev=502428&r1=502427&r2=502428 ============================================================================== --- incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ValueRenderer.java (original) +++ incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ValueRenderer.java Thu Feb 1 17:00:47 2007 @@ -18,10 +18,11 @@ */ package org.apache.myfaces.trinidadinternal.renderkit.core.xhtml; +import javax.el.ValueExpression; + import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; import javax.faces.convert.Converter; -import javax.faces.el.ValueBinding; import org.apache.myfaces.trinidad.bean.FacesBean; import org.apache.myfaces.trinidad.bean.PropertyKey; @@ -70,11 +71,11 @@ FacesContext context, FacesBean bean) { - ValueBinding binding = getValueBinding(bean); - if (binding == null) + ValueExpression expression = getValueExpression(bean); + if (expression == null) return null; - Class type = binding.getType(context); + Class type = expression.getType(context.getELContext()); return ConverterUtils.createConverter(context, type); } @@ -84,11 +85,11 @@ } /** - * Returns the ValueBinding for the "value" property. + * Returns the ValueExpression for the "value" property. */ - protected ValueBinding getValueBinding(FacesBean bean) + protected ValueExpression getValueExpression(FacesBean bean) { - return bean.getValueBinding(_valueKey); + return bean.getValueExpression(_valueKey); } protected Converter getConverter(FacesBean bean) Modified: incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TableSelectOneRenderer.java URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TableSelectOneRenderer.java?view=diff&rev=502428&r1=502427&r2=502428 ============================================================================== --- incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TableSelectOneRenderer.java (original) +++ incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TableSelectOneRenderer.java Thu Feb 1 17:00:47 2007 @@ -240,6 +240,13 @@ } @Override + protected String getClientId(FacesContext context, UIComponent component) + { + // We use the table's container client ID + return component.getContainerClientId(context); + } + + @Override protected Object getSubmittedValue(FacesBean bean) { TableRenderingContext tContext = Modified: incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TreeNodeColumnRenderer.java URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TreeNodeColumnRenderer.java?view=diff&rev=502428&r1=502427&r2=502428 ============================================================================== --- incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TreeNodeColumnRenderer.java (original) +++ incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TreeNodeColumnRenderer.java Thu Feb 1 17:00:47 2007 @@ -138,7 +138,7 @@ { // we need to render a unique ID for the expand/collapse link, so that // PPR can restore the focus correctly after a PPR request: - String tableName = tContext.getTable().getClientId(fc); + String tableName = tContext.getTable().getContainerClientId(fc); String id = tableName + NamingContainer.SEPARATOR_CHAR + _ICON_ID; fc.getResponseWriter().writeAttribute("id", id, null); } Modified: incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/htmlBasic/ComponentFacesBean.java URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/htmlBasic/ComponentFacesBean.java?view=diff&rev=502428&r1=502427&r2=502428 ============================================================================== --- incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/htmlBasic/ComponentFacesBean.java (original) +++ incubator/adffaces/branches/faces-1_2-070201/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/htmlBasic/ComponentFacesBean.java Thu Feb 1 17:00:47 2007 @@ -21,6 +21,8 @@ import java.util.Iterator; import java.util.Set; +import javax.el.ValueExpression; + import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; import javax.faces.el.ValueBinding; @@ -69,9 +71,20 @@ throw new UnsupportedOperationException(); } + final public ValueBinding getValueBinding(PropertyKey key) { return _component.getValueBinding(key.getName()); + } + + final public ValueExpression getValueExpression(PropertyKey key) + { + return _component.getValueExpression(key.getName()); + } + + final public void setValueExpression(PropertyKey key, ValueExpression expression) + { + throw new UnsupportedOperationException(); } final public Object getRawProperty(PropertyKey key)