Author: lofwyr
Date: Thu May 3 09:46:57 2012
New Revision: 1333387
URL: http://svn.apache.org/viewvc?rev=1333387&view=rev
Log:
merged from trunk
Added:
myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIDatePicker.java
- copied unchanged from r1333384, myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIDatePicker.java
myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUILink.java
- copied unchanged from r1333384, myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUILink.java
myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/main/webapp/tc/date/date-tobago-1105.xhtml
- copied unchanged from r1333384, myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/date/date-tobago-1105.xhtml
myfaces/tobago/branches/tobago-tree-table/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/image/dateDisabled.gif
- copied unchanged from r1333384, myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/image/dateDisabled.gif
myfaces/tobago/branches/tobago-tree-table/tobago-theme/tobago-theme-speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/image/dateDisabled.gif
- copied unchanged from r1333384, myfaces/tobago/trunk/tobago-theme/tobago-theme-speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/image/dateDisabled.gif
Removed:
myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIDatePicker.java
Modified:
myfaces/tobago/branches/tobago-tree-table/ (props changed)
myfaces/tobago/branches/tobago-tree-table/pom.xml
myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/context/TobagoBundle.java
myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/context/TobagoContext.java
myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIDate.java
myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIGridLayout.java
myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/DatePickerTagDeclaration.java
myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/LinkTagDeclaration.java
myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/HtmlWriterUtils.java
myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java
myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/clientConfig/ClientConfigController.java
myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tags/layout/overview.tag
myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tags/layout/overview.xhtml
myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/SelectManyListboxBean.java
myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/main/webapp/tc/date/date.xhtml
myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/tc/popup/BugTobago1103SeleniumTest.java
myfaces/tobago/branches/tobago-tree-table/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/DateExtensionHandler.java
myfaces/tobago/branches/tobago-tree-table/tobago-jsf-compat/src/main/java/org/apache/myfaces/tobago/compat/FacesUtils.java
myfaces/tobago/branches/tobago-tree-table/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/DatePickerRenderer.java
myfaces/tobago/branches/tobago-tree-table/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/LabelRenderer.java
myfaces/tobago/branches/tobago-tree-table/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/LinkRenderer.java
myfaces/tobago/branches/tobago-tree-table/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MessagesRenderer.java
myfaces/tobago/branches/tobago-tree-table/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/OutRenderer.java
myfaces/tobago/branches/tobago-tree-table/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeSelectRenderer.java
Propchange: myfaces/tobago/branches/tobago-tree-table/
------------------------------------------------------------------------------
Merged /myfaces/tobago/trunk:r1329690-1333384
Modified: myfaces/tobago/branches/tobago-tree-table/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/pom.xml?rev=1333387&r1=1333386&r2=1333387&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/pom.xml (original)
+++ myfaces/tobago/branches/tobago-tree-table/pom.xml Thu May 3 09:46:57 2012
@@ -825,7 +825,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>2.3.2</version>
+ <version>2.4</version>
<configuration>
<source>${maven.compile.source}</source>
<target>${maven.compile.target}</target>
Modified: myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/context/TobagoBundle.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/context/TobagoBundle.java?rev=1333387&r1=1333386&r2=1333387&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/context/TobagoBundle.java (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/context/TobagoBundle.java Thu May 3 09:46:57 2012
@@ -51,7 +51,7 @@ public class TobagoBundle extends Resour
}
public Enumeration<String> getKeys() {
- return Collections.enumeration(Collections.EMPTY_LIST);
+ return Collections.enumeration(Collections.<String>emptyList());
}
public String getBundleName() {
Modified: myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/context/TobagoContext.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/context/TobagoContext.java?rev=1333387&r1=1333386&r2=1333387&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/context/TobagoContext.java (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/context/TobagoContext.java Thu May 3 09:46:57 2012
@@ -23,14 +23,22 @@ import org.apache.myfaces.tobago.util.Co
import javax.faces.context.FacesContext;
-/*
- * Date: 11.06.2008 16:17:03
- */
public class TobagoContext {
+ private static final TobagoResourceBundle RESOURCE_BUNDLE = new TobagoResourceBundle();
+ private static final TobagoMessageBundle MESSAGE_BUNDLE = new TobagoMessageBundle();
+
public Box getActionPosition() {
FacesContext facesContext = FacesContext.getCurrentInstance();
AbstractUIPage page = ComponentUtils.findPage(facesContext);
return page.getActionPosition();
}
+
+ public TobagoResourceBundle getResourceBundle() {
+ return RESOURCE_BUNDLE;
+ }
+
+ public TobagoMessageBundle getMessageBundle() {
+ return MESSAGE_BUNDLE;
+ }
}
Modified: myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIDate.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIDate.java?rev=1333387&r1=1333386&r2=1333387&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIDate.java (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIDate.java Thu May 3 09:46:57 2012
@@ -19,4 +19,7 @@ package org.apache.myfaces.tobago.intern
public abstract class AbstractUIDate extends AbstractUIInput {
+ public abstract boolean isDisabled();
+
+ public abstract boolean isReadonly();
}
Modified: myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIGridLayout.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIGridLayout.java?rev=1333387&r1=1333386&r2=1333387&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIGridLayout.java (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIGridLayout.java Thu May 3 09:46:57 2012
@@ -350,14 +350,12 @@ public abstract class AbstractUIGridLayo
position = position.add(LayoutUtils.getPaddingBegin(orientation, getLayoutContainer()));
position = position.add(getMarginBegin(orientation));
for (int k = 0; k < i; k++) {
- if (heads[k] == null || heads[k].getCurrent() == null) {
- LOG.warn("Head is null, should be debugged... i=" + i + " k=" + k + " grid=\n" + grid,
- new NullPointerException());
- } else {
- if (heads[k].isRendered() && heads[k].getCurrent().greaterThan(Measure.ZERO)) {
- position = position.add(heads[k].getCurrent());
- position = position.add(getSpacing(orientation));
- }
+ if (heads[k] != null
+ && heads[k].getCurrent() != null
+ && heads[k].isRendered()
+ && heads[k].getCurrent().greaterThan(Measure.ZERO)) {
+ position = position.add(heads[k].getCurrent());
+ position = position.add(getSpacing(orientation));
}
}
if (orientation == Orientation.HORIZONTAL) {
Modified: myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/DatePickerTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/DatePickerTagDeclaration.java?rev=1333387&r1=1333386&r2=1333387&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/DatePickerTagDeclaration.java (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/DatePickerTagDeclaration.java Thu May 3 09:46:57 2012
@@ -19,14 +19,14 @@ package org.apache.myfaces.tobago.intern
import org.apache.myfaces.tobago.apt.annotation.Tag;
import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
+import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
import org.apache.myfaces.tobago.component.RendererTypes;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasCurrentMarkup;
import org.apache.myfaces.tobago.internal.taglib.declaration.HasFor;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasIdBindingAndRendered;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasMarkup;
import org.apache.myfaces.tobago.internal.taglib.declaration.HasTabIndex;
-
-/*
- * Date: 30.05.2006
- * Time: 19:17:28
- */
+import org.apache.myfaces.tobago.internal.taglib.declaration.IsGridLayoutComponent;
/**
* Renders a date picker.
@@ -37,10 +37,34 @@ import org.apache.myfaces.tobago.interna
@Tag(name = "datePicker")
@UIComponentTag(
uiComponent = "org.apache.myfaces.tobago.component.UIDatePicker",
- uiComponentBaseClass = "org.apache.myfaces.tobago.component.UILink",
- generate = false,
+ uiComponentBaseClass = "org.apache.myfaces.tobago.internal.component.AbstractUIDatePicker",
componentType = "org.apache.myfaces.tobago.DatePicker",
rendererType = RendererTypes.DATE_PICKER,
allowedChildComponenents = "NONE")
-public interface DatePickerTagDeclaration extends HasFor, HasTabIndex {
+public interface DatePickerTagDeclaration
+ extends HasFor, HasTabIndex, HasIdBindingAndRendered, HasMarkup, HasCurrentMarkup, IsGridLayoutComponent {
+
+ @UIComponentTagAttribute()
+ void setLink(String link);
+
+ @UIComponentTagAttribute()
+ void setResource(String resource);
+
+ @UIComponentTagAttribute(type = "boolean", defaultValue = "false")
+ void setJsfResource(String jsfResource);
+
+ @UIComponentTagAttribute()
+ void setOnclick(String onclick);
+
+ @UIComponentTagAttribute()
+ void setTip(String tip);
+
+ @UIComponentTagAttribute()
+ void setImage(String image);
+
+ @UIComponentTagAttribute(type = "boolean", defaultValue = "false")
+ void setDisabled(String disabled);
+
+ @UIComponentTagAttribute(type = "java.lang.String[]")
+ void setRenderedPartially(String componentIds);
}
Modified: myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/LinkTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/LinkTagDeclaration.java?rev=1333387&r1=1333386&r2=1333387&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/LinkTagDeclaration.java (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/LinkTagDeclaration.java Thu May 3 09:46:57 2012
@@ -43,7 +43,7 @@ import org.apache.myfaces.tobago.interna
@BodyContentDescription(anyTagOf = "facestag")
@UIComponentTag(
uiComponent = "org.apache.myfaces.tobago.component.UILink",
- uiComponentBaseClass = "org.apache.myfaces.tobago.component.UICommand",
+ uiComponentBaseClass = "org.apache.myfaces.tobago.internal.component.AbstractUILink",
interfaces = "org.apache.myfaces.tobago.component.UILinkCommand",
rendererType = RendererTypes.LINK,
allowedChildComponenents = "NONE",
Modified: myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/HtmlWriterUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/HtmlWriterUtils.java?rev=1333387&r1=1333386&r2=1333387&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/HtmlWriterUtils.java (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/HtmlWriterUtils.java Thu May 3 09:46:57 2012
@@ -36,8 +36,8 @@ public final class HtmlWriterUtils {
CHARS_TO_ESCAPE['&'] = "&".toCharArray();
CHARS_TO_ESCAPE['<'] = "<".toCharArray();
CHARS_TO_ESCAPE['>'] = ">".toCharArray();
- CHARS_TO_ESCAPE['\n'] = " ".toCharArray();
- CHARS_TO_ESCAPE['\r'] = " ".toCharArray();
+ CHARS_TO_ESCAPE['\n'] = " ".toCharArray();
+ CHARS_TO_ESCAPE['\r'] = " ".toCharArray();
CHARS_TO_ESCAPE['\t'] = "	".toCharArray();
}
Modified: myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java?rev=1333387&r1=1333386&r2=1333387&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java Thu May 3 09:46:57 2012
@@ -295,7 +295,7 @@ public class ComponentUtils {
if (forValue == null) {
return component.getParent();
}
- return component.findComponent(forValue);
+ return ComponentUtils.findComponent(component, forValue);
}
/**
@@ -303,7 +303,9 @@ public class ComponentUtils {
* In case that the value is equals to "@auto" the children of the parent will be
* checked if they are a UIInput. The "id" of the first one will be used to reset the "for"
* attribute of the component.
+ * @deprecated
*/
+ @Deprecated
public static void evaluateAutoFor(UIComponent component) {
String forComponent = (String) component.getAttributes().get(Attributes.FOR);
if (LOG.isDebugEnabled()) {
@@ -311,16 +313,55 @@ public class ComponentUtils {
}
if ("@auto".equals(forComponent)) {
for (Object object : component.getParent().getChildren()) {
- UIComponent child = (UIComponent) object;
- if (child instanceof UIInput) {
- forComponent = child.getId();
- component.getAttributes().put(Attributes.FOR, forComponent);
+ if (setForToInput(component, (UIComponent) object, AbstractUIInput.class, false)) {
break;
}
}
}
}
+ /**
+ * Looks for the attribute "for" of the component.
+ * In case that the value is equals to "@auto" the children of the parent will be
+ * checked if they are of the type of the parameter clazz. The "id" of the first one will be used to reset the "for"
+ * attribute of the component.
+ */
+ public static void evaluateAutoFor(UIComponent component, Class<? extends UIComponent> clazz) {
+ String forComponent = (String) component.getAttributes().get(Attributes.FOR);
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("for = '" + forComponent + "'");
+ }
+ if ("@auto".equals(forComponent)) {
+ // parent
+ for (Object object : component.getParent().getChildren()) {
+ if (setForToInput(component, (UIComponent) object, clazz, component instanceof NamingContainer)) {
+ return;
+ }
+ }
+ // grand parent
+ for (Object object : component.getParent().getParent().getChildren()) {
+ if (setForToInput(component, (UIComponent) object, clazz, component.getParent() instanceof NamingContainer)) {
+ return;
+ }
+ }
+ }
+ }
+
+ private static boolean setForToInput(
+ UIComponent component, UIComponent child, Class<? extends UIComponent> clazz, boolean namingContainer) {
+ if (clazz.isAssignableFrom(child.getClass())) { // find the matching component
+ final String forComponent;
+ if (namingContainer) {
+ forComponent = ":::" + child.getId();
+ } else {
+ forComponent = child.getId();
+ }
+ component.getAttributes().put(Attributes.FOR, forComponent);
+ return true;
+ }
+ return false;
+ }
+
public static boolean isInActiveForm(UIComponent component) {
while (component != null) {
if (component instanceof AbstractUIForm) {
@@ -868,7 +909,7 @@ public class ComponentUtils {
if (renderer != null) {
if (component instanceof UISelectMany) {
final Object converted = renderer.getConvertedValue(facesContext, component, new String[]{stringValue});
- return converted instanceof List ? ((List)converted).get(0) : ((Object[]) converted)[0];
+ return converted instanceof List ? ((List) converted).get(0) : ((Object[]) converted)[0];
} else {
return renderer.getConvertedValue(facesContext, component, stringValue);
}
Modified: myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/clientConfig/ClientConfigController.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/clientConfig/ClientConfigController.java?rev=1333387&r1=1333386&r2=1333387&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/clientConfig/ClientConfigController.java (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/clientConfig/ClientConfigController.java Thu May 3 09:46:57 2012
@@ -100,7 +100,7 @@ public class ClientConfigController {
}
}
- return FacesContext.getCurrentInstance().getViewRoot().getViewId();
+ return null;
}
// ///////////////////////////////////////////// logic
Modified: myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tags/layout/overview.tag
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tags/layout/overview.tag?rev=1333387&r1=1333386&r2=1333387&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tags/layout/overview.tag (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tags/layout/overview.tag Thu May 3 09:46:57 2012
@@ -30,34 +30,36 @@
<f:facet name="menuBar">
<tc:menuBar>
- <tc:menu label="#{overviewBundle.menu_config}">
- <tc:menu label="#{overviewBundle.menu_themes}">
- <tx:menuRadio action="#{clientConfigController.submit}" value="#{clientConfigController.theme}">
- <f:selectItems value="#{clientConfigController.themeItems}"/>
- </tx:menuRadio>
+ <tc:form>
+ <tc:menu label="#{overviewBundle.menu_config}">
+ <tc:menu label="#{overviewBundle.menu_themes}">
+ <tx:menuRadio action="#{clientConfigController.submit}" value="#{clientConfigController.theme}">
+ <f:selectItems value="#{clientConfigController.themeItems}"/>
+ </tx:menuRadio>
+ </tc:menu>
+ <tc:menu label="#{overviewBundle.menu_locale}">
+ <tx:menuRadio action="#{clientConfigController.submit}" value="#{clientConfigController.locale}">
+ <f:selectItems value="#{clientConfigController.localeItems}"/>
+ </tx:menuRadio>
+ </tc:menu>
+ <%-- todo: may have something like immediate="true", but in this case, the value will not switched --%>
+ <tx:menuCheckbox action="#{clientConfigController.submit}"
+ label="#{overviewBundle.menu_debug}"
+ value="#{clientConfigController.debugMode}"/>
+ <tc:menuCommand action="#{demo.resetSession}" label="Reset"/>
</tc:menu>
- <tc:menu label="#{overviewBundle.menu_locale}">
- <tx:menuRadio action="#{clientConfigController.submit}" value="#{clientConfigController.locale}">
- <f:selectItems value="#{clientConfigController.localeItems}"/>
- </tx:menuRadio>
+
+ <tc:menu label="#{overviewBundle.menu_help}">
+ <tc:menuCommand
+ onclick="alert('#{overviewBundle.pageTitle}' + String.fromCharCode(10) + '#{info.version}' + String.fromCharCode(10) + '#{overviewBundle.tobago_url}' + String.fromCharCode(10))"
+ label="#{overviewBundle.menu_about}"/>
+ <tc:menuItem link="http://myfaces.apache.org/tobago" label="Tobago in the Web"/>
+ <tc:menuCommand onclick="LOG.show();" label="#{overviewBundle.menu_showLog}"
+ rendered="#{clientConfigController.debugMode}"/>
+ <tc:menuCommand action="server-info" immediate="true"
+ label="Server Info" disabled="#{! info.enabled}"/>
</tc:menu>
- <%-- todo: may have something like immediate="true", but in this case, the value will not switched --%>
- <tx:menuCheckbox action="#{clientConfigController.submit}"
- label="#{overviewBundle.menu_debug}"
- value="#{clientConfigController.debugMode}"/>
- <tc:menuCommand action="#{demo.resetSession}" label="Reset"/>
- </tc:menu>
-
- <tc:menu label="#{overviewBundle.menu_help}">
- <tc:menuCommand
- onclick="alert('#{overviewBundle.pageTitle}' + String.fromCharCode(10) + '#{info.version}' + String.fromCharCode(10) + '#{overviewBundle.tobago_url}' + String.fromCharCode(10))"
- label="#{overviewBundle.menu_about}"/>
- <tc:menuItem link="http://myfaces.apache.org/tobago" label="Tobago in the Web"/>
- <tc:menuCommand onclick="LOG.show();" label="#{overviewBundle.menu_showLog}"
- rendered="#{clientConfigController.debugMode}"/>
- <tc:menuCommand action="server-info" immediate="true"
- label="Server Info" disabled="#{! info.enabled}"/>
- </tc:menu>
+ </tc:form>
</tc:menuBar>
</f:facet>
Modified: myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tags/layout/overview.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tags/layout/overview.xhtml?rev=1333387&r1=1333386&r2=1333387&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tags/layout/overview.xhtml (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tags/layout/overview.xhtml Thu May 3 09:46:57 2012
@@ -29,36 +29,38 @@
<f:facet name="menuBar">
<tc:menuBar>
- <tc:menu label="#{overviewBundle.menu_config}">
- <tc:menu label="#{overviewBundle.menu_themes}">
- <tx:menuRadio action="#{clientConfigController.submit}" value="#{clientConfigController.theme}">
- <f:selectItems value="#{clientConfigController.themeItems}"/>
- </tx:menuRadio>
+ <tc:form>
+ <tc:menu label="#{overviewBundle.menu_config}">
+ <tc:menu label="#{overviewBundle.menu_themes}">
+ <tx:menuRadio action="#{clientConfigController.submit}" value="#{clientConfigController.theme}">
+ <f:selectItems value="#{clientConfigController.themeItems}"/>
+ </tx:menuRadio>
+ </tc:menu>
+ <tc:menu label="#{overviewBundle.menu_locale}">
+ <tx:menuRadio action="#{clientConfigController.submit}" value="#{clientConfigController.locale}">
+ <f:selectItems value="#{clientConfigController.localeItems}"/>
+ </tx:menuRadio>
+ </tc:menu>
+ <!-- todo: may have something like immediate="true", but in this case, the value will not switched -->
+ <tx:menuCheckbox action="#{clientConfigController.submit}"
+ label="#{overviewBundle.menu_debug}"
+ value="#{clientConfigController.debugMode}"/>
+ <tc:menuCommand action="#{demo.resetSession}" label="Reset"/>
</tc:menu>
- <tc:menu label="#{overviewBundle.menu_locale}">
- <tx:menuRadio action="#{clientConfigController.submit}" value="#{clientConfigController.locale}">
- <f:selectItems value="#{clientConfigController.localeItems}"/>
- </tx:menuRadio>
+
+ <tc:menu label="#{overviewBundle.menu_help}">
+ <tc:menuCommand
+ onclick="alert('#{overviewBundle.pageTitle}' + String.fromCharCode(10) + '#{info.version}' + String.fromCharCode(10) + '#{overviewBundle.tobago_url}' + String.fromCharCode(10))"
+ label="#{overviewBundle.menu_about}"/>
+ <tc:menuItem link="http://myfaces.apache.org/tobago" label="Tobago in the Web"/>
+ <tc:menuCommand onclick="LOG.show();"
+ label="#{overviewBundle.menu_showLog}"
+ rendered="#{clientConfigController.debugMode}"/>
+ <tc:menuCommand action="server-info" immediate="true"
+ label="Server Info"
+ disabled="#{! info.enabled}"/>
</tc:menu>
- <!-- todo: may have something like immediate="true", but in this case, the value will not switched -->
- <tx:menuCheckbox action="#{clientConfigController.submit}"
- label="#{overviewBundle.menu_debug}"
- value="#{clientConfigController.debugMode}"/>
- <tc:menuCommand action="#{demo.resetSession}" label="Reset"/>
- </tc:menu>
-
- <tc:menu label="#{overviewBundle.menu_help}">
- <tc:menuCommand
- onclick="alert('#{overviewBundle.pageTitle}' + String.fromCharCode(10) + '#{info.version}' + String.fromCharCode(10) + '#{overviewBundle.tobago_url}' + String.fromCharCode(10))"
- label="#{overviewBundle.menu_about}"/>
- <tc:menuItem link="http://myfaces.apache.org/tobago" label="Tobago in the Web"/>
- <tc:menuCommand onclick="LOG.show();"
- label="#{overviewBundle.menu_showLog}"
- rendered="#{clientConfigController.debugMode}"/>
- <tc:menuCommand action="server-info" immediate="true"
- label="Server Info"
- disabled="#{! info.enabled}"/>
- </tc:menu>
+ </tc:form>
</tc:menuBar>
</f:facet>
Modified: myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/SelectManyListboxBean.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/SelectManyListboxBean.java?rev=1333387&r1=1333386&r2=1333387&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/SelectManyListboxBean.java (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/SelectManyListboxBean.java Thu May 3 09:46:57 2012
@@ -1,5 +1,22 @@
package org.apache.myfaces.tobago.example.test;
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
import java.util.Collection;
import java.util.List;
import java.util.Set;
Modified: myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/main/webapp/tc/date/date.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/main/webapp/tc/date/date.xhtml?rev=1333387&r1=1333386&r2=1333387&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/main/webapp/tc/date/date.xhtml (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/main/webapp/tc/date/date.xhtml Thu May 3 09:46:57 2012
@@ -31,51 +31,51 @@
<tc:date/>
<tc:date>
- <f:convertDateTime type="date" pattern="HH:mm:ss"/>
+ <f:convertDateTime type="date" pattern="dd.MM.yyyy HH:mm:ss"/>
</tc:date>
<tc:in value="for comparison only"/>
<tc:date readonly="true"/>
<tc:date readonly="true">
- <f:convertDateTime type="date" pattern="HH:mm:ss"/>
+ <f:convertDateTime type="date" pattern="dd.MM.yyyy HH:mm:ss"/>
</tc:date>
<tc:in value="for comparison only" readonly="true"/>
<tc:date disabled="true"/>
<tc:date disabled="true">
- <f:convertDateTime type="date" pattern="HH:mm:ss"/>
+ <f:convertDateTime type="date" pattern="dd.MM.yyyy HH:mm:ss"/>
</tc:date>
<tc:in value="for comparison only" disabled="true"/>
<tc:date markup="error"/>
<tc:date markup="error">
- <f:convertDateTime type="date" pattern="HH:mm:ss"/>
+ <f:convertDateTime type="date" pattern="dd.MM.yyyy HH:mm:ss"/>
</tc:date>
<tc:in value="for comparison only" markup="error"/>
- <tx:date label="Label"/>
- <tx:date label="Label">
- <f:convertDateTime type="date" pattern="HH:mm:ss"/>
+ <tx:date label="Date"/>
+ <tx:date label="Date/Time">
+ <f:convertDateTime type="date" pattern="dd.MM.yyyy HH:mm:ss"/>
</tx:date>
- <tx:in label="Label" value="for comparison only"/>
+ <tx:in label="In" value="for comparison only"/>
- <tx:date label="Label" readonly="true"/>
- <tx:date label="Label" readonly="true">
- <f:convertDateTime type="date" pattern="HH:mm:ss"/>
+ <tx:date label="Date" readonly="true"/>
+ <tx:date label="Date/Time" readonly="true">
+ <f:convertDateTime type="date" pattern="dd.MM.yyyy HH:mm:ss"/>
</tx:date>
- <tx:in label="Label" value="for comparison only" readonly="true"/>
+ <tx:in label="In" value="for comparison only" readonly="true"/>
- <tx:date label="Label" disabled="true"/>
- <tx:date label="Label" disabled="true">
- <f:convertDateTime type="date" pattern="HH:mm:ss"/>
+ <tx:date label="Date" disabled="true"/>
+ <tx:date label="Date/Time" disabled="true">
+ <f:convertDateTime type="date" pattern="dd.MM.yyyy HH:mm:ss"/>
</tx:date>
- <tx:in label="Label" value="for comparison only" disabled="true"/>
+ <tx:in label="In" value="for comparison only" disabled="true"/>
- <tx:date label="Label" markup="error"/>
- <tx:date label="Label" markup="error">
- <f:convertDateTime type="date" pattern="HH:mm:ss"/>
+ <tx:date label="Date" markup="error"/>
+ <tx:date label="Date/Time" markup="error">
+ <f:convertDateTime type="date" pattern="dd.MM.yyyy HH:mm:ss"/>
</tx:date>
- <tx:in label="Label" value="for comparison only" markup="error"/>
+ <tx:in label="In" value="for comparison only" markup="error"/>
<tc:panel/>
<tc:panel/>
Modified: myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/tc/popup/BugTobago1103SeleniumTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/tc/popup/BugTobago1103SeleniumTest.java?rev=1333387&r1=1333386&r2=1333387&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/tc/popup/BugTobago1103SeleniumTest.java (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/tc/popup/BugTobago1103SeleniumTest.java Thu May 3 09:46:57 2012
@@ -37,6 +37,8 @@ public class BugTobago1103SeleniumTest e
// load page
open("/tc/popup/popup-bug-tobago-1103.");
+ getSelenium().waitForCondition(
+ "selenium.browserbot.getCurrentWindow().document.getElementById('page:open-0') != null", "5000");
// click on open 1st popup
getSelenium().click("page:open-0");
Modified: myfaces/tobago/branches/tobago-tree-table/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/DateExtensionHandler.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/DateExtensionHandler.java?rev=1333387&r1=1333386&r2=1333387&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/DateExtensionHandler.java (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/DateExtensionHandler.java Thu May 3 09:46:57 2012
@@ -25,6 +25,7 @@ import org.apache.myfaces.tobago.compone
import org.apache.myfaces.tobago.component.RendererTypes;
import org.apache.myfaces.tobago.component.UIDate;
import org.apache.myfaces.tobago.component.UIDatePicker;
+import org.apache.myfaces.tobago.component.UIForm;
import javax.faces.application.Application;
import javax.faces.component.UIComponent;
@@ -51,6 +52,12 @@ public class DateExtensionHandler extend
super.onComponentPopulated(faceletContext, panel, parent);
if (panel.getChildCount() == 2) {
Application application = faceletContext.getFacesContext().getApplication();
+ UIViewRoot root = ComponentSupport.getViewRoot(faceletContext, parent);
+
+ UIForm form = (UIForm) application.createComponent(UIForm.COMPONENT_TYPE);
+ form.setId(root.createUniqueId());
+ panel.getChildren().add(form);
+
UIDatePicker picker = (UIDatePicker) application.createComponent(UIDatePicker.COMPONENT_TYPE);
picker.setRendererType(RendererTypes.DATE_PICKER);
picker.setFor("@auto");
@@ -58,7 +65,7 @@ public class DateExtensionHandler extend
if (pickerIdAttribute != null) {
id = pickerIdAttribute.getValue(faceletContext);
} else {
- UIViewRoot root = ComponentSupport.getViewRoot(faceletContext, parent);
+ root = ComponentSupport.getViewRoot(faceletContext, parent);
id = root.createUniqueId();
}
picker.setId(id);
@@ -66,7 +73,7 @@ public class DateExtensionHandler extend
picker.getAttributes().put(OnComponentCreated.MARKER, Boolean.TRUE);
picker.onComponentCreated(faceletContext.getFacesContext(), panel);
}
- panel.getChildren().add(picker);
+ form.getChildren().add(picker);
}
}
Modified: myfaces/tobago/branches/tobago-tree-table/tobago-jsf-compat/src/main/java/org/apache/myfaces/tobago/compat/FacesUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-jsf-compat/src/main/java/org/apache/myfaces/tobago/compat/FacesUtils.java?rev=1333387&r1=1333386&r2=1333387&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-jsf-compat/src/main/java/org/apache/myfaces/tobago/compat/FacesUtils.java (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-jsf-compat/src/main/java/org/apache/myfaces/tobago/compat/FacesUtils.java Thu May 3 09:46:57 2012
@@ -248,6 +248,10 @@ public class FacesUtils {
}
}
+ public static void setBindingOrExpression(UIComponent component, String name, String valueBindingOrExpression) {
+ setBindingOrExpression(component, name, createExpressionOrBinding(valueBindingOrExpression));
+ }
+
public static void addBindingOrExpressionTabChangeListener(TabChangeSource source, String type,
Object bindingOrExpression) {
if (USE_BINDING) {
Modified: myfaces/tobago/branches/tobago-tree-table/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/branches/tobago-tree-table/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/DatePickerRenderer.java?rev=1333387&r1=1333386&r2=1333387&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/DatePickerRenderer.java (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/DatePickerRenderer.java Thu May 3 09:46:57 2012
@@ -27,16 +27,13 @@ import org.apache.myfaces.tobago.compone
import org.apache.myfaces.tobago.component.UIDate;
import org.apache.myfaces.tobago.component.UIDatePicker;
import org.apache.myfaces.tobago.component.UIGridLayout;
-import org.apache.myfaces.tobago.component.UIImage;
import org.apache.myfaces.tobago.component.UIPanel;
import org.apache.myfaces.tobago.component.UIPopup;
import org.apache.myfaces.tobago.component.UITime;
-import org.apache.myfaces.tobago.context.ResourceManagerUtils;
import org.apache.myfaces.tobago.event.PopupActionListener;
import org.apache.myfaces.tobago.internal.util.DateFormatUtils;
import org.apache.myfaces.tobago.internal.util.FacesContextUtils;
import org.apache.myfaces.tobago.layout.Measure;
-import org.apache.myfaces.tobago.renderkit.html.StyleClasses;
import org.apache.myfaces.tobago.util.ComponentUtils;
import org.apache.myfaces.tobago.util.CreateComponentUtils;
import org.slf4j.Logger;
@@ -77,16 +74,13 @@ public class DatePickerRenderer extends
popup.setRendered(false);
popup.onComponentPopulated(facesContext, parent);
- FacesUtils.setBindingOrExpression(
- popup, Attributes.LEFT, FacesUtils.createExpressionOrBinding("#{tobagoContext.actionPosition.right.pixel + 5}"));
- FacesUtils.setBindingOrExpression(
- popup, Attributes.TOP, FacesUtils.createExpressionOrBinding("#{tobagoContext.actionPosition.top.pixel}"));
+ FacesUtils.setBindingOrExpression(popup, Attributes.LEFT, "#{tobagoContext.actionPosition.right.pixel + 5}");
+ FacesUtils.setBindingOrExpression(popup, Attributes.TOP, "#{tobagoContext.actionPosition.top.pixel}");
final UIBox box = (UIBox) CreateComponentUtils.createComponent(
facesContext, UIBox.COMPONENT_TYPE, RendererTypes.BOX, "box");
popup.getChildren().add(box);
- // TODO: set string resources in renderer
- box.setLabel(ResourceManagerUtils.getPropertyNotNull(facesContext, "tobago", "datePickerTitle"));
+ FacesUtils.setBindingOrExpression(box, Attributes.LABEL, "#{tobagoContext.resourceBundle.datePickerTitle}");
final UIGridLayout layoutOfBox = (UIGridLayout) CreateComponentUtils.createComponent(
facesContext, UIGridLayout.COMPONENT_TYPE, RendererTypes.GRID_LAYOUT, "layout");
box.getFacets().put(Facets.LAYOUT, layoutOfBox);
@@ -139,29 +133,19 @@ public class DatePickerRenderer extends
final UIButton okButton = (UIButton) CreateComponentUtils.createComponent(
facesContext, UIButton.COMPONENT_TYPE, RendererTypes.BUTTON, "ok");
buttonPanel.getChildren().add(okButton);
- okButton.setLabel(ResourceManagerUtils.getPropertyNotNull(facesContext, "tobago", "datePickerOk"));
+ FacesUtils.setBindingOrExpression(okButton, Attributes.LABEL, "#{tobagoContext.resourceBundle.datePickerOk}");
okButton.setOnclick("writeIntoField2(this);");
okButton.getAttributes().put(Attributes.POPUP_CLOSE, "afterSubmit");
final UIButton cancelButton = (UIButton) CreateComponentUtils.createComponent(
facesContext, UIButton.COMPONENT_TYPE, RendererTypes.BUTTON, "cancel");
buttonPanel.getChildren().add(cancelButton);
- cancelButton.setLabel(ResourceManagerUtils.getPropertyNotNull(facesContext, "tobago", "datePickerCancel"));
- cancelButton.setOnclick("writeIntoField2(this);");
+ FacesUtils.setBindingOrExpression(cancelButton, Attributes.LABEL, "#{tobagoContext.resourceBundle.datePickerCancel}");
cancelButton.getAttributes().put(Attributes.POPUP_CLOSE, "immediate");
buttonPanel.onComponentPopulated(facesContext, parent);
- // create image
- // check the id: its might be better not calling createUniqueId
- final String imageId = linkId != null ? linkId + "image" : facesContext.getViewRoot().createUniqueId();
- final UIImage image = (UIImage) CreateComponentUtils.createComponent(
- facesContext, UIImage.COMPONENT_TYPE, RendererTypes.IMAGE, imageId);
- image.setRendered(true);
- image.setValue("image/date.gif");
- image.setAlt(""); //TODO: i18n (write a text)
- StyleClasses.ensureStyleClasses(image).addFullQualifiedClass("tobago-datePicker-icon");
- picker.getChildren().add(image);
+ picker.setImage("image/date.gif");
}
@Override
@@ -183,16 +167,15 @@ public class DatePickerRenderer extends
UIDatePicker picker = (UIDatePicker) component;
UIDate dateInput = (UIDate) picker.getForComponent();
if (dateInput == null) {
- LOG.error("No required UIDate component found.");
+ LOG.error("The required UIDate component wasn't found for component id='" + component.getId());
return;
}
+ // this can't be done in "onComponentPopulated()" of the picker, it seems to be to early
if (FacesUtils.hasValueBindingOrValueExpression(dateInput, Attributes.READONLY)) {
- FacesUtils.copyValueBindingOrValueExpression(picker, Attributes.DISABLED,
- dateInput, Attributes.READONLY);
+ FacesUtils.copyValueBindingOrValueExpression(dateInput, Attributes.READONLY, picker, Attributes.DISABLED);
} else {
if (FacesUtils.hasValueBindingOrValueExpression(dateInput, Attributes.DISABLED)) {
- FacesUtils.copyValueBindingOrValueExpression(picker, Attributes.DISABLED,
- dateInput, Attributes.DISABLED);
+ FacesUtils.copyValueBindingOrValueExpression(dateInput, Attributes.DISABLED, picker, Attributes.DISABLED);
} else {
picker.setDisabled(dateInput.isReadonly() || dateInput.isDisabled());
}
@@ -247,7 +230,7 @@ public class DatePickerRenderer extends
if (dateInput != null) {
super.encodeEnd(facesContext, component);
} else {
- LOG.error("No required UIDate component found.");
+ LOG.error("The required UIDate component wasn't found for component id='" + component.getId());
}
}
}
Modified: myfaces/tobago/branches/tobago-tree-table/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/LabelRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/LabelRenderer.java?rev=1333387&r1=1333386&r2=1333387&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/LabelRenderer.java (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/LabelRenderer.java Thu May 3 09:46:57 2012
@@ -19,6 +19,7 @@ package org.apache.myfaces.tobago.render
import org.apache.myfaces.tobago.component.UILabel;
import org.apache.myfaces.tobago.context.Markup;
+import org.apache.myfaces.tobago.internal.component.AbstractUIDate;
import org.apache.myfaces.tobago.internal.util.AccessKeyMap;
import org.apache.myfaces.tobago.renderkit.LabelWithAccessKey;
import org.apache.myfaces.tobago.renderkit.LayoutComponentRendererBase;
@@ -44,7 +45,7 @@ public class LabelRenderer extends Layou
public void prepareRender(FacesContext facesContext, UIComponent component) throws IOException {
super.prepareRender(facesContext, component);
- ComponentUtils.evaluateAutoFor(component);
+ ComponentUtils.evaluateAutoFor(component, AbstractUIDate.class);
// adding the markups from the corresponding input component
final UILabel label = (UILabel) component;
Modified: myfaces/tobago/branches/tobago-tree-table/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/LinkRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/LinkRenderer.java?rev=1333387&r1=1333386&r2=1333387&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/LinkRenderer.java (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/LinkRenderer.java Thu May 3 09:46:57 2012
@@ -17,16 +17,10 @@ package org.apache.myfaces.tobago.render
* limitations under the License.
*/
-/*
- * Created 07.02.2003 16:00:00.
- * $Id$
- */
-
-import org.apache.myfaces.tobago.component.UILink;
import org.apache.myfaces.tobago.config.Configurable;
import org.apache.myfaces.tobago.context.ResourceManagerUtils;
+import org.apache.myfaces.tobago.internal.component.AbstractUILink;
import org.apache.myfaces.tobago.internal.util.AccessKeyMap;
-import org.apache.myfaces.tobago.internal.util.Deprecation;
import org.apache.myfaces.tobago.layout.Measure;
import org.apache.myfaces.tobago.renderkit.CommandRendererBase;
import org.apache.myfaces.tobago.renderkit.LabelWithAccessKey;
@@ -52,7 +46,7 @@ public class LinkRenderer extends Comman
public void encodeBegin(FacesContext facesContext, UIComponent component) throws IOException {
- UILink link = (UILink) component;
+ AbstractUILink link = (AbstractUILink) component;
String clientId = link.getClientId(facesContext);
CommandRendererHelper helper = new CommandRendererHelper(facesContext, link, CommandRendererHelper.Tag.ANCHOR);
String href = helper.getHref();
@@ -71,13 +65,7 @@ public class LinkRenderer extends Comman
if (helper.getTarget() != null) {
writer.writeAttribute(HtmlAttributes.TARGET, helper.getTarget(), true);
}
- Integer tabIndex = null;
- if (link instanceof UILink) {
- tabIndex = ((UILink) link).getTabIndex();
- } else {
- Deprecation.LOG.warn("LinkRenderer should only render UILink but got " + link.getClass().getName()
- + " id=" + link.getClientId(facesContext));
- }
+ Integer tabIndex = link.getTabIndex();
if (tabIndex != null) {
writer.writeAttribute(HtmlAttributes.TABINDEX, tabIndex);
}
@@ -129,8 +117,7 @@ public class LinkRenderer extends Comman
}
public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {
-
- UILink link = (UILink) component;
+ AbstractUILink link = (AbstractUILink) component;
ResponseWriter writer = facesContext.getResponseWriter();
if (link.isDisabled()) {
writer.endElement(HtmlElements.SPAN);
@@ -141,7 +128,7 @@ public class LinkRenderer extends Comman
@Override
public Measure getPreferredWidth(FacesContext facesContext, Configurable component) {
- UILink link = (UILink) component;
+ AbstractUILink link = (AbstractUILink) component;
LabelWithAccessKey label = new LabelWithAccessKey(link);
return RenderUtils.calculateStringWidth(facesContext, link, label.getText());
}
Modified: myfaces/tobago/branches/tobago-tree-table/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MessagesRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MessagesRenderer.java?rev=1333387&r1=1333386&r2=1333387&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MessagesRenderer.java (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MessagesRenderer.java Thu May 3 09:46:57 2012
@@ -147,6 +147,7 @@ public class MessagesRenderer extends La
popup.setTop(Measure.valueOf(100));
popup.setRendered(true);
popup.setActivated(true);
+ popup.onComponentPopulated(facesContext, messages);
FacesContextUtils.addPopup(facesContext, popup);
Map<String, Object> okButtonAttributes = popup.getAttributes();
@@ -163,7 +164,7 @@ public class MessagesRenderer extends La
facesContext, UIGridLayout.COMPONENT_TYPE, RendererTypes.GRID_LAYOUT, "layout");
box.getFacets().put(Facets.LAYOUT, layout);
layout.getAttributes().put(Attributes.ROWS, "*;auto");
- layout.getAttributes().put(Attributes.MARGIN, "10");
+ layout.getAttributes().put(Attributes.MARGIN, Measure.valueOf(10));
final UICell scrollPanel = (UICell)
CreateComponentUtils.createComponent(facesContext, UICell.COMPONENT_TYPE, "Cell", "messagePanel");
@@ -171,6 +172,7 @@ public class MessagesRenderer extends La
messages.getParent().getChildren().remove(messages);
messages.setConfirmation(false);
+ scrollPanel.onComponentPopulated(facesContext, messages);
scrollPanel.setScrollbars("auto");
scrollPanel.getChildren().add(messages);
@@ -187,6 +189,7 @@ public class MessagesRenderer extends La
final UICell space = (UICell)
CreateComponentUtils.createComponent(facesContext, UICell.COMPONENT_TYPE, "Cell", "space");
buttonPanel.getChildren().add(space);
+ space.onComponentPopulated(facesContext, messages);
final UICommand okButton = (UICommand) CreateComponentUtils.createComponent(
facesContext, UIButton.COMPONENT_TYPE, RendererTypes.BUTTON, CLOSE_POPUP);
Modified: myfaces/tobago/branches/tobago-tree-table/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/OutRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/OutRenderer.java?rev=1333387&r1=1333386&r2=1333387&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/OutRenderer.java (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/OutRenderer.java Thu May 3 09:46:57 2012
@@ -59,7 +59,7 @@ public class OutRenderer extends LayoutC
HtmlRendererUtils.renderTip(out, writer);
}
if (escape) {
- StringTokenizer tokenizer = new StringTokenizer(text, "\n\r");
+ StringTokenizer tokenizer = new StringTokenizer(text, "\r\n");
while (tokenizer.hasMoreTokens()) {
String token = tokenizer.nextToken();
writer.writeText(token);
Modified: myfaces/tobago/branches/tobago-tree-table/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeSelectRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeSelectRenderer.java?rev=1333387&r1=1333386&r2=1333387&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeSelectRenderer.java (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeSelectRenderer.java Thu May 3 09:46:57 2012
@@ -46,13 +46,15 @@ public class TreeSelectRenderer extends
writer.startElement(HtmlElements.SPAN, null);
writer.writeClassAttribute(Classes.create(select));
- writer.startElement(HtmlElements.INPUT, null);
- writer.writeAttribute(HtmlAttributes.TYPE, HtmlInputTypes.CHECKBOX, false);
- writer.writeAttribute(HtmlAttributes.VALUE, "true", false);
- writer.writeNameAttribute(id);
- writer.writeIdAttribute(id);
- writer.writeAttribute(HtmlAttributes.CHECKED, checked);
- writer.endElement(HtmlElements.INPUT);
+ if (select.isShowCheckbox()) {
+ writer.startElement(HtmlElements.INPUT, null);
+ writer.writeAttribute(HtmlAttributes.TYPE, HtmlInputTypes.CHECKBOX, false);
+ writer.writeAttribute(HtmlAttributes.VALUE, "true", false);
+ writer.writeNameAttribute(id);
+ writer.writeIdAttribute(id);
+ writer.writeAttribute(HtmlAttributes.CHECKED, checked);
+ writer.endElement(HtmlElements.INPUT);
+ }
// label
final String label = select.getLabel();
|