You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2011/07/07 17:41:21 UTC
svn commit: r1143889 - in /myfaces/tobago/trunk:
tobago-jsf-compat/src/main/java/org/apache/myfaces/tobago/compat/
tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/
Author: lofwyr
Date: Thu Jul 7 15:41:21 2011
New Revision: 1143889
URL: http://svn.apache.org/viewvc?rev=1143889&view=rev
Log:
TOBAGO-420: Opening DatePicker popup next to DatePicker Image
Modified:
myfaces/tobago/trunk/tobago-jsf-compat/src/main/java/org/apache/myfaces/tobago/compat/FacesUtils.java
myfaces/tobago/trunk/tobago-jsf-compat/src/main/java/org/apache/myfaces/tobago/compat/FacesUtilsEL.java
myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/DatePickerRenderer.java
Modified: myfaces/tobago/trunk/tobago-jsf-compat/src/main/java/org/apache/myfaces/tobago/compat/FacesUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-jsf-compat/src/main/java/org/apache/myfaces/tobago/compat/FacesUtils.java?rev=1143889&r1=1143888&r2=1143889&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-jsf-compat/src/main/java/org/apache/myfaces/tobago/compat/FacesUtils.java (original)
+++ myfaces/tobago/trunk/tobago-jsf-compat/src/main/java/org/apache/myfaces/tobago/compat/FacesUtils.java Thu Jul 7 15:41:21 2011
@@ -198,6 +198,16 @@ public class FacesUtils {
return null;
}
+ public static Object createExpressionOrBinding(String string) {
+ if (USE_BINDING) {
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ ValueBinding valueBinding = facesContext.getApplication().createValueBinding(string);
+ return valueBinding;
+ } else {
+ return FacesUtilsEL.createExpressionOrBinding(string);
+ }
+ }
+
public static void setValidator(EditableValueHolder editableValueHolder, Object validator) {
if (USE_BINDING) {
MethodBinding methodBinding =
Modified: myfaces/tobago/trunk/tobago-jsf-compat/src/main/java/org/apache/myfaces/tobago/compat/FacesUtilsEL.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-jsf-compat/src/main/java/org/apache/myfaces/tobago/compat/FacesUtilsEL.java?rev=1143889&r1=1143888&r2=1143889&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-jsf-compat/src/main/java/org/apache/myfaces/tobago/compat/FacesUtilsEL.java (original)
+++ myfaces/tobago/trunk/tobago-jsf-compat/src/main/java/org/apache/myfaces/tobago/compat/FacesUtilsEL.java Thu Jul 7 15:41:21 2011
@@ -24,6 +24,7 @@ import org.apache.myfaces.tobago.util.Va
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import javax.el.ExpressionFactory;
import javax.el.MethodExpression;
import javax.el.ValueExpression;
import javax.faces.component.ActionSource;
@@ -162,6 +163,14 @@ public class FacesUtilsEL {
return null;
}
+ public static Object createExpressionOrBinding(String string) {
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ ExpressionFactory expressionFactory = facesContext.getApplication().getExpressionFactory();
+ ValueExpression valueExpression =
+ expressionFactory.createValueExpression(facesContext.getELContext(), string, Object.class);
+ return valueExpression;
+ }
+
public static void setValidator(EditableValueHolder editableValueHolder, Object validator) {
if (validator instanceof MethodExpression) {
editableValueHolder.addValidator(new MethodExpressionValidator((MethodExpression) validator));
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/DatePickerRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/DatePickerRenderer.java?rev=1143889&r1=1143888&r2=1143889&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/DatePickerRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/DatePickerRenderer.java Thu Jul 7 15:41:21 2011
@@ -72,6 +72,11 @@ public class DatePickerRenderer extends
popup.setRendered(false);
popup.onComponentPopulated(facesContext, parent);
+ FacesUtils.setBindingOrExpression(
+ popup, Attributes.LEFT, FacesUtils.createExpressionOrBinding("#{tobago.actionPosition.right.pixel + 5}"));
+ FacesUtils.setBindingOrExpression(
+ popup, Attributes.TOP, FacesUtils.createExpressionOrBinding("#{tobago.actionPosition.top.pixel}"));
+
final UIBox box = (UIBox) CreateComponentUtils.createComponent(
facesContext, UIBox.COMPONENT_TYPE, RendererTypes.BOX, "box");
popup.getChildren().add(box);