JBoss Rich Faces SVN: r9904 - in trunk/framework/impl/src/main/java/org/ajax4jsf: context and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-08-04 19:15:16 -0400 (Mon, 04 Aug 2008)
New Revision: 9904
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/application/AjaxStateManager.java
trunk/framework/impl/src/main/java/org/ajax4jsf/context/ContextInitParameters.java
Log:
https://jira.jboss.org/jira/browse/RF-3671
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/application/AjaxStateManager.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/application/AjaxStateManager.java 2008-08-04 22:30:44 UTC (rev 9903)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/application/AjaxStateManager.java 2008-08-04 23:15:16 UTC (rev 9904)
@@ -21,10 +21,13 @@
package org.ajax4jsf.application;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
import java.io.StringWriter;
import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
@@ -35,7 +38,6 @@
import javax.faces.FacesException;
import javax.faces.FactoryFinder;
import javax.faces.application.StateManager;
-import javax.faces.application.StateManager.SerializedView;
import javax.faces.component.UIComponentBase;
import javax.faces.component.UIViewRoot;
import javax.faces.context.ExternalContext;
@@ -46,6 +48,7 @@
import javax.faces.render.ResponseStateManager;
import org.ajax4jsf.context.AjaxContext;
+import org.ajax4jsf.context.ContextInitParameters;
import org.ajax4jsf.model.KeepAlive;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -296,6 +299,49 @@
return matcher.group(1);
}
+ private static final Object handleRestoreState(FacesContext context, Object state) {
+ if (ContextInitParameters.isSerializeServerState(context)) {
+ ObjectInputStream ois = null;
+ try {
+ ois = new ObjectInputStream(new ByteArrayInputStream((byte[]) state));
+ return ois.readObject();
+ } catch (Exception e) {
+ throw new FacesException(e);
+ } finally {
+ if (ois != null) {
+ try {
+ ois.close();
+ } catch (IOException ignored) { }
+ }
+ }
+ } else {
+ return state;
+ }
+ }
+
+ private static final Object handleSaveState(FacesContext context, Object state) {
+ if (ContextInitParameters.isSerializeServerState(context)) {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
+ ObjectOutputStream oas = null;
+ try {
+ oas = new ObjectOutputStream(baos);
+ oas.writeObject(state);
+ oas.flush();
+ } catch (Exception e) {
+ throw new FacesException(e);
+ } finally {
+ if (oas != null) {
+ try {
+ oas.close();
+ } catch (IOException ignored) { }
+ }
+ }
+ return baos.toByteArray();
+ } else {
+ return state;
+ }
+ }
+
/*
* (non-Javadoc)
*
@@ -345,7 +391,7 @@
}
if (null != serializedView) {
treeStructure = (TreeStructureNode) serializedView[0];
- state = (Object[]) serializedView[1];
+ state = (Object[]) handleRestoreState(context, serializedView[1]);
}
if (null != treeStructure) {
viewRoot = (UIViewRoot) treeStructure.restore(componentLoader);
@@ -401,7 +447,7 @@
viewStateArray = new Object[]{treeStructure, state};
} else {
viewStateArray = saveStateInSession(context, treeStructure,
- state);
+ handleSaveState(context, state));
}
}
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/context/ContextInitParameters.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/context/ContextInitParameters.java 2008-08-04 22:30:44 UTC (rev 9903)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/context/ContextInitParameters.java 2008-08-04 23:15:16 UTC (rev 9904)
@@ -27,6 +27,14 @@
// parameters. Do not Instantiate !
}
+ public static final String[] SERIALIZE_SERVER_STATE = new String[] {
+ "org.ajax4jsf.SERIALIZE_SERVER_STATE",
+
+ /* detect MyFaces vs. RI */
+ "com.sun.faces.serializeServerState",
+ "org.apache.myfaces.SERIALIZE_STATE_IN_SESSION"
+ };
+
public static final String[] NUMBER_OF_VIEWS_IN_SESSION = {"com.sun.faces.numberOfViewsInSession"};
public static final String[] NUMBER_OF_LOGICAL_VIEWS_IN_SESSION = {"com.sun.faces.numberOfLogicalViews"};
@@ -37,6 +45,10 @@
public static final String HANDLE_VIEW_EXPIRED_ON_CLIENT="org.ajax4jsf.handleViewExpiredOnClient";
+ public static final boolean isSerializeServerState(FacesContext context) {
+ return getBoolean(context, SERIALIZE_SERVER_STATE, false);
+ }
+
/**
* Get number of views for store in session by {@link AjaxStateManager}
* @param context - current faces context.
16 years, 7 months
JBoss Rich Faces SVN: r9903 - in trunk/ui/modal-panel/src/main: java/org/richfaces/component and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-08-04 18:30:44 -0400 (Mon, 04 Aug 2008)
New Revision: 9903
Modified:
trunk/ui/modal-panel/src/main/config/component/modalPanel.xml
trunk/ui/modal-panel/src/main/java/org/richfaces/component/UIModalPanel.java
trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/css/modalPanel.xcss
trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
trunk/ui/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx
Log:
https://jira.jboss.org/jira/browse/RF-4022
Modified: trunk/ui/modal-panel/src/main/config/component/modalPanel.xml
===================================================================
--- trunk/ui/modal-panel/src/main/config/component/modalPanel.xml 2008-08-04 17:11:21 UTC (rev 9902)
+++ trunk/ui/modal-panel/src/main/config/component/modalPanel.xml 2008-08-04 22:30:44 UTC (rev 9903)
@@ -284,5 +284,11 @@
<name>converter</name>
<classname>javax.faces.convert.Converter</classname>
</property>
+
+ <property>
+ <name>trimOverlayedElements</name>
+ <classname>boolean</classname>
+ <defaultvalue>true</defaultvalue>
+ </property>
</component>
</components>
Modified: trunk/ui/modal-panel/src/main/java/org/richfaces/component/UIModalPanel.java
===================================================================
--- trunk/ui/modal-panel/src/main/java/org/richfaces/component/UIModalPanel.java 2008-08-04 17:11:21 UTC (rev 9902)
+++ trunk/ui/modal-panel/src/main/java/org/richfaces/component/UIModalPanel.java 2008-08-04 22:30:44 UTC (rev 9903)
@@ -28,13 +28,10 @@
import javax.el.ValueExpression;
import javax.faces.FacesException;
import javax.faces.component.UIInput;
-import javax.faces.context.FacesContext;
import javax.faces.el.ValueBinding;
import org.richfaces.json.JSONException;
import org.richfaces.json.JSONMap;
-import org.richfaces.skin.Skin;
-import org.richfaces.skin.SkinFactory;
/**
* JSF component class
@@ -90,6 +87,9 @@
public abstract String getTridentIVEngineSelectBehavior();
public abstract void setTridentIVEngineSelectBehavior(String tridentIVEngineSelectBehavior);
+ public abstract boolean isTrimOverlayedElements();
+ public abstract void setTrimOverlayedElements(boolean trim);
+
public boolean getRendersChildren() {
return true;
}
Modified: trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/css/modalPanel.xcss
===================================================================
--- trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/css/modalPanel.xcss 2008-08-04 17:11:21 UTC (rev 9902)
+++ trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/css/modalPanel.xcss 2008-08-04 22:30:44 UTC (rev 9903)
@@ -5,6 +5,24 @@
xmlns="http://www.w3.org/1999/xhtml">
<f:verbatim>
+ .dr-mpnl-ovf-hd {
+ overflow: hidden;
+ }
+
+ .dr-mpnl-trim {
+ position: relative;
+ z-index: 0;
+ }
+
+ .dr-mpnl-iframe {
+ position: absolute;
+ left: 0px;
+ top: 0px;
+ background-color: white;
+ overflow-y: hidden;
+ z-index: -1;
+ }
+
.dr-mpnl-mask-div {
position: fixed;
top: 0;
Modified: trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
===================================================================
--- trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2008-08-04 17:11:21 UTC (rev 9902)
+++ trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2008-08-04 22:30:44 UTC (rev 9903)
@@ -491,7 +491,7 @@
this.iframe = this.id.id + "IFrame";
new Insertion.Top(eCdiv,
"<iframe src=\"javascript:''\" frameborder=\"0\" scrolling=\"no\" id=\"" + this.iframe + "\" " +
- "style=\"position: absolute; width: 1px; height: 1px; background-color: white; overflow-y: hidden; z-index: -1;\">" +
+ "class=\"dr-mpnl-iframe\" style=\"width: 1px; height: 1px;\">" +
"</iframe>");
eIframe = $(this.iframe);
Modified: trunk/ui/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx
===================================================================
--- trunk/ui/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx 2008-08-04 17:11:21 UTC (rev 9902)
+++ trunk/ui/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx 2008-08-04 22:30:44 UTC (rev 9903)
@@ -54,12 +54,13 @@
</div>
<div class="dr-mpnl-panel rich-mpnl_panel" >
- <div id="#{clientId}CDiv" style="position: absolute; left: 0px; top: 0px; z-index: 9; text-align: left;">
+ <div id="#{clientId}CDiv" style="position: absolute; left: 0px; top: 0px; z-index: 9;">
+
<div id="#{clientId}ShadowDiv" class="dr-mpnl-shadow rich-mpnl-shadow"
style="#{component.shadowStyle}" >
</div>
- <c:object var="divStyle" type="java.lang.String" />
+ <c:object var="divClass" type="java.lang.String" />
<c:object var="tableStyle" type="java.lang.String" />
<jsp:scriptlet>
@@ -82,16 +83,26 @@
tableStyle += "width: " + (width > 0 ? width : 1) + "px;";
tableStyle += "height: " + (height > 0 ? height : 1) + "px;";
- divStyle = "";
-
+ divClass = "";
+
} else {
tableStyle = "height: 100%; width: 100%;";
- divStyle = "overflow: hidden;";
+ /*
+ overflow: hidden;
+ */
+ divClass = "dr-mpnl-ovf-hd";
+ if (component.isTrimOverlayedElements()) {
+ /*
+ position: relative;
+ z-index: 0;
+ */
+ divClass += " dr-mpnl-trim";
+ }
}
]]>
</jsp:scriptlet>
- <div id="#{clientId}ContentDiv" style="#{divStyle} #{component.attributes['style']}" class="dr-mpnl-pnl rich-mp-content">
+ <div id="#{clientId}ContentDiv" style="#{component.attributes['style']}" class="#{divClass} dr-mpnl-pnl rich-mp-content">
<jsp:scriptlet>
<![CDATA[if(component.getFacet("controls")!=null && component.getFacet("controls").isRendered()) {]]>
</jsp:scriptlet>
@@ -125,6 +136,7 @@
</td>
</tr>
</table>
+ </div>
<jsp:scriptlet>
<![CDATA[
@@ -149,8 +161,6 @@
]]>
</jsp:scriptlet>
-
- </div>
</div>
</div>
<div class="dr-mpnl-mask-div dr-mpnl-mask-div-transparent rich-mpnl-mask-div" id="#{clientId}CursorDiv"
16 years, 7 months
JBoss Rich Faces SVN: r9902 - trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2008-08-04 13:11:21 -0400 (Mon, 04 Aug 2008)
New Revision: 9902
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxFormTest.java
Log:
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxFormTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxFormTest.java 2008-08-04 16:51:09 UTC (rev 9901)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxFormTest.java 2008-08-04 17:11:21 UTC (rev 9902)
@@ -122,12 +122,7 @@
}
private void resetTestData() {
- String id = getParentId() + "_form:reset";
- selenium.highlight(id);
- isPresentById(id);
- delay(1000);
- clickAjaxCommandAndWait(id);
- delay(1000);
+ clickAjaxCommandAndWait(getParentId() + "_form:reset");
}
public String getTestUrl() {
16 years, 7 months
JBoss Rich Faces SVN: r9901 - in trunk/test-applications/seleniumTest/src: main/webapp/pages/ajaxForm and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2008-08-04 12:51:09 -0400 (Mon, 04 Aug 2008)
New Revision: 9901
Modified:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JFormTestBean.java
trunk/test-applications/seleniumTest/src/main/webapp/pages/ajaxForm/ajaxFormTest.xhtml
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxFormTest.java
Log:
ajaxForm test fixed
Modified: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JFormTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JFormTestBean.java 2008-08-04 15:25:02 UTC (rev 9900)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JFormTestBean.java 2008-08-04 16:51:09 UTC (rev 9901)
@@ -3,15 +3,15 @@
public class A4JFormTestBean {
private String name = "before submit";
-
+
private Boolean ajaxSubmit;
-
+
private Boolean ignoreDupResponses;
-
+
private Boolean prependId;
-
+
private String rerender = "";
-
+
private Boolean rendered = false;
public String getRerender() {
@@ -61,9 +61,19 @@
public void setRendered(Boolean rendered) {
this.rendered = rendered;
}
-
+
public void changeName() {
- this.name = "after submit";
+ this.name = "after submit";
}
-
+
+ public String reset() {
+ name = "before submit";
+ ajaxSubmit = false;
+ ignoreDupResponses = false;
+ prependId = false;
+ rerender = "";
+ rendered = false;
+ return null;
+ }
+
}
Modified: trunk/test-applications/seleniumTest/src/main/webapp/pages/ajaxForm/ajaxFormTest.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/src/main/webapp/pages/ajaxForm/ajaxFormTest.xhtml 2008-08-04 15:25:02 UTC (rev 9900)
+++ trunk/test-applications/seleniumTest/src/main/webapp/pages/ajaxForm/ajaxFormTest.xhtml 2008-08-04 16:51:09 UTC (rev 9901)
@@ -58,6 +58,10 @@
<a4j:commandButton id= "submit2" value="Submit" reRender="group2"/>
</a4j:form>
</h:panelGroup>
+ <h:form id="_form">
+ <br/>
+ <a4j:commandButton id="reset" action="#{formBean.reset}" value="Reset"/>
+ </h:form>
</ui:define>
</ui:composition>
</html>
\ No newline at end of file
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxFormTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxFormTest.java 2008-08-04 15:25:02 UTC (rev 9900)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxFormTest.java 2008-08-04 16:51:09 UTC (rev 9901)
@@ -6,116 +6,131 @@
import org.testng.annotations.Test;
public class AjaxFormTest extends SeleniumTestBase {
-
+
private final static String TEST_URL = "pages/ajaxForm/ajaxFormTest.xhtml";
-
+
private final static String FORM_ID = "a4j_form";
-
+
private static final String STANDART_FORM = "staticForm";
-
+
private final static String INNER_INPUT_ID = "inner_name";
-
+
private final static String OUTER_INPUT_ID = "outer_name";
-
+
private final static String TEST_FIELD_ID = "test_field_name";
-
+
private final static String BUTTON_ID = "submit";
-
+
private final static String PREV_TEXT = "before submit";
-
+
private final static String NEXT_TEXT = "after submit";
-
+
private final static String CHECK_ID_AJAXSUBMIT = "ajaxSubmit";
-
+
private final static String CHECK_ID_IGNOREDUPRESPONSES = "ignoreDupResponses";
-
+
private final static String CHECK_ID_PREPENDID = "prependId";
-
+
private final static String CHECK_ID_RENDERED = "rendered";
-
+
private final static String PANEL_GROUP = "content";
-
+
private final static String RERENDER_ID = "rerender";
-
+
private final static String LINK_ID = "link";
@Test
public void testAttrAjaxSubmit(Template template) throws Exception {
- renderPage(template);
+ renderPage(template);
- //clickOnCheckbox(CHECK_ID_AJAXSUBMIT, BUTTON_ID);
- test(BUTTON_ID, INNER_INPUT_ID, STANDART_FORM.concat(":").concat(OUTER_INPUT_ID), TEST_FIELD_ID, true, null, null, null, "testAttrAjaxSubmit");
+ // clickOnCheckbox(CHECK_ID_AJAXSUBMIT, BUTTON_ID);
+ test(BUTTON_ID, INNER_INPUT_ID, STANDART_FORM.concat(":").concat(OUTER_INPUT_ID), TEST_FIELD_ID, true, null,
+ null, null, "testAttrAjaxSubmit");
+
+ resetTestData();
}
@Test
public void testAttrPrependId(Template template) {
- renderPage(template);
+ renderPage(template);
- if (!PREV_TEXT.equals(getValueById(getFullComponentId(INNER_INPUT_ID, "1")))) {
- assertFail(null, null, true, null, "testAttrPrependId");
- }
+ if (!PREV_TEXT.equals(getValueById(getFullComponentId(INNER_INPUT_ID, "1")))) {
+ assertFail(null, null, true, null, "testAttrPrependId");
+ }
+
+ resetTestData();
}
- /*@Test
- public void testAttrIgnoreDupResponses() {
- //TODO: will be implemented in future
- }*/
-
- /*@Test
- public void testAttrTimeout() {
- //TODO: will be implemented in future
- }*/
+ /*
+ * @Test public void testAttrIgnoreDupResponses() { //TODO: will be
+ * implemented in future }
+ */
+ /*
+ * @Test public void testAttrTimeout() { //TODO: will be implemented in
+ * future }
+ */
+
@Test
public void testProcessingLinks(Template template) {
- renderPage(template);
+ renderPage(template);
- clickOnCheckbox(CHECK_ID_RENDERED, BUTTON_ID, "2");
- clickById(LINK_ID.concat("2"));
- waitForAjaxCompletion();
- if (!NEXT_TEXT.equals(getTextById(TEST_FIELD_ID.concat("2")))) {
- assertFail(null, null, null, null, "testProcessingLinks");
- }
+ clickOnCheckbox(CHECK_ID_RENDERED, BUTTON_ID, "2");
+ clickById(getParentId() + LINK_ID.concat("2"));
+ waitForAjaxCompletion();
+ if (!NEXT_TEXT.equals(getTextById(getParentId() + TEST_FIELD_ID.concat("2")))) {
+ assertFail(null, null, null, null, "testProcessingLinks");
+ }
+
+ resetTestData();
}
private String getFullComponentId(String componentId, String index) {
- return FORM_ID.concat(index).concat(":").concat(componentId.concat(index));
+ return getParentId() + FORM_ID + index + ":" + componentId + index;
}
-
+
private boolean isAjaxSubmitSuccessfull(String innerInputId, String outerInputId) {
- String innerText = getTextById(innerInputId);
- String outerText = getValueById(outerInputId);
- return (NEXT_TEXT.equals(innerText) && (PREV_TEXT.equals(outerText)));
+ String innerText = getTextById(getParentId() + innerInputId);
+ String outerText = getValueById(getParentId() + outerInputId);
+ return (NEXT_TEXT.equals(innerText) && (PREV_TEXT.equals(outerText)));
}
-
+
private void submitForm(String buttonId) {
- clickById(buttonId);
- waitForAjaxCompletion();
+ writeStatus("Submit form");
+ clickAjaxCommandAndWait(getParentId() + buttonId);
}
-
+
private void test(String buttonId, String innerInputId, String outerInputId, String testInputId,
- Boolean ajaxSubmit, Boolean ignoreDupResponses,
- Integer timeout, Boolean prependId, String testName) {
- setValueById(innerInputId, NEXT_TEXT);
- submitForm(buttonId);
- if (!isAjaxSubmitSuccessfull(testInputId, outerInputId)) {
- assertFail(ajaxSubmit, ignoreDupResponses, prependId, timeout, testName);
- }
+ Boolean ajaxSubmit, Boolean ignoreDupResponses, Integer timeout, Boolean prependId, String testName) {
+ setValueById(getParentId() + innerInputId, NEXT_TEXT);
+ submitForm(buttonId);
+ if (!isAjaxSubmitSuccessfull(testInputId, outerInputId)) {
+ assertFail(ajaxSubmit, ignoreDupResponses, prependId, timeout, testName);
+ }
}
-
- private void assertFail(Boolean ajaxSubmit, Boolean ignoreDupResponses, Boolean prependId, Integer timeout, String testName) {
- Assert.fail("<a4j:form> [ajaxSubmit=" + ajaxSubmit + " ; ignoreDupResponses="
- + ignoreDupResponses + " ; timeout=" + timeout
- + " ; prependId=" + prependId + "] test '" + testName + "' failure.");
+
+ private void assertFail(Boolean ajaxSubmit, Boolean ignoreDupResponses, Boolean prependId, Integer timeout,
+ String testName) {
+ Assert.fail("<a4j:form> [ajaxSubmit=" + ajaxSubmit + " ; ignoreDupResponses=" + ignoreDupResponses
+ + " ; timeout=" + timeout + " ; prependId=" + prependId + "] test '" + testName + "' failure.");
}
-
+
private void clickOnCheckbox(String checkId, String bottonId, String index) {
- clickById(checkId.concat(index));
- clickById(bottonId.concat(index));
- waitForAjaxCompletion();
+ clickById(getParentId() + checkId + index);
+ clickById(getParentId() + bottonId +index);
+ waitForAjaxCompletion();
}
-
+
+ private void resetTestData() {
+ String id = getParentId() + "_form:reset";
+ selenium.highlight(id);
+ isPresentById(id);
+ delay(1000);
+ clickAjaxCommandAndWait(id);
+ delay(1000);
+ }
+
public String getTestUrl() {
- return TEST_URL;
+ return TEST_URL;
}
}
16 years, 7 months
JBoss Rich Faces SVN: r9900 - in trunk/ui/dataTable/src/main: java/org/richfaces/component and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-08-04 11:25:02 -0400 (Mon, 04 Aug 2008)
New Revision: 9900
Modified:
trunk/ui/dataTable/src/main/config/component/dataTable.xml
trunk/ui/dataTable/src/main/config/component/subTable.xml
trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java
Log:
RF-4085
Modified: trunk/ui/dataTable/src/main/config/component/dataTable.xml
===================================================================
--- trunk/ui/dataTable/src/main/config/component/dataTable.xml 2008-08-04 15:03:28 UTC (rev 9899)
+++ trunk/ui/dataTable/src/main/config/component/dataTable.xml 2008-08-04 15:25:02 UTC (rev 9900)
@@ -199,12 +199,6 @@
<classname>java.util.Collection</classname>
<description>Defines a set of columns ids in the sorting order</description>
</property>
- <property hidden="true" existintag="false" exist="false" >
- <name>sortFields</name>
- </property>
- <property hidden="true" existintag="false" exist="false" >
- <name>filterFields</name>
- </property>
<property>
<name>sortMode</name>
<classname>java.lang.String</classname>
Modified: trunk/ui/dataTable/src/main/config/component/subTable.xml
===================================================================
--- trunk/ui/dataTable/src/main/config/component/subTable.xml 2008-08-04 15:03:28 UTC (rev 9899)
+++ trunk/ui/dataTable/src/main/config/component/subTable.xml 2008-08-04 15:25:02 UTC (rev 9900)
@@ -192,12 +192,6 @@
</property>
<property hidden="true" existintag="false" exist="false" >
- <name>sortFields</name>
- </property>
- <property hidden="true" existintag="false" exist="false" >
- <name>filterFields</name>
- </property>
- <property hidden="true" existintag="false" exist="false" >
<name>summary</name>
<classname>java.lang.Object</classname>
</property>
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java 2008-08-04 15:03:28 UTC (rev 9899)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java 2008-08-04 15:25:02 UTC (rev 9900)
@@ -48,7 +48,7 @@
* JSF component class
*
*/
-public abstract class UIDataTable extends SequenceDataAdaptor implements Sortable2, Filterable {
+public abstract class UIDataTable extends SequenceDataAdaptor {
Collection<Object> sortPriority = new ArrayList<Object>();
@@ -119,17 +119,19 @@
}
}
sortFields.addAll(sortFieldsMap.values());
- setFilterFields(filterFields);
- setSortFields(sortFields);
ExtendedDataModel dataModel = super.createDataModel();
- AbstractModifiableModel modifiableModel = null;
- if (dataModel instanceof AbstractModifiableModel) {
- modifiableModel = (AbstractModifiableModel)dataModel;
- } else {
- modifiableModel = new ModifiableModel(dataModel, getVar());
+ if ((filterFields != null && !filterFields.isEmpty())
+ || (sortFields != null && !sortFields.isEmpty())) {
+ AbstractModifiableModel modifiableModel = null;
+ if (dataModel instanceof AbstractModifiableModel) {
+ modifiableModel = (AbstractModifiableModel) dataModel;
+ } else {
+ modifiableModel = new ModifiableModel(dataModel, getVar());
+ }
+ modifiableModel.modify(filterFields, sortFields);
+ dataModel = modifiableModel;
}
- modifiableModel.modify(getFilterFields(), getSortFields());
- return modifiableModel;
+ return dataModel;
}
@SuppressWarnings("unchecked")
16 years, 7 months
JBoss Rich Faces SVN: r9899 - trunk/docs/userguide/en/src/main/docbook/modules.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2008-08-04 11:03:28 -0400 (Mon, 04 Aug 2008)
New Revision: 9899
Modified:
trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml
Log:
https://jira.jboss.org/jira/browse/RF-3990
The description of script is added to the Guide.
Modified: trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml 2008-08-04 14:48:26 UTC (rev 9898)
+++ trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml 2008-08-04 15:03:28 UTC (rev 9899)
@@ -3773,6 +3773,85 @@
</section>
+
+
+ <section>
+ <title>Client-side script for extended skinning support</title>
+
+ <para>As it was mentioned earlier in the Guide,
+ extended skinning of standard HTML controls is applied automatically:
+ the browser type is detected and if a browser doesn't fully support
+ extended skinning feature, only basic skinning is applied.
+ </para>
+
+ <para>
+ However, if a develop doesn't want to
+ the rich components and standard HTML
+ controls to be skinned automatically and
+ perform the skinnability implementation himself,
+ he might encounter with a problem, i.e. standard
+ HTML controls in such browsers as Opera and Safari are
+ affected by standard controls skinning featured.
+ (Here you can get more details on how to disable skinnability.)
+ </para>
+
+ <para>
+ In brief, to disable the skinnability mechanism of RichFaces you need to
+ set the "org.richfaces.LoadStyleStrategy" parameter to "NONE" in web.xml.
+
+ </para>
+
+<programlisting role="XML"><![CDATA[...
+<context-param>
+ <param-name>org.richfaces.LoadStyleStrategy</param-name>
+ <param-value>NONE</param-value>
+</context-param>
+...
+]]></programlisting>
+
+ <para>
+ Additionally, you should include the style sheets that perform skinning
+ of the rich component and standard HTML controls.
+ </para>
+
+ <para>
+ In order to resolve the problem with extended skinning in Opera and Safari a client script (skinning.js) is added to the RichFaces library.
+ The script detects the browser type and enables extended skinning only for those browsers that fully support it.
+
+ </para>
+
+ <para>
+ The script can be activated by inserting this JavaScript code to the page:
+ </para>
+
+<programlisting role="XML"><![CDATA[
+<script type="text/javascript">
+window.RICH_FACES_EXTENDED_SKINNING_ON = true;
+</script>
+]]></programlisting>
+
+
+ <para>
+ You also need to specify "media" attribute in the
+ <link> tag which includes the "extended_both.xcss" style sheet with "rich-extended-skinning".
+
+ </para>
+ <para>
+ This is how you can include the style sheets to the page,
+ in case automatic skinnability implementation is disabled.
+
+ </para>
+
+<programlisting role="XML"><![CDATA[
+<link href='/YOUR_PROJECT_NAME/a4j_3_2_2-SNAPSHOTorg/richfaces/renderkit/html/css/basic_both.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__.jsf' type='text/css' rel='stylesheet' class='component' />
+<link media='rich-extended-skinning' href='/ YOUR_PROJECT_NAME /a4j_3_2_2-SNAPSHOTorg/richfaces/renderkit/html/css/extended_both.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__.jsf' type='text/css' rel='stylesheet' class='component' />
+<link href='/ YOUR_PROJECT_NAME /a4j_3_2_2-SNAPSHOT/org/richfaces/skin.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__.jsf' type='text/css' rel='stylesheet' class='component' />
+]]></programlisting>
+
+
+
+ </section>
+
<section id="XCSSfileformat">
<title>XCSS file format</title>
<para>
16 years, 7 months
JBoss Rich Faces SVN: r9898 - trunk/test-applications/jsp/src/main/webapp/WEB-INF.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-08-04 10:48:26 -0400 (Mon, 04 Aug 2008)
New Revision: 9898
Modified:
trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-Converter.xml
Log:
Modified: trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-Converter.xml
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-Converter.xml 2008-08-04 14:48:09 UTC (rev 9897)
+++ trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-Converter.xml 2008-08-04 14:48:26 UTC (rev 9898)
@@ -28,4 +28,8 @@
<converter-id>inplaceInputConverter</converter-id>
<converter-class>util.converter.InplaceInputConverter</converter-class>
</converter>
+ <converter>
+ <converter-id>dateValueConverter</converter-id>
+ <converter-class>util.converter.DateValueConverter</converter-class>
+ </converter>
</faces-config>
16 years, 7 months
JBoss Rich Faces SVN: r9897 - trunk/test-applications/jsp/src/main/webapp/Validator.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-08-04 10:48:09 -0400 (Mon, 04 Aug 2008)
New Revision: 9897
Modified:
trunk/test-applications/jsp/src/main/webapp/Validator/Validator.jsp
trunk/test-applications/jsp/src/main/webapp/Validator/ValidatorProperty.jsp
trunk/test-applications/jsp/src/main/webapp/Validator/ValidatorStraightforward.jsp
Log:
Modified: trunk/test-applications/jsp/src/main/webapp/Validator/Validator.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Validator/Validator.jsp 2008-08-04 14:47:47 UTC (rev 9896)
+++ trunk/test-applications/jsp/src/main/webapp/Validator/Validator.jsp 2008-08-04 14:48:09 UTC (rev 9897)
@@ -93,15 +93,14 @@
</h:selectBooleanCheckbox>
<rich:message for="assertTrue" showDetail="true" showSummary="true" />
</h:panelGroup>
- <%--
+
<h:outputLabel for="dateValue" value="Future validation:" />
<h:panelGroup>
- <h:inputText value="#{validator.dateValue}" id="dateValue">
- <rich:ajaxValidator event="onchange"></rich:ajaxValidator>
+ <h:inputText value="#{validator.dateValue}" id="dateValue" converter="dateValueConverter">
</h:inputText>
<rich:message for="dateValue" showDetail="true" showSummary="true" />
</h:panelGroup>
-
+ <%--
<h:outputLabel for="patternValue" value="Pattern(1234) validation:" />
<h:panelGroup>
<h:inputText value="#{validator.intValue}" id="patternValue">
Modified: trunk/test-applications/jsp/src/main/webapp/Validator/ValidatorProperty.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Validator/ValidatorProperty.jsp 2008-08-04 14:47:47 UTC (rev 9896)
+++ trunk/test-applications/jsp/src/main/webapp/Validator/ValidatorProperty.jsp 2008-08-04 14:48:09 UTC (rev 9897)
@@ -3,9 +3,9 @@
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<f:subview id="validatorPropertySubviewID">
- <h:commandButton value="add(ajaxValidator) test" action="#{validator.add}"></h:commandButton>
+ <a4j:commandButton value="add(ajaxValidator) test" action="#{validator.add}"></a4j:commandButton>
- <h:commandButton value="add(graphValidator) test" action="#{data.add}"></h:commandButton>
+ <a4j:commandButton value="add(graphValidator) test" action="#{data.add}"></a4j:commandButton>
<br />
<br />
<h:panelGrid columns="2" style="display:block; vertical-align:top;">
Modified: trunk/test-applications/jsp/src/main/webapp/Validator/ValidatorStraightforward.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Validator/ValidatorStraightforward.jsp 2008-08-04 14:47:47 UTC (rev 9896)
+++ trunk/test-applications/jsp/src/main/webapp/Validator/ValidatorStraightforward.jsp 2008-08-04 14:48:09 UTC (rev 9897)
@@ -67,4 +67,13 @@
reRender="SizeValidationID"></a4j:commandButton>
</h:panelGroup>
</a4j:region>
+ <br/>
+ <a4j:region>
+ <h:panelGrid columns="2">
+ <h:inputText value="enter some value" required="true" id="beanValidatorInputID">
+ <rich:beanValidator></rich:beanValidator>
+ </h:inputText>
+ <a4j:commandButton value="reRender" onclick="submit();" reRender="beanValidatorInputID"></a4j:commandButton>
+ </h:panelGrid>
+ </a4j:region>
</f:subview>
\ No newline at end of file
16 years, 7 months
JBoss Rich Faces SVN: r9896 - trunk/test-applications/jsp/src/main/java/validator.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-08-04 10:47:47 -0400 (Mon, 04 Aug 2008)
New Revision: 9896
Modified:
trunk/test-applications/jsp/src/main/java/validator/ValidatorBean.java
Log:
Modified: trunk/test-applications/jsp/src/main/java/validator/ValidatorBean.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/validator/ValidatorBean.java 2008-08-04 14:47:24 UTC (rev 9895)
+++ trunk/test-applications/jsp/src/main/java/validator/ValidatorBean.java 2008-08-04 14:47:47 UTC (rev 9896)
@@ -3,6 +3,7 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
+import java.util.Calendar;
import java.util.Date;
import javax.faces.event.ActionEvent;
import javax.faces.model.SelectItem;
@@ -32,7 +33,7 @@
@AssertTrue(message="Asserttrue validation failed!")
private boolean assertTrue;
@Future(message="Future validation failed!")
- private String dateValue;
+ private Calendar dateValue;
@Pattern(regex="^\b1234\b*$") //Searh "1234" as a whole word
private int intValue;
@EAN(message="EAN validation failed")
@@ -242,7 +243,10 @@
this.ajaxSingle = true;
this.text = "mvitenkov(a)exadel.com";
this.intValue = 1234;
- this.dateValue = (new Date()).toString();
+ this.dateValue = Calendar.getInstance();
+ dateValue.set(Calendar.MONTH,8);
+ dateValue.set(Calendar.DATE,5);
+ dateValue.set(Calendar.YEAR,2008);
this.booleanValue = false;
this.ean = "97 81550 41198 0";
this.creditValue = "visa maestro";
@@ -277,7 +281,7 @@
return text;
}
- public String getDateValue() {
+ public Calendar getDateValue() {
return dateValue;
}
@@ -294,7 +298,7 @@
this.booleanValue = booleanValue;
}
- public void setDateValue(String dateValue) {
+ public void setDateValue(Calendar dateValue) {
this.dateValue = dateValue;
}
16 years, 7 months
JBoss Rich Faces SVN: r9895 - trunk/test-applications/jsp/src/main/java/util/converter.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-08-04 10:47:24 -0400 (Mon, 04 Aug 2008)
New Revision: 9895
Modified:
trunk/test-applications/jsp/src/main/java/util/converter/DateValueConverter.java
Log:
Modified: trunk/test-applications/jsp/src/main/java/util/converter/DateValueConverter.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/util/converter/DateValueConverter.java 2008-08-04 14:46:38 UTC (rev 9894)
+++ trunk/test-applications/jsp/src/main/java/util/converter/DateValueConverter.java 2008-08-04 14:47:24 UTC (rev 9895)
@@ -21,7 +21,7 @@
public String getAsString(FacesContext context, UIComponent component,
Object value) throws ConverterException {
Calendar calendar = (Calendar)value;
- return calendar.get(calendar.MONTH) + "/" + calendar.get(calendar.DATE) + "/" + calendar.get(calendar.YEAR);
+ return calendar.get(Calendar.MONTH) + "/" + calendar.get(Calendar.DATE) + "/" + calendar.get(Calendar.YEAR);
}
}
16 years, 7 months