JBoss Rich Faces SVN: r11400 - in trunk/ui/combobox/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: dmorozov
Date: 2008-11-26 10:39:00 -0500 (Wed, 26 Nov 2008)
New Revision: 11400
Modified:
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
trunk/ui/combobox/src/main/templates/combobox.jspx
Log:
https://jira.jboss.org/jira/browse/RF-5056
Modified: trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
===================================================================
--- trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2008-11-26 15:38:10 UTC (rev 11399)
+++ trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2008-11-26 15:39:00 UTC (rev 11400)
@@ -36,6 +36,9 @@
if (item) {
this.comboList.doSelectItem(item);
}
+ // RF-5056
+ this.comboValue.value = value;
+
} else {
if (this.defaultMessage) {
this.applyDefaultText();
Modified: trunk/ui/combobox/src/main/templates/combobox.jspx
===================================================================
--- trunk/ui/combobox/src/main/templates/combobox.jspx 2008-11-26 15:38:10 UTC (rev 11399)
+++ trunk/ui/combobox/src/main/templates/combobox.jspx 2008-11-26 15:39:00 UTC (rev 11400)
@@ -92,8 +92,8 @@
value = getConvertedStringValue(context, component,value);
if ("".equals(value)) {
valueStyle = "rich-combobox-font-disabled";
- value = defaultLabel;
- }
+ //value = defaultLabel;
+ }
variables.setVariable("value", value);
String convertedValue = encodeValue((String)value);
variables.setVariable("convertedValue", convertedValue);
@@ -265,7 +265,7 @@
variables.setVariable("hiddenValue", value);
]]>
</jsp:scriptlet>
- <input id="#{clientId}comboboxValue" name="#{clientId}" type="hidden" value="#{hiddenValue}"/>
+ <input id="#{clientId}comboboxValue" name="#{clientId}" type="hidden"/>
</div>
16 years
JBoss Rich Faces SVN: r11399 - in trunk/test-applications/seamApp/web/src/main: webapp/Editor and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2008-11-26 10:38:10 -0500 (Wed, 26 Nov 2008)
New Revision: 11399
Modified:
trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/editor/Editor.java
trunk/test-applications/seamApp/web/src/main/webapp/Editor/Editor.xhtml
trunk/test-applications/seamApp/web/src/main/webapp/Editor/EditorProperty.xhtml
Log:
changes in editor config
Modified: trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/editor/Editor.java
===================================================================
--- trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/editor/Editor.java 2008-11-26 15:32:01 UTC (rev 11398)
+++ trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/editor/Editor.java 2008-11-26 15:38:10 UTC (rev 11399)
@@ -32,8 +32,8 @@
private String tabindex;
private String dialogType;
private String language;
+ private boolean configuration;
// private String skin;
- private String configuration;
public Editor() {
value = "Collaboration-oriented websites require a human-friendly markup language for easy entry of formatted text in forum posts, wiki pages, blogs, comments, etc. Seam provides the <s:formattedText/> control for display of formatted text that conforms to the Seam Text language. Seam Text is implemented using an ANTLR-based parser. You don't need to know anything about ANTLR to use it, however.";
@@ -51,10 +51,21 @@
dialogType = "window";
language = "en";
// skin = "default";
- configuration = "";
+ configuration = false;
}
-
+
/*
+ * attach config file to editor
+ */
+ public void useConfigFile(ValueChangeEvent e) {
+ if (!configuration) {
+ htmlEditor.setConfiguration("editorconfig");
+ } else {
+ htmlEditor.setConfiguration(null);
+ }
+ }
+
+ /*
* Custom valueChangeListener
*/
public void valueChangeListener(ValueChangeEvent e) {
@@ -242,11 +253,11 @@
this.language = language;
}
- public String getConfiguration() {
- return (configuration == null)?"":configuration;
+ public boolean getConfiguration() {
+ return configuration;
}
- public void setConfiguration(String configuration) {
+ public void setConfiguration(boolean configuration) {
this.configuration = configuration;
}
Modified: trunk/test-applications/seamApp/web/src/main/webapp/Editor/Editor.xhtml
===================================================================
--- trunk/test-applications/seamApp/web/src/main/webapp/Editor/Editor.xhtml 2008-11-26 15:32:01 UTC (rev 11398)
+++ trunk/test-applications/seamApp/web/src/main/webapp/Editor/Editor.xhtml 2008-11-26 15:38:10 UTC (rev 11399)
@@ -19,8 +19,7 @@
valueChangeListener="#{editor.valueChangeListener}"
viewMode="#{editor.viewMode}" readonly="#{editor.readonly}"
tabindex="#{editor.tabindex}" dialogType="#{editor.dialogType}"
- language="#{editor.language}" styleClass="EditorStyleClass"
- configuration="#{editor.configuration}">
+ language="#{editor.language}" styleClass="EditorStyleClass" >
<f:param name="theme_advanced_resizing" value="true" />
<f:param name="theme_advanced_statusbar_location" value="top" />
Modified: trunk/test-applications/seamApp/web/src/main/webapp/Editor/EditorProperty.xhtml
===================================================================
--- trunk/test-applications/seamApp/web/src/main/webapp/Editor/EditorProperty.xhtml 2008-11-26 15:32:01 UTC (rev 11398)
+++ trunk/test-applications/seamApp/web/src/main/webapp/Editor/EditorProperty.xhtml 2008-11-26 15:38:10 UTC (rev 11399)
@@ -68,10 +68,8 @@
</h:selectOneRadio>
<h:outputText value="use configuration file: "></h:outputText>
- <h:selectOneRadio value="#{editor.configuration}" onchange="submit();">
- <f:selectItem itemValue="" itemLabel="do not use" />
- <f:selectItem itemValue="editorconfig" itemLabel="use editorconfig.properties" />
- </h:selectOneRadio>
+ <h:selectBooleanCheckbox value="#{editor.configuration}"
+ onchange="submit();" valueChangeListener="#{editor.useConfigFile}" />
</h:panelGrid>
<h:commandButton value="add test" action="#{editor.addHtmlEditor}"></h:commandButton>
</f:subview>
\ No newline at end of file
16 years
JBoss Rich Faces SVN: r11398 - in trunk/ui/core/src/test: resources/org/ajax4jsf/component and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-11-26 10:32:01 -0500 (Wed, 26 Nov 2008)
New Revision: 11398
Added:
trunk/ui/core/src/test/java/org/ajax4jsf/component/LoadResourceComponentTest.java
trunk/ui/core/src/test/resources/org/ajax4jsf/component/component.js
trunk/ui/core/src/test/resources/org/ajax4jsf/component/component.xcss
trunk/ui/core/src/test/resources/org/ajax4jsf/component/user.js
trunk/ui/core/src/test/resources/org/ajax4jsf/component/user.xcss
Log:
https://jira.jboss.org/jira/browse/RF-4714
Added: trunk/ui/core/src/test/java/org/ajax4jsf/component/LoadResourceComponentTest.java
===================================================================
--- trunk/ui/core/src/test/java/org/ajax4jsf/component/LoadResourceComponentTest.java (rev 0)
+++ trunk/ui/core/src/test/java/org/ajax4jsf/component/LoadResourceComponentTest.java 2008-11-26 15:32:01 UTC (rev 11398)
@@ -0,0 +1,364 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.component;
+
+import static org.ajax4jsf.resource.InternetResource.RESOURCE_URI_PREFIX;
+
+import java.io.IOException;
+import java.util.Collections;
+import java.util.List;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIComponentBase;
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.javascript.AjaxScript;
+import org.ajax4jsf.renderkit.HeaderResourceProducer2;
+import org.ajax4jsf.renderkit.ProducerContext;
+import org.ajax4jsf.renderkit.RendererBase;
+import org.ajax4jsf.renderkit.RendererUtils.HTML;
+import org.ajax4jsf.resource.InternetResource;
+import org.ajax4jsf.resource.InternetResourceBuilder;
+import org.ajax4jsf.resource.ResourceNotFoundException;
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+
+import com.gargoylesoftware.htmlunit.html.HtmlLink;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.html.HtmlScript;
+
+/**
+ * @author Nick Belaevski
+ * @since 3.3.0
+ */
+
+public class LoadResourceComponentTest extends AbstractAjax4JsfTestCase {
+
+ private String componentJs;
+ private String userJs;
+
+ private String componentXcss;
+ private String userXcss;
+
+ /**
+ * @param name
+ */
+ public LoadResourceComponentTest(String name) {
+ super(name);
+ }
+
+ private void registerResource(String path) {
+ InternetResourceBuilder resourceBuilder = InternetResourceBuilder.getInstance();
+
+ try {
+ resourceBuilder.getResource(path);
+ } catch (ResourceNotFoundException e) {
+ resourceBuilder.createResource(null, path);
+ }
+ }
+
+ @Override
+ public void setUp() throws Exception {
+ super.setUp();
+ renderKit.addRenderer(ResourceDependentComponent.COMPONENT_FAMILY,
+ ResourceDependentComponent.COMPONENT_TYPE, new ResourceDependentComponentRenderer());
+
+ String resourcePackage = getClass().getPackage().getName().replace('.', '/') + "/";
+ componentJs = resourcePackage + "component.js";
+ componentXcss = resourcePackage + "component.xcss";
+
+ userJs = resourcePackage + "user.js";
+ userXcss = resourcePackage + "user.xcss";
+
+ registerResource(componentJs);
+ registerResource(userJs);
+ registerResource(componentXcss);
+ registerResource(userXcss);
+ }
+
+ @Override
+ public void tearDown() throws Exception {
+ super.tearDown();
+
+ componentJs = null;
+ userJs = null;
+
+ componentXcss = null;
+ userXcss = null;
+ }
+
+ private UIResource createLoadScriptComponent() {
+ return (UIResource) application.createComponent("org.ajax4jsf.LoadScript");
+ }
+
+ private UIResource createLoadStyleComponent() {
+ return (UIResource) application.createComponent("org.ajax4jsf.LoadStyle");
+ }
+
+ private List<HtmlScript> selectScriptsBySrc(HtmlPage page, String src) throws Exception {
+ return Collections.checkedList(page.getByXPath("//script[@src[contains(string(.), '" + src + "')]]"),
+ HtmlScript.class);
+ }
+
+ private List<HtmlLink> selectStylesByHhref(HtmlPage page, String src) throws Exception {
+ return Collections.checkedList(page.getByXPath("//link[@type = 'text/css'][@rel = 'stylesheet'][@href[contains(string(.), '" + src + "')]]"),
+ HtmlLink.class);
+ }
+
+ protected UIResource createAndAddScriptResource(Object src) {
+ UIResource scriptComponent = createLoadScriptComponent();
+ scriptComponent.setSrc(src);
+ facesContext.getViewRoot().getChildren().add(scriptComponent);
+
+ return scriptComponent;
+ }
+
+ protected UIResource createAndAddStyleResource(Object src) {
+ UIResource styleComponent = createLoadStyleComponent();
+ styleComponent.setSrc(src);
+ facesContext.getViewRoot().getChildren().add(styleComponent);
+
+ return styleComponent;
+ }
+
+ public void testRenderScript() throws Exception {
+ createAndAddScriptResource(RESOURCE_URI_PREFIX + userJs);
+ createAndAddScriptResource(RESOURCE_URI_PREFIX + componentJs).setRendered(false);
+
+ HtmlPage page = renderView();
+ List<HtmlScript> scripts;
+
+ scripts = selectScriptsBySrc(page, userJs);
+ assertEquals(1, scripts.size());
+
+ scripts = selectScriptsBySrc(page, componentJs);
+ assertEquals(0, scripts.size());
+ }
+
+ public void testRenderScriptResource() throws Exception {
+ InternetResourceBuilder resourceBuilder = InternetResourceBuilder.getInstance();
+ createAndAddScriptResource(resourceBuilder.getResourceForKey(userJs));
+ createAndAddScriptResource(resourceBuilder.getResourceForKey(componentJs)).setRendered(false);
+
+ HtmlPage page = renderView();
+ List<HtmlScript> scripts;
+
+ scripts = selectScriptsBySrc(page, userJs);
+ assertEquals(1, scripts.size());
+
+ scripts = selectScriptsBySrc(page, componentJs);
+ assertEquals(1, scripts.size());
+ }
+
+ public void testRenderStyle() throws Exception {
+ createAndAddStyleResource(RESOURCE_URI_PREFIX + userXcss);
+ createAndAddStyleResource(RESOURCE_URI_PREFIX + componentXcss).setRendered(false);
+
+ HtmlPage page = renderView();
+ List<HtmlLink> styles;
+ HtmlLink userLink;
+
+ styles = selectStylesByHhref(page, userXcss);
+ assertEquals(1, styles.size());
+ userLink = styles.get(0);
+ assertEquals("user", userLink.getClassAttribute());
+ assertEquals("", userLink.getMediaAttribute());
+
+ styles = selectStylesByHhref(page, componentXcss);
+ assertEquals(0, styles.size());
+ }
+
+ public void testRenderStyleResource() throws Exception {
+ InternetResourceBuilder resourceBuilder = InternetResourceBuilder.getInstance();
+ createAndAddStyleResource(resourceBuilder.getResourceForKey(userXcss));
+ createAndAddStyleResource(resourceBuilder.getResourceForKey(componentXcss)).setRendered(false);
+
+ UIResource styleComponent = createLoadStyleComponent();
+ styleComponent.setSrc(InternetResourceBuilder.getInstance().getResourceForKey(userXcss));
+ facesContext.getViewRoot().getChildren().add(styleComponent);
+
+ HtmlPage page = renderView();
+ List<HtmlLink> styles;
+ HtmlLink userLink;
+
+ styles = selectStylesByHhref(page, userXcss);
+ assertEquals(1, styles.size());
+ userLink = styles.get(0);
+ assertEquals("user", userLink.getClassAttribute());
+ assertEquals("", userLink.getMediaAttribute());
+
+ styles = selectStylesByHhref(page, componentXcss);
+ assertEquals(1, styles.size());
+ userLink = styles.get(0);
+ assertEquals("user", userLink.getClassAttribute());
+ assertEquals("", userLink.getMediaAttribute());
+ }
+
+ public void testRenderMedia() throws Exception {
+ createAndAddStyleResource(RESOURCE_URI_PREFIX + userXcss).
+ getAttributes().put(HTML.media_ATTRIBUTE, "screen print");
+
+ HtmlPage page = renderView();
+ List<HtmlLink> styles = selectStylesByHhref(page, userXcss);
+ assertEquals(1, styles.size());
+ HtmlLink userLink = styles.get(0);
+ assertEquals("user", userLink.getClassAttribute());
+ assertEquals("screen print", userLink.getMediaAttribute());
+ }
+
+ public void testRenderOverridenScript() throws Exception {
+ List<UIComponent> childrenList = facesContext.getViewRoot().getChildren();
+
+ UIResource userJsComponent = createLoadScriptComponent();
+ userJsComponent.setSrc(RESOURCE_URI_PREFIX + userJs);
+ childrenList.add(userJsComponent);
+
+ InternetResourceBuilder resourceBuilder = InternetResourceBuilder.getInstance();
+
+ childrenList.add(new ResourceDependentComponent(true,
+ resourceBuilder.getResourceForKey(componentJs),
+ resourceBuilder.getResourceForKey(userJs)));
+
+ UIResource componentJsComponent = createLoadScriptComponent();
+ componentJsComponent.setSrc(RESOURCE_URI_PREFIX + componentJs);
+ childrenList.add(componentJsComponent);
+
+ HtmlPage page = renderView();
+ List<HtmlScript> userScripts = selectScriptsBySrc(page, userJs);
+ assertEquals(1, userScripts.size());
+ List<HtmlScript> componentScripts = selectScriptsBySrc(page, componentJs);
+ assertEquals(1, componentScripts.size());
+ }
+
+ public void testRenderOverridenStyle() throws Exception {
+ List<UIComponent> childrenList = facesContext.getViewRoot().getChildren();
+
+ UIResource userXcssComponent = createLoadStyleComponent();
+ userXcssComponent.setSrc(RESOURCE_URI_PREFIX + userXcss);
+ childrenList.add(userXcssComponent);
+
+ InternetResourceBuilder resourceBuilder = InternetResourceBuilder.getInstance();
+
+ childrenList.add(new ResourceDependentComponent(false,
+ resourceBuilder.getResourceForKey(componentXcss),
+ resourceBuilder.getResourceForKey(userXcss)));
+
+ UIResource componentXcssComponent = createLoadStyleComponent();
+ componentXcssComponent.setSrc(RESOURCE_URI_PREFIX + componentXcss);
+ childrenList.add(componentXcssComponent);
+
+ HtmlPage page = renderView();
+ List<HtmlLink> styles = selectStylesByHhref(page, userXcss);
+ assertEquals(2, styles.size());
+ assertEquals("component", styles.get(0).getClassAttribute());
+ assertEquals("user", styles.get(1).getClassAttribute());
+
+ styles = selectStylesByHhref(page, componentXcss);
+ assertEquals(2, styles.size());
+ assertEquals("component", styles.get(0).getClassAttribute());
+ assertEquals("user", styles.get(1).getClassAttribute());
+ }
+
+ public void testRenderOverridenAjaxScript() throws Exception {
+ UIResource userComponent = createLoadScriptComponent();
+ userComponent.setSrc(RESOURCE_URI_PREFIX + "/org/ajax4jsf/javascript/scripts/AJAX.js");
+
+ List<UIComponent> childrenList = facesContext.getViewRoot().getChildren();
+ childrenList.add(userComponent);
+
+ childrenList.add(new ResourceDependentComponent(true, new AjaxScript()));
+
+ HtmlPage page = renderView();
+ List<HtmlScript> scripts = selectScriptsBySrc(page, "AjaxScript");
+ assertEquals(1, scripts.size());
+
+ scripts = selectScriptsBySrc(page, "AJAX.js");
+ //TODO change to 0 after related issue resolution
+ assertEquals(1, scripts.size());
+ }
+}
+
+class ResourceDependentComponent extends UIComponentBase {
+
+ static String COMPONENT_TYPE = "org.ajax4jsf.component.Test$ResourceDependentComponent";
+
+ static String COMPONENT_FAMILY = COMPONENT_TYPE;
+
+ private InternetResource[] resources;
+
+ private boolean useScripts;
+
+ public ResourceDependentComponent(boolean useScripts, InternetResource... resources) {
+ this.useScripts = useScripts;
+ this.resources = resources;
+ }
+
+ @Override
+ public String getFamily() {
+ return COMPONENT_FAMILY;
+ }
+
+ @Override
+ public String getRendererType() {
+ return COMPONENT_TYPE;
+ }
+
+ public InternetResource[] getScripts() {
+ return useScripts ? resources : null;
+ }
+
+ public InternetResource[] getStyles() {
+ return useScripts ? null : resources;
+ }
+}
+
+class ResourceDependentComponentRenderer extends RendererBase implements HeaderResourceProducer2 {
+
+ @Override
+ protected Class<? extends UIComponent> getComponentClass() {
+ return ResourceDependentComponent.class;
+ }
+
+ public void encodeToHead(FacesContext context, UIComponent component,
+ ProducerContext pc) throws IOException {
+
+ ResourceDependentComponent resourceDependentComponent = (ResourceDependentComponent) component;
+
+ if (pc.isProcessScripts()) {
+ InternetResource[] scripts = resourceDependentComponent.getScripts();
+ if (scripts != null) {
+ for (InternetResource script : scripts) {
+ script.encode(context, null);
+ }
+ }
+ }
+
+ if (pc.isProcessStyles()) {
+ InternetResource[] styles = resourceDependentComponent.getStyles();
+ if (styles != null) {
+ for (InternetResource script : styles) {
+ script.encode(context, null);
+ }
+ }
+ }
+ }
+
+}
\ No newline at end of file
Added: trunk/ui/core/src/test/resources/org/ajax4jsf/component/component.js
===================================================================
--- trunk/ui/core/src/test/resources/org/ajax4jsf/component/component.js (rev 0)
+++ trunk/ui/core/src/test/resources/org/ajax4jsf/component/component.js 2008-11-26 15:32:01 UTC (rev 11398)
@@ -0,0 +1 @@
+/* dependency of org.ajax4jsf.component.LoadResourceComponentTest */
\ No newline at end of file
Added: trunk/ui/core/src/test/resources/org/ajax4jsf/component/component.xcss
===================================================================
--- trunk/ui/core/src/test/resources/org/ajax4jsf/component/component.xcss (rev 0)
+++ trunk/ui/core/src/test/resources/org/ajax4jsf/component/component.xcss 2008-11-26 15:32:01 UTC (rev 11398)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<f:template xmlns:f='http:/jsf.exadel.com/template'
+ xmlns:u='http:/jsf.exadel.com/template/util'
+ xmlns="http://www.w3.org/1999/xhtml">
+
+ <!-- dependency of org.ajax4jsf.component.LoadResourceComponentTest -->
+
+</f:template>
\ No newline at end of file
Added: trunk/ui/core/src/test/resources/org/ajax4jsf/component/user.js
===================================================================
--- trunk/ui/core/src/test/resources/org/ajax4jsf/component/user.js (rev 0)
+++ trunk/ui/core/src/test/resources/org/ajax4jsf/component/user.js 2008-11-26 15:32:01 UTC (rev 11398)
@@ -0,0 +1 @@
+/* dependency of org.ajax4jsf.component.LoadResourceComponentTest */
\ No newline at end of file
Added: trunk/ui/core/src/test/resources/org/ajax4jsf/component/user.xcss
===================================================================
--- trunk/ui/core/src/test/resources/org/ajax4jsf/component/user.xcss (rev 0)
+++ trunk/ui/core/src/test/resources/org/ajax4jsf/component/user.xcss 2008-11-26 15:32:01 UTC (rev 11398)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<f:template xmlns:f='http:/jsf.exadel.com/template'
+ xmlns:u='http:/jsf.exadel.com/template/util'
+ xmlns="http://www.w3.org/1999/xhtml">
+
+ <!-- dependency of org.ajax4jsf.component.LoadResourceComponentTest -->
+
+</f:template>
\ No newline at end of file
16 years
JBoss Rich Faces SVN: r11397 - trunk/framework/impl/src/main/java/org/ajax4jsf/context.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-11-26 10:31:40 -0500 (Wed, 26 Nov 2008)
New Revision: 11397
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/context/ViewResources.java
Log:
https://jira.jboss.org/jira/browse/RF-4714
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/context/ViewResources.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/context/ViewResources.java 2008-11-26 15:19:06 UTC (rev 11396)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/context/ViewResources.java 2008-11-26 15:31:40 UTC (rev 11397)
@@ -23,8 +23,12 @@
import java.io.IOException;
import java.io.StringWriter;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Locale;
import java.util.Map;
import java.util.Set;
@@ -62,6 +66,7 @@
import org.richfaces.skin.Skin;
import org.richfaces.skin.SkinFactory;
import org.richfaces.skin.SkinNotFoundException;
+import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
/**
@@ -87,7 +92,7 @@
private RenderKit renderKit;
- private Node[] result = null;
+ private Node[] headNodes = null;
private static final String EXTENDED_SKINNING_ON_NO_SCRIPTS_INFO_KEY = ViewResources.class.getName() + "EXTENDED_SKINNING_ON_NO_SCRIPTS_INFO_KEY";
@@ -148,16 +153,69 @@
this.extendedSkinningAllowed = extendedSkinningAllowed;
}
- public Node[] getHeadEvents() {
- Node[] componentResourceNodes = componentWriter.getNodes();
- Node[] userResourceNodes = userWriter.getNodes();
+ private static String SCRIPT = HTML.SCRIPT_ELEM;
+ private static String SCRIPT_UC = SCRIPT.toUpperCase(Locale.US);
+
+ private static String SRC = HTML.src_ATTRIBUTE;
+ private static String SRC_UC = SRC.toUpperCase(Locale.US);
- result = new Node[componentResourceNodes.length + userResourceNodes.length];
- System.arraycopy(componentResourceNodes, 0, result, 0, componentResourceNodes.length);
- System.arraycopy(userResourceNodes, 0, result, componentResourceNodes.length, userResourceNodes.length);
-
- return result;
+ private void mergeHeadResourceNode(List<Node> nodes, Set<String> renderedScripts, Node node) {
+ boolean shouldAdd = true;
+
+ String nodeName = node.getNodeName();
+ if (SCRIPT.equals(nodeName) || SCRIPT_UC.equals(nodeName)) {
+ if (node.getFirstChild() == null) {
+ //no text content etc.
+
+ NamedNodeMap attributes = node.getAttributes();
+ if (attributes != null) {
+ Node item = attributes.getNamedItem(SRC);
+ if (item == null) {
+ attributes.getNamedItem(SRC_UC);
+ }
+
+ if (item != null) {
+ String src = item.getNodeValue();
+ if (src != null) {
+ if (renderedScripts.contains(src)) {
+ shouldAdd = false;
+ } else {
+ renderedScripts.add(src);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (shouldAdd) {
+ nodes.add(node);
+ }
}
+
+ private Node[] mergeHeadResourceNodes() {
+ List<Node> result = new ArrayList<Node>();
+
+ Set<String> scripts = new HashSet<String>();
+
+ for (Node node : componentWriter.getNodes()) {
+ mergeHeadResourceNode(result, scripts, node);
+ }
+
+ for (Node node : userWriter.getNodes()) {
+ mergeHeadResourceNode(result, scripts, node);
+ }
+
+ return result.toArray(new Node[result.size()]);
+ }
+
+ public Node[] getHeadEvents() {
+ if (headNodes == null) {
+ headNodes = mergeHeadResourceNodes();
+ }
+
+ return headNodes;
+ }
private static final Log log = LogFactory.getLog(ViewResources.class);
@@ -374,7 +432,9 @@
skinExtendedStyleSheetUri = (String) skin.getParameter(context,
Skin.extendedStyleSheet);
} catch (SkinNotFoundException e) {
- log.warn("Current Skin is not found", e);
+ if (log.isWarnEnabled()) {
+ log.warn("Current Skin is not found", e);
+ }
}
resourceBuilder = InternetResourceBuilder.getInstance();
@@ -519,11 +579,13 @@
stringWriter.flush();
- log.info("Extended skinning is on and NONE scripts loading strategy was detected. " +
- "Do not forget that one of " + InternetResourceBuilder.SKINNING_SCRIPT + " or " +
- InternetResourceBuilder.COMMON_FRAMEWORK_SCRIPT + " resources should be presented " +
- "on the page together with the following code: \n" + stringWriter.getBuffer().toString() +
- "\nfor extended level of skinning to work.");
+ if (log.isInfoEnabled()) {
+ log.info("Extended skinning is on and NONE scripts loading strategy was detected. " +
+ "Do not forget that one of " + InternetResourceBuilder.SKINNING_SCRIPT + " or " +
+ InternetResourceBuilder.COMMON_FRAMEWORK_SCRIPT + " resources should be presented " +
+ "on the page together with the following code: \n" + stringWriter.getBuffer().toString() +
+ "\nfor extended level of skinning to work.");
+ }
} finally {
if (writer != null) {
context.setResponseWriter(writer);
16 years
JBoss Rich Faces SVN: r11396 - in trunk/test-applications/jsp/src/main: webapp/Editor and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2008-11-26 10:19:06 -0500 (Wed, 26 Nov 2008)
New Revision: 11396
Modified:
trunk/test-applications/jsp/src/main/java/editor/Editor.java
trunk/test-applications/jsp/src/main/webapp/Editor/Editor.jsp
trunk/test-applications/jsp/src/main/webapp/Editor/EditorProperty.jsp
Log:
changes in editor config
Modified: trunk/test-applications/jsp/src/main/java/editor/Editor.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/editor/Editor.java 2008-11-26 14:31:03 UTC (rev 11395)
+++ trunk/test-applications/jsp/src/main/java/editor/Editor.java 2008-11-26 15:19:06 UTC (rev 11396)
@@ -26,7 +26,7 @@
private String tabindex;
private String dialogType;
private String language;
- private String configuration;
+ private boolean configuration;
// private String skin;
public Editor() {
@@ -45,10 +45,21 @@
dialogType = "window";
language = "en";
// skin = "default";
- configuration = "";
+ configuration = false;
}
-
+
/*
+ * attach config file to editor
+ */
+ public void useConfigFile(ValueChangeEvent e) {
+ if (!configuration) {
+ htmlEditor.setConfiguration("editorconfig");
+ } else {
+ htmlEditor.setConfiguration(null);
+ }
+ }
+
+ /*
* Custom valueChangeListener
*/
public void valueChangeListener(ValueChangeEvent e) {
@@ -236,11 +247,11 @@
this.language = language;
}
- public String getConfiguration() {
+ public boolean getConfiguration() {
return configuration;
}
- public void setConfiguration(String configuration) {
+ public void setConfiguration(boolean configuration) {
this.configuration = configuration;
}
Modified: trunk/test-applications/jsp/src/main/webapp/Editor/Editor.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Editor/Editor.jsp 2008-11-26 14:31:03 UTC (rev 11395)
+++ trunk/test-applications/jsp/src/main/webapp/Editor/Editor.jsp 2008-11-26 15:19:06 UTC (rev 11396)
@@ -19,8 +19,7 @@
valueChangeListener="#{editor.valueChangeListener}"
viewMode="#{editor.viewMode}" readonly="#{editor.readonly}"
tabindex="#{editor.tabindex}" dialogType="#{editor.dialogType}"
- language="#{editor.language}" styleClass="EditorStyleClass"
- configuration="#{editor.configuration}">
+ language="#{editor.language}" styleClass="EditorStyleClass" >
<f:param name="theme_advanced_resizing" value="true" />
<f:param name="theme_advanced_statusbar_location" value="top" />
Modified: trunk/test-applications/jsp/src/main/webapp/Editor/EditorProperty.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Editor/EditorProperty.jsp 2008-11-26 14:31:03 UTC (rev 11395)
+++ trunk/test-applications/jsp/src/main/webapp/Editor/EditorProperty.jsp 2008-11-26 15:19:06 UTC (rev 11396)
@@ -77,10 +77,8 @@
--%>
<h:outputText value="use configuration file: "></h:outputText>
- <h:selectOneRadio value="#{editor.configuration}" onchange="submit();">
- <f:selectItem itemValue="" itemLabel="do not use" />
- <f:selectItem itemValue="editorconfig" itemLabel="use editorconfig.properties" />
- </h:selectOneRadio>
+ <h:selectBooleanCheckbox value="#{editor.configuration}"
+ onchange="submit();" valueChangeListener="#{editor.useConfigFile}" />
</h:panelGrid>
<h:commandButton value="add test" action="#{editor.addHtmlEditor}"></h:commandButton>
</f:subview>
\ No newline at end of file
16 years
JBoss Rich Faces SVN: r11395 - trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: dmorozov
Date: 2008-11-26 09:31:03 -0500 (Wed, 26 Nov 2008)
New Revision: 11395
Modified:
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
Log:
https://jira.jboss.org/jira/browse/RF-4866
Modified: trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
===================================================================
--- trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2008-11-26 14:11:57 UTC (rev 11394)
+++ trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2008-11-26 14:31:03 UTC (rev 11395)
@@ -296,7 +296,13 @@
if (!this.comboList.activeItem) {
return;
}
- var value = this.comboList.activeItem.innerHTML.unescapeHTML();
+
+ var value = this.comboList.activeItem.innerText;
+ if(!value) {
+ value = this.comboList.activeItem.textContent.strip();
+ }
+
+ // var value = this.comboList.activeItem.innerHTML.unescapeHTML();
if (toSetOnly) {
var oV = this.field.value;
if (oV == value) {
16 years
JBoss Rich Faces SVN: r11394 - in trunk/test-applications/facelets/src/main: resources and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2008-11-26 09:11:57 -0500 (Wed, 26 Nov 2008)
New Revision: 11394
Added:
trunk/test-applications/facelets/src/main/resources/editorconfig.properties
Modified:
trunk/test-applications/facelets/src/main/java/editor/Editor.java
trunk/test-applications/facelets/src/main/webapp/Editor/Editor.xhtml
trunk/test-applications/facelets/src/main/webapp/Editor/EditorProperty.xhtml
Log:
+ editor config file
Modified: trunk/test-applications/facelets/src/main/java/editor/Editor.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/editor/Editor.java 2008-11-26 14:11:18 UTC (rev 11393)
+++ trunk/test-applications/facelets/src/main/java/editor/Editor.java 2008-11-26 14:11:57 UTC (rev 11394)
@@ -27,6 +27,7 @@
private String dialogType;
private String language;
// private String skin;
+ private String configuration;
public Editor() {
value = "Collaboration-oriented websites require a human-friendly markup language for easy entry of formatted text in forum posts, wiki pages, blogs, comments, etc. Seam provides the <s:formattedText/> control for display of formatted text that conforms to the Seam Text language. Seam Text is implemented using an ANTLR-based parser. You don't need to know anything about ANTLR to use it, however.";
@@ -44,6 +45,7 @@
dialogType = "window";
language = "en";
// skin = "default";
+ configuration = "";
}
/*
@@ -234,6 +236,14 @@
this.language = language;
}
+ public String getConfiguration() {
+ return (configuration == null)?"":configuration;
+ }
+
+ public void setConfiguration(String configuration) {
+ this.configuration = configuration;
+ }
+
// public String getSkin() {
// return skin;
// }
Added: trunk/test-applications/facelets/src/main/resources/editorconfig.properties
===================================================================
--- trunk/test-applications/facelets/src/main/resources/editorconfig.properties (rev 0)
+++ trunk/test-applications/facelets/src/main/resources/editorconfig.properties 2008-11-26 14:11:57 UTC (rev 11394)
@@ -0,0 +1,3 @@
+theme_advanced_buttons1 = "forecolor,backcolor"
+theme_advanced_buttons2 = "bullist,numlist,separator,outdent,indent,separator,undo,redo"
+theme_advanced_buttons3 = "hr,removeformat,visualaid,separator,sub,sup,separator,charmap"
\ No newline at end of file
Modified: trunk/test-applications/facelets/src/main/webapp/Editor/Editor.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/Editor/Editor.xhtml 2008-11-26 14:11:18 UTC (rev 11393)
+++ trunk/test-applications/facelets/src/main/webapp/Editor/Editor.xhtml 2008-11-26 14:11:57 UTC (rev 11394)
@@ -19,8 +19,13 @@
valueChangeListener="#{editor.valueChangeListener}"
viewMode="#{editor.viewMode}" readonly="#{editor.readonly}"
tabindex="#{editor.tabindex}" dialogType="#{editor.dialogType}"
- language="#{editor.language}" styleClass="EditorStyleClass"></rich:editor>
+ language="#{editor.language}" styleClass="EditorStyleClass"
+ configuration="#{editor.configuration}">
+ <f:param name="theme_advanced_resizing" value="true" />
+ <f:param name="theme_advanced_statusbar_location" value="top" />
+ </rich:editor>
+
<h:panelGrid columns="1">
<f:facet name="header">
<h:outputText value="Results" />
Modified: trunk/test-applications/facelets/src/main/webapp/Editor/EditorProperty.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/Editor/EditorProperty.xhtml 2008-11-26 14:11:18 UTC (rev 11393)
+++ trunk/test-applications/facelets/src/main/webapp/Editor/EditorProperty.xhtml 2008-11-26 14:11:57 UTC (rev 11394)
@@ -66,7 +66,12 @@
<f:selectItem itemValue="de" itemLabel="de" />
<f:selectItem itemValue="ru" itemLabel="ru" />
</h:selectOneRadio>
-
+
+ <h:outputText value="use configuration file: "></h:outputText>
+ <h:selectOneRadio value="#{editor.configuration}" onchange="submit();">
+ <f:selectItem itemValue="" itemLabel="do not use" />
+ <f:selectItem itemValue="editorconfig" itemLabel="use editorconfig.properties" />
+ </h:selectOneRadio>
</h:panelGrid>
<h:commandButton value="add test" action="#{editor.addHtmlEditor}"></h:commandButton>
</f:subview>
\ No newline at end of file
16 years
JBoss Rich Faces SVN: r11393 - in trunk/test-applications/seamApp/web/src/main: resources and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2008-11-26 09:11:18 -0500 (Wed, 26 Nov 2008)
New Revision: 11393
Added:
trunk/test-applications/seamApp/web/src/main/resources/editorconfig.properties
Modified:
trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/editor/Editor.java
trunk/test-applications/seamApp/web/src/main/webapp/Editor/Editor.xhtml
trunk/test-applications/seamApp/web/src/main/webapp/Editor/EditorProperty.xhtml
Log:
+ editor config file
Modified: trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/editor/Editor.java
===================================================================
--- trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/editor/Editor.java 2008-11-26 13:31:12 UTC (rev 11392)
+++ trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/editor/Editor.java 2008-11-26 14:11:18 UTC (rev 11393)
@@ -33,6 +33,7 @@
private String dialogType;
private String language;
// private String skin;
+ private String configuration;
public Editor() {
value = "Collaboration-oriented websites require a human-friendly markup language for easy entry of formatted text in forum posts, wiki pages, blogs, comments, etc. Seam provides the <s:formattedText/> control for display of formatted text that conforms to the Seam Text language. Seam Text is implemented using an ANTLR-based parser. You don't need to know anything about ANTLR to use it, however.";
@@ -50,6 +51,7 @@
dialogType = "window";
language = "en";
// skin = "default";
+ configuration = "";
}
/*
@@ -240,6 +242,14 @@
this.language = language;
}
+ public String getConfiguration() {
+ return (configuration == null)?"":configuration;
+ }
+
+ public void setConfiguration(String configuration) {
+ this.configuration = configuration;
+ }
+
// public String getSkin() {
// return skin;
// }
Added: trunk/test-applications/seamApp/web/src/main/resources/editorconfig.properties
===================================================================
--- trunk/test-applications/seamApp/web/src/main/resources/editorconfig.properties (rev 0)
+++ trunk/test-applications/seamApp/web/src/main/resources/editorconfig.properties 2008-11-26 14:11:18 UTC (rev 11393)
@@ -0,0 +1,3 @@
+theme_advanced_buttons1 = "forecolor,backcolor"
+theme_advanced_buttons2 = "bullist,numlist,separator,outdent,indent,separator,undo,redo"
+theme_advanced_buttons3 = "hr,removeformat,visualaid,separator,sub,sup,separator,charmap"
\ No newline at end of file
Modified: trunk/test-applications/seamApp/web/src/main/webapp/Editor/Editor.xhtml
===================================================================
--- trunk/test-applications/seamApp/web/src/main/webapp/Editor/Editor.xhtml 2008-11-26 13:31:12 UTC (rev 11392)
+++ trunk/test-applications/seamApp/web/src/main/webapp/Editor/Editor.xhtml 2008-11-26 14:11:18 UTC (rev 11393)
@@ -19,7 +19,12 @@
valueChangeListener="#{editor.valueChangeListener}"
viewMode="#{editor.viewMode}" readonly="#{editor.readonly}"
tabindex="#{editor.tabindex}" dialogType="#{editor.dialogType}"
- language="#{editor.language}" styleClass="EditorStyleClass"></rich:editor>
+ language="#{editor.language}" styleClass="EditorStyleClass"
+ configuration="#{editor.configuration}">
+
+ <f:param name="theme_advanced_resizing" value="true" />
+ <f:param name="theme_advanced_statusbar_location" value="top" />
+ </rich:editor>
<h:panelGrid columns="1">
<f:facet name="header">
Modified: trunk/test-applications/seamApp/web/src/main/webapp/Editor/EditorProperty.xhtml
===================================================================
--- trunk/test-applications/seamApp/web/src/main/webapp/Editor/EditorProperty.xhtml 2008-11-26 13:31:12 UTC (rev 11392)
+++ trunk/test-applications/seamApp/web/src/main/webapp/Editor/EditorProperty.xhtml 2008-11-26 14:11:18 UTC (rev 11393)
@@ -66,7 +66,12 @@
<f:selectItem itemValue="de" itemLabel="de" />
<f:selectItem itemValue="ru" itemLabel="ru" />
</h:selectOneRadio>
-
+
+ <h:outputText value="use configuration file: "></h:outputText>
+ <h:selectOneRadio value="#{editor.configuration}" onchange="submit();">
+ <f:selectItem itemValue="" itemLabel="do not use" />
+ <f:selectItem itemValue="editorconfig" itemLabel="use editorconfig.properties" />
+ </h:selectOneRadio>
</h:panelGrid>
<h:commandButton value="add test" action="#{editor.addHtmlEditor}"></h:commandButton>
</f:subview>
\ No newline at end of file
16 years
JBoss Rich Faces SVN: r11392 - in trunk/test-applications/seleniumTest/richfaces/src: main/webapp/WEB-INF and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-11-26 08:31:12 -0500 (Wed, 26 Nov 2008)
New Revision: 11392
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/MessageBean2.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/message.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessageTest.java
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/faces-config.xml
Log:
RF-5012
Added: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/MessageBean2.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/MessageBean2.java (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/MessageBean2.java 2008-11-26 13:31:12 UTC (rev 11392)
@@ -0,0 +1,51 @@
+package org.ajax4jsf.bean;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.application.FacesMessage.Severity;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.validator.Validator;
+import javax.faces.validator.ValidatorException;
+
+public class MessageBean2 implements Validator{
+
+ static public final String MESSAGE = "Validation is failed";
+
+ private String string;
+
+ public MessageBean2() {
+
+ }
+
+ public void init() {
+ string = "something";
+ }
+
+ public void validate(FacesContext context, UIComponent component,
+ Object value) throws ValidatorException {
+ Severity severity = null;
+ if ("fatal".equals(value)) {
+ severity = FacesMessage.SEVERITY_FATAL;
+ } else if ("error".equals(value)) {
+ severity = FacesMessage.SEVERITY_ERROR;
+ } else if ("warn".equals(value)) {
+ severity = FacesMessage.SEVERITY_WARN;
+ } else if ("info".equals(value)) {
+ severity = FacesMessage.SEVERITY_INFO;
+ }
+ if (severity != null) {
+ FacesMessage message = new FacesMessage(MESSAGE);
+ message.setSeverity(severity);
+ throw new ValidatorException(message);
+ }
+ }
+
+ public void setString(String string) {
+ this.string = string;
+ }
+
+ public String getString() {
+ return string;
+ }
+
+}
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/faces-config.xml 2008-11-26 13:01:12 UTC (rev 11391)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/faces-config.xml 2008-11-26 13:31:12 UTC (rev 11392)
@@ -46,6 +46,12 @@
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
+ <managed-bean>
+ <managed-bean-name>messageBean</managed-bean-name>
+ <managed-bean-class>org.ajax4jsf.bean.MessageBean2</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+
<managed-bean>
<managed-bean-name>indexBean</managed-bean-name>
<managed-bean-class>org.ajax4jsf.bean.IndexBean</managed-bean-class>
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/message.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/message.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/message.xhtml 2008-11-26 13:31:12 UTC (rev 11392)
@@ -0,0 +1,39 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+
+<ui:composition template="#{templateBean.template}">
+ <ui:define name="style">
+
+ </ui:define>
+ <ui:define name="component">
+ <h:form id="mainForm">
+ <h:panelGroup id="panel">
+ <h:inputText id="inputText" value="#{messageBean.string}" validator="#{messageBean.validate}"></h:inputText>
+ <rich:message for="inputText">
+ <f:facet name="fatalMarker">
+ <h:outputText id="fatalMarker" value="fatalMarker"></h:outputText>
+ </f:facet>
+ <f:facet name="errorMarker">
+ <h:outputText id="errorMarker" value="errorMarker"></h:outputText>
+ </f:facet>
+ <f:facet name="warnMarker">
+ <h:outputText id="warnMarker" value="warnMarker"></h:outputText>
+ </f:facet>
+ <f:facet name="infoMarker">
+ <h:outputText id="infoMarker" value="infoMarker"></h:outputText>
+ </f:facet>
+ <f:facet name="passedMarker">
+ <h:outputText id="passedMarker" value="passedMarker"></h:outputText>
+ </f:facet>
+ </rich:message>
+ </h:panelGroup>
+ <a4j:commandButton id="submit" value="Submit" reRender="panel"></a4j:commandButton>
+ </h:form>
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file
Added: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessageTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessageTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessageTest.java 2008-11-26 13:31:12 UTC (rev 11392)
@@ -0,0 +1,49 @@
+package org.richfaces.testng;
+
+import org.ajax4jsf.template.Template;
+import org.richfaces.SeleniumTestBase;
+import org.testng.annotations.Test;
+
+public class MessageTest extends SeleniumTestBase {
+
+ private String mainForm;
+
+ private String inputText;
+
+ private String submit;
+
+ private void init(Template template) {
+ renderPage(template, "#{messageBean.init}");
+ mainForm = getParentId() + "mainForm";
+ inputText = mainForm + ":inputText";
+ submit = mainForm + ":submit";
+ }
+
+ /**
+ * check markers rendering
+ */
+ @Test
+ public void testMarkers(Template template) {
+ init(template);
+ selenium.isElementPresent(mainForm + ":passedMarker");
+ selenium.type(inputText, "fatal");
+ clickAjaxCommandAndWait(submit);
+ selenium.isElementPresent(mainForm + ":fatalMarker");
+ selenium.type(inputText, "error");
+ clickAjaxCommandAndWait(submit);
+ selenium.isElementPresent(mainForm + ":errorMarker");
+ selenium.type(inputText, "warn");
+ clickAjaxCommandAndWait(submit);
+ selenium.isElementPresent(mainForm + ":warnMarker");
+ selenium.type(inputText, "info");
+ clickAjaxCommandAndWait(submit);
+ selenium.isElementPresent(mainForm + ":infoMarker");
+ }
+
+
+ @Override
+ public String getTestUrl() {
+ return "pages/message/message.xhtml";
+ }
+
+}
16 years
JBoss Rich Faces SVN: r11391 - trunk/test-applications/jsp/src/main/webapp/Editor.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2008-11-26 08:01:12 -0500 (Wed, 26 Nov 2008)
New Revision: 11391
Modified:
trunk/test-applications/jsp/src/main/webapp/Editor/Editor.jsp
Log:
Modified: trunk/test-applications/jsp/src/main/webapp/Editor/Editor.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Editor/Editor.jsp 2008-11-26 12:58:55 UTC (rev 11390)
+++ trunk/test-applications/jsp/src/main/webapp/Editor/Editor.jsp 2008-11-26 13:01:12 UTC (rev 11391)
@@ -11,26 +11,19 @@
height="#{editor.height}" theme="#{editor.theme}"
onchange="#{event.onchange}" oninit="#{event.oninit}"
onsave="#{event.onsave}" onsetup="#{event.onsetup}"
- autoResize="#{editor.autoResize}"
- converter="#{editor.convert}"
- converterMessage="converterMessage"
- immediate="#{editor.immediate}"
- rendered="#{editor.rendered}"
- required="#{editor.required}"
- requiredMessage="requiredMessage"
- useSeamText="#{editor.useSeamText}"
- validator="#{editor.validate}"
- validatorMessage="validatorMessage"
+ autoResize="#{editor.autoResize}" converter="#{editor.convert}"
+ converterMessage="converterMessage" immediate="#{editor.immediate}"
+ rendered="#{editor.rendered}" required="#{editor.required}"
+ requiredMessage="requiredMessage" useSeamText="#{editor.useSeamText}"
+ validator="#{editor.validate}" validatorMessage="validatorMessage"
valueChangeListener="#{editor.valueChangeListener}"
- viewMode="#{editor.viewMode}"
- readonly="#{editor.readonly}"
- tabindex="#{editor.tabindex}"
- dialogType="#{editor.dialogType}"
- language="#{editor.language}"
- styleClass="EditorStyleClass" configuration="#{editor.configuration}">
-
- <f:param name="theme_advanced_resizing" value="true"/>
- <f:param name="theme_advanced_statusbar_location" value="top"/>
+ viewMode="#{editor.viewMode}" readonly="#{editor.readonly}"
+ tabindex="#{editor.tabindex}" dialogType="#{editor.dialogType}"
+ language="#{editor.language}" styleClass="EditorStyleClass"
+ configuration="#{editor.configuration}">
+
+ <f:param name="theme_advanced_resizing" value="true" />
+ <f:param name="theme_advanced_statusbar_location" value="top" />
</rich:editor>
<h:panelGrid columns="1">
16 years