JBoss Rich Faces SVN: r10643 - trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-10-01 10:02:32 -0400 (Wed, 01 Oct 2008)
New Revision: 10643
Modified:
trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
Log:
RF-4472
Modified: trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
===================================================================
--- trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-10-01 13:35:11 UTC (rev 10642)
+++ trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-10-01 14:02:32 UTC (rev 10643)
@@ -1222,7 +1222,14 @@
var query = new A4J.Query(this.progressBar.containerId, this.form);
if (query) {
query.appendFormControls();
- return query.getQueryString();
+ var qStr = query.getQueryString();
+ if (this.parameters) {
+ qStr = (/&$/.test(qStr)) ? qStr : qStr + "&";
+ for (var p in this.parameters) {
+ qStr = qStr + p + "=" + this.parameters[p] + "&";
+ }
+ }
+ return qStr;
}
return '';
},
16 years, 1 month
JBoss Rich Faces SVN: r10642 - trunk/ui/columns/src/main/java/org/richfaces/taglib.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-10-01 09:35:11 -0400 (Wed, 01 Oct 2008)
New Revision: 10642
Modified:
trunk/ui/columns/src/main/java/org/richfaces/taglib/IndexedValueExpression.java
trunk/ui/columns/src/main/java/org/richfaces/taglib/IteratedExpression.java
Log:
RF-4510
Modified: trunk/ui/columns/src/main/java/org/richfaces/taglib/IndexedValueExpression.java
===================================================================
--- trunk/ui/columns/src/main/java/org/richfaces/taglib/IndexedValueExpression.java 2008-10-01 13:23:54 UTC (rev 10641)
+++ trunk/ui/columns/src/main/java/org/richfaces/taglib/IndexedValueExpression.java 2008-10-01 13:35:11 UTC (rev 10642)
@@ -9,12 +9,9 @@
*/
final class IndexedValueExpression extends ValueExpression {
- /**
- *
- */
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 5336307425512629431L;
- private final Integer i;
+ private final Integer i;
private final ValueExpression orig;
Modified: trunk/ui/columns/src/main/java/org/richfaces/taglib/IteratedExpression.java
===================================================================
--- trunk/ui/columns/src/main/java/org/richfaces/taglib/IteratedExpression.java 2008-10-01 13:23:54 UTC (rev 10641)
+++ trunk/ui/columns/src/main/java/org/richfaces/taglib/IteratedExpression.java 2008-10-01 13:35:11 UTC (rev 10642)
@@ -15,9 +15,9 @@
* @author Kin-man Chung
* @version $Id: IteratedExpression.java,v 1.3 2005/12/08 01:20:43 kchung Exp $
*/
-final class IteratedExpression {
- private static final long serialVersionUID = 1L;
- protected final ValueExpression orig;
+final class IteratedExpression implements Serializable{
+ private static final long serialVersionUID = 6133489032098750124L;
+ protected final ValueExpression orig;
protected final String delims;
private Object base;
16 years, 1 month
JBoss Rich Faces SVN: r10641 - trunk/ui/columns/src/main/java/org/richfaces/taglib.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-10-01 09:23:54 -0400 (Wed, 01 Oct 2008)
New Revision: 10641
Modified:
trunk/ui/columns/src/main/java/org/richfaces/taglib/ColumnsHandler.java
Log:
RF-4544
Modified: trunk/ui/columns/src/main/java/org/richfaces/taglib/ColumnsHandler.java
===================================================================
--- trunk/ui/columns/src/main/java/org/richfaces/taglib/ColumnsHandler.java 2008-10-01 12:48:33 UTC (rev 10640)
+++ trunk/ui/columns/src/main/java/org/richfaces/taglib/ColumnsHandler.java 2008-10-01 13:23:54 UTC (rev 10641)
@@ -24,7 +24,6 @@
import org.richfaces.iterator.SimpleForEachIterator;
import com.sun.facelets.FaceletContext;
-import com.sun.facelets.tag.MetaRuleset;
import com.sun.facelets.tag.MetaTagHandler;
import com.sun.facelets.tag.TagAttribute;
import com.sun.facelets.tag.jsf.ComponentConfig;
@@ -59,33 +58,36 @@
/** end attribute */
private TagAttribute end;
- /** Iterator for columns's tag value attribute */
- protected ForEachIterator items; // our 'digested' items
+ class IterationContext {
+
+ /** Iterator for columns's tag value attribute */
+ public ForEachIterator items; // our 'digested' items
+
+ /** Value attribute value */
+ public Object rawItems; // our 'raw' items
+
+ /** Var attr - defines page variable for current item */
+ public String _indexId;
+
+ /** Integer value begin attr */
+ public Integer _begin;
+
+ /** Integer value end attr */
+ public Integer _end;
+
+ /** Integer value of end attr. */
+ public Integer _columns;
+
+ /** String value of var attr */
+ public String _itemId = null;
+
+ /** Current column counter */
+ public Integer _index = 0;
+
+ /** Expression for var item */
+ public IteratedExpression iteratedExpression;
+ };
- /** Value attribute value */
- protected Object rawItems; // our 'raw' items
-
- /** Var attr - defines page variable for current item */
- private String _indexId;
-
- /** Integer value begin attr */
- private Integer _begin;
-
- /** Integer value end attr */
- private Integer _end;
-
- /** Integer value of end attr. */
- private Integer _columns;
-
- /** String value of var attr */
- private String _itemId = null;
-
- /** Current column counter */
- private Integer _index = 0;
-
- /** Expression for var item */
- private IteratedExpression iteratedExpression;
-
/**
* TODO Description goes here.
*
@@ -99,12 +101,12 @@
/**
* Extracts tags attributes values
*/
- private void initVariables(FaceletContext ctx) {
- initColumnsCount(ctx);
- initIndex(ctx);
- initVar(ctx);
- initBegin(ctx);
- initEnd(ctx);
+ private void initVariables(FaceletContext ctx, IterationContext itContext) {
+ initColumnsCount(ctx, itContext);
+ initIndex(ctx, itContext);
+ initVar(ctx, itContext);
+ initBegin(ctx, itContext);
+ initEnd(ctx, itContext);
}
/**
@@ -112,9 +114,9 @@
*
* @throws JspTagException
*/
- private void prepare(FaceletContext ctx) {
+ private void prepare(FaceletContext ctx, IterationContext itContext) {
- initVariables(ctx);
+ initVariables(ctx, itContext);
try {
@@ -125,34 +127,34 @@
// If this is a deferred expression, make a note and get
// the 'items' instance.
- rawItems = value.getObject(ctx);
+ itContext.rawItems = value.getObject(ctx);
// extract an iterator over the 'items' we've got
- items = SimpleForEachIterator
- .supportedTypeForEachIterator(rawItems);
+ itContext.items = SimpleForEachIterator
+ .supportedTypeForEachIterator(itContext.rawItems);
} else {
// no 'items', so use 'begin' and 'end'
- items = SimpleForEachIterator
- .beginEndForEachIterator(_columns - 1);
+ itContext.items = SimpleForEachIterator
+ .beginEndForEachIterator(itContext._columns - 1);
}
} catch (Exception e) {
// TODO: handle exception
}
- correctFirst(ctx);
+ correctFirst(ctx, itContext);
}
/**
* Inits first iteration item
*/
- private void correctFirst(FaceletContext ctx) {
- if (items != null) {
- if (_begin > 0 && (_index < _begin)) {
- while ((_index < _begin && hasNext())) {
- next(ctx);
+ private void correctFirst(FaceletContext ctx, IterationContext itContext) {
+ if (itContext.items != null) {
+ if (itContext._begin > 0 && (itContext._index < itContext._begin)) {
+ while ((itContext._index < itContext._begin && hasNext(itContext))) {
+ next(ctx, itContext);
}
- if (!hasNext()) {
- _index = 0;
+ if (!hasNext(itContext)) {
+ itContext._index = 0;
}
}
}
@@ -164,12 +166,12 @@
* @return
* @throws JspTagException
*/
- private boolean hasNext() {
+ private boolean hasNext(IterationContext itContext) {
try {
- if (_end != 0) {
- return (_index < _end) ? items.hasNext() : false;
+ if (itContext._end != 0) {
+ return (itContext._index < itContext._end) ? itContext.items.hasNext() : false;
} else {
- return items.hasNext();
+ return itContext.items.hasNext();
}
} catch (Exception e) {
return false;
@@ -183,10 +185,10 @@
* @return
* @throws JspTagException
*/
- private Object next(FaceletContext ctx) {
+ private Object next(FaceletContext ctx, IterationContext itContext) {
try {
- Object o = items.next();
- _index++;
+ Object o = itContext.items.next();
+ itContext._index++;
return o;
} catch (Exception e) {
return null;
@@ -196,81 +198,81 @@
/**
* Extracts integer value from end attr
*/
- private void initColumnsCount(FaceletContext ctx) {
+ private void initColumnsCount(FaceletContext ctx, IterationContext itContext) {
this.columns = getAttribute("columns");
if (columns != null) {
try {
- _columns = Integer.parseInt((String) columns.getObject(ctx));
- if (_columns < 0) {
- _columns = 0; // If end is negative set up zero
+ itContext._columns = Integer.parseInt((String) columns.getObject(ctx));
+ if (itContext._columns < 0) {
+ itContext._columns = 0; // If end is negative set up zero
}
} catch (Exception e) {
- _columns = 0;
+ itContext._columns = 0;
}
} else {
- _columns = 0;
+ itContext._columns = 0;
}
}
/**
* Extracts integer value from begin attr
*/
- private void initBegin(FaceletContext ctx) {
+ private void initBegin(FaceletContext ctx, IterationContext itContext) {
this.begin = getAttribute("begin");
if (begin != null) {
try {
Object o = begin.getObject(ctx);
if (o instanceof Number) {
- _begin = ((Number)o).intValue();
+ itContext._begin = ((Number)o).intValue();
}else if (o instanceof String) {
- _begin = Integer.parseInt((String) o);
+ itContext._begin = Integer.parseInt((String) o);
}
- _begin--;
- if (_begin < 0) {
- _begin = 0; // If end is negative set up zero
+ itContext._begin--;
+ if (itContext._begin < 0) {
+ itContext._begin = 0; // If end is negative set up zero
}
} catch (Exception e) {
- _begin = 0;
+ itContext._begin = 0;
}
} else {
- _begin = 0;
+ itContext._begin = 0;
}
}
/**
* Extracts integer value from end attr
*/
- private void initEnd(FaceletContext ctx) {
+ private void initEnd(FaceletContext ctx, IterationContext itContext) {
this.end = getAttribute("end");
if (end != null) {
try {
Object o = end.getObject(ctx);
if (o instanceof Number) {
- _end = ((Number)o).intValue();
+ itContext._end = ((Number)o).intValue();
}else if ( o instanceof String) {
- _end = Integer.parseInt((String) o);
+ itContext._end = Integer.parseInt((String) o);
}
- if (_end < 0) {
- _end = 0; // If end is negative set up zero
+ if (itContext._end < 0) {
+ itContext._end = 0; // If end is negative set up zero
}
} catch (Exception e) {
- _end = 0;
+ itContext._end = 0;
}
} else {
- _end = 0;
+ itContext._end = 0;
}
}
/**
* Extracts string value from var attr
*/
- private void initVar(FaceletContext ctx) {
+ private void initVar(FaceletContext ctx, IterationContext itContext) {
this.var = getAttribute("var");
if (var != null) {
try {
- _itemId = (String) var.getObject(ctx);
+ itContext._itemId = (String) var.getObject(ctx);
} catch (ClassCastException e) {
- _itemId = null;
+ itContext._itemId = null;
}
}
@@ -279,13 +281,13 @@
/**
* Extracts string value from index attr
*/
- private void initIndex(FaceletContext ctx) {
+ private void initIndex(FaceletContext ctx, IterationContext itContext) {
this.index = getAttribute("index");
if (index != null) {
try {
- _indexId = (String) index.getObject(ctx);
+ itContext._indexId = (String) index.getObject(ctx);
} catch (ClassCastException e) {
- _indexId = null;
+ itContext._indexId = null;
}
}
@@ -297,21 +299,22 @@
//@Override
public void apply(FaceletContext ctx, UIComponent parent)
throws IOException, FacesException, ELException {
-
- prepare(ctx); // prepare data
+ IterationContext iterationContext = new IterationContext();
+
+ prepare(ctx, iterationContext); // prepare data
try {
- while (hasNext()) { // for each
- exposeVariables(ctx, _index);
+ while (hasNext(iterationContext)) { // for each
+ exposeVariables(ctx, iterationContext);
//super.apply(ctx, parent);
handler.apply(ctx, parent);
- next(ctx);
+ next(ctx, iterationContext);
}
} catch (Exception e) {
// TODO: handle exception
} finally {
- release();
- unExposeVariables(ctx);
+ release(iterationContext);
+ unExposeVariables(ctx, iterationContext);
}
}
@@ -329,17 +332,18 @@
*
* @throws JspTagException
*/
- private void exposeVariables(FaceletContext ctx, int k) {
+ private void exposeVariables(FaceletContext ctx, IterationContext itContext) {
VariableMapper vm = ctx.getVariableMapper();
+ int k = itContext._index;
- if (_itemId != null) {
+ if (itContext._itemId != null) {
if (vm != null) {
if (value != null) {
ValueExpression srcVE = value.getValueExpression(ctx,
Object.class);
- ValueExpression ve = getVarExpression(ctx, srcVE, k);
- vm.setVariable(_itemId, ve);
+ ValueExpression ve = getVarExpression(ctx, srcVE, itContext);
+ vm.setVariable(itContext._itemId, ve);
}
}
@@ -347,10 +351,10 @@
// Set up index variable
- if (_indexId != null) {
+ if (itContext._indexId != null) {
if (vm != null) {
ValueExpression ve = new IteratedIndexExpression(k);
- vm.setVariable(_indexId, ve);
+ vm.setVariable(itContext._indexId, ve);
}
}
@@ -361,16 +365,16 @@
* Removes page attributes that we have exposed and, if applicable, restores
* them to their prior values (and scopes).
*/
- private void unExposeVariables(FaceletContext ctx) {
+ private void unExposeVariables(FaceletContext ctx, IterationContext itContext) {
VariableMapper vm = ctx.getVariableMapper();
// "nested" variables are now simply removed
- if (_itemId != null) {
+ if (itContext._itemId != null) {
if (vm != null)
- vm.setVariable(_itemId, null);
+ vm.setVariable(itContext._itemId, null);
}
- if (_indexId != null) {
+ if (itContext._indexId != null) {
if (vm != null)
- vm.setVariable(_indexId, null);
+ vm.setVariable(itContext._indexId, null);
}
}
@@ -381,8 +385,9 @@
* @return
*/
private ValueExpression getVarExpression(FaceletContext ctx,
- ValueExpression expr, int k) {
+ ValueExpression expr, IterationContext itContext) {
Object o = expr.getValue(ctx.getFacesContext().getELContext());
+ int k = itContext._index;
if (o.getClass().isArray() || o instanceof List) {
return new IndexedValueExpression(expr, k);
}
@@ -391,10 +396,10 @@
|| o instanceof Enumeration || o instanceof Map
|| o instanceof String) {
- if (iteratedExpression == null) {
- iteratedExpression = new IteratedExpression(expr, ",");
+ if (itContext.iteratedExpression == null) {
+ itContext.iteratedExpression = new IteratedExpression(expr, ",");
}
- return new IteratedValueExpression(iteratedExpression, k);
+ return new IteratedValueExpression(itContext.iteratedExpression, k);
}
throw new ELException("FOREACH_BAD_ITEMS");
@@ -403,9 +408,9 @@
/**
* Release iteration variables
*/
- private void release() {
- this.items = null;
- this._index = 0;
+ private void release(IterationContext itContext) {
+ itContext.items = null;
+ itContext._index = 0;
}
}
16 years, 1 month
JBoss Rich Faces SVN: r10640 - in trunk/test-applications/seleniumTest/richfaces/src: test/java/org/richfaces/testng and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2008-10-01 08:48:33 -0400 (Wed, 01 Oct 2008)
New Revision: 10640
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxStatus/ajaxStatusTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxStatusTest.java
Log:
AjaxStatus: test rendered component attribute
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxStatus/ajaxStatusTest.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxStatusTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxStatusTest.java 2008-10-01 12:29:54 UTC (rev 10639)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxStatusTest.java 2008-10-01 12:48:33 UTC (rev 10640)
@@ -11,6 +11,8 @@
private static final String STATUS_2_ID = "region2:status";
+ private static final String STATUS_3_ID = "region3:status";
+
private static final String BTN_1_ID = "button1";
private static final String BTN_2_ID = "button2";
@@ -89,6 +91,14 @@
}
+ @Test
+ public void testRenderedComponentAttribute(Template template) {
+ renderPage(template);
+
+ writeStatus("Check the component with rendered = false is not present on the page");
+ AssertNotPresent(getParentId() + "_form:" + STATUS_3_ID);
+ }
+
public String getTestUrl() {
return "pages/ajaxStatus/ajaxStatusTest.xhtml";
}
16 years, 1 month
JBoss Rich Faces SVN: r10639 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: atsebro
Date: 2008-10-01 08:29:54 -0400 (Wed, 01 Oct 2008)
New Revision: 10639
Modified:
trunk/docs/userguide/en/src/main/docbook/included/tab.xml
trunk/docs/userguide/en/src/main/docbook/included/tabPanel.xml
Log:
RF-3560: Style class attributes
Modified: trunk/docs/userguide/en/src/main/docbook/included/tab.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/tab.xml 2008-10-01 12:16:56 UTC (rev 10638)
+++ trunk/docs/userguide/en/src/main/docbook/included/tab.xml 2008-10-01 12:29:54 UTC (rev 10639)
@@ -1,54 +1,54 @@
<?xml version='1.0' encoding='UTF-8'?>
<section>
-<sectioninfo>
-<keywordset>
-<keyword>rich:tab</keyword>
-<keyword>HtmlTab</keyword>
-</keywordset>
-</sectioninfo>
-
- <table>
- <title>Component identification parameters</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Name</entry>
- <entry>Value</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>component-type</entry>
- <entry>org.richfaces.Tab</entry>
- </row>
- <row>
- <entry>component-class</entry>
- <entry>org.richfaces.component.html.HtmlTab</entry>
- </row>
- <row>
- <entry>component-family</entry>
- <entry>org.richfaces.Tab</entry>
- </row>
- <row>
- <entry>renderer-type</entry>
- <entry>org.richfaces.TabRenderer</entry>
- </row>
- <row>
- <entry>tag-class</entry>
- <entry>org.richfaces.taglib.TabTag</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
- <section>
- <title>Creating the Component with a Page Tag</title>
- <para>To create the simplest variant on a page use the following syntax:</para>
+ <sectioninfo>
+ <keywordset>
+ <keyword>rich:tab</keyword>
+ <keyword>HtmlTab</keyword>
+ </keywordset>
+ </sectioninfo>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
+ <table>
+ <title>Component identification parameters</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>component-type</entry>
+ <entry>org.richfaces.Tab</entry>
+ </row>
+ <row>
+ <entry>component-class</entry>
+ <entry>org.richfaces.component.html.HtmlTab</entry>
+ </row>
+ <row>
+ <entry>component-family</entry>
+ <entry>org.richfaces.Tab</entry>
+ </row>
+ <row>
+ <entry>renderer-type</entry>
+ <entry>org.richfaces.TabRenderer</entry>
+ </row>
+ <row>
+ <entry>tag-class</entry>
+ <entry>org.richfaces.taglib.TabTag</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <section>
+ <title>Creating the Component with a Page Tag</title>
+ <para>To create the simplest variant on a page use the following syntax:</para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
<rich:tabPanel>
<!--Set of Tabs inside-->
<rich:tab>
@@ -57,28 +57,38 @@
</rich:tabPanel>
...
]]></programlisting>
- </section>
- <section>
- <title>Creating the Component Dynamically Using Java</title>
+ </section>
+ <section>
+ <title>Creating the Component Dynamically Using Java</title>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="JAVA"><![CDATA[import org.richfaces.component.html.HtmlTab;
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="JAVA"><![CDATA[import org.richfaces.component.html.HtmlTab;
...
HtmlTab myTab = new HtmlTab();
...
]]></programlisting>
- </section>
- <section>
- <title>Details of Usage</title>
- <para>The main component function is to define a content group that is rendered and processed when the <property>tab</property> is active, i.e. click on a <property>tab</property> causes switching onto a <property>tab</property> containing content corresponded to this <property>tab</property>.</para>
- <para>The <emphasis ><property>"label"</property></emphasis > attribute defines text to be represented. If you can use the
- <emphasis><property>"label"</property></emphasis> facet, you can even not use the <emphasis ><property>"label"</property></emphasis > attribute.</para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
+ </section>
+ <section>
+ <title>Details of Usage</title>
+ <para>The main component function is to define a content group that is rendered
+ and processed when the <property>tab</property> is active, i.e. click
+ on a <property>tab</property> causes switching onto a
+ <property>tab</property> containing content corresponded to this
+ <property>tab</property>.</para>
+ <para>The <emphasis>
+ <property>"label"</property>
+ </emphasis> attribute defines text to be represented. If you can use
+ the <emphasis>
+ <property>"label"</property>
+ </emphasis> facet, you can even not use the <emphasis>
+ <property>"label"</property>
+ </emphasis> attribute.</para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
<rich:tab>
<f:facet name="label">
<h:graphicImage value="/images/img1.png"/>
@@ -90,12 +100,18 @@
...
]]></programlisting>
- <para>A marker on a <property>tab</property> header defined with the <emphasis ><property>"label"</property></emphasis> attribute. Moreover, each <property>tab</property> could be disabled (switching on this <property>tab</property> is impossible) with the <emphasis ><property>"disable"</property></emphasis> attribute.</para>
+ <para>A marker on a <property>tab</property> header defined with the <emphasis>
+ <property>"label"</property>
+ </emphasis> attribute. Moreover, each <property>tab</property> could
+ be disabled (switching on this <property>tab</property> is impossible)
+ with the <emphasis>
+ <property>"disable"</property>
+ </emphasis> attribute.</para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
<rich:tabPanel width="20%">
<tabs:tab label="Canon">
<h:outputText value="Canon EOS Digital Rebel XT" />
@@ -112,37 +128,66 @@
<tabs:tab disabled="true" name="disabled" label="Disabled"/>
</rich:tabPanel>
...]]></programlisting>
-<para>With this example it's possible to generate the <property>tab panel</property>
- with the last disabled and three active <property>tabs</property> (see the picture).</para>
-<figure>
- <title><emphasis role="bold"><property><rich:tabPanel></property></emphasis> with disabled <emphasis role="bold"><property><rich:tab></property></emphasis></title>
-<mediaobject>
- <imageobject>
- <imagedata fileref="images/tab2.png"/>
- </imageobject>
-</mediaobject>
- </figure>
-<para>Switching mode could be defined not only for the whole panel <property>tab</property>, but also
-for each particular <property>tab</property>, i.e. switching onto one <property>tab</property> could be
- performed right on the client with the corresponding JavaScript and onto another
- <property>tab</property> with an Ajax request on the server. <property>Tab</property> switching modes
- are the same as <property>tabPanel</property> ones.</para>
-<para>Each <property>tab</property> also has an attribute name (alias for <emphasis ><property>"id"</property></emphasis> attribute). Using this attribute value it's possible e.g. to set an active <property>tab</property> on a model level specifying this name in the corresponding attribute of the whole <property>tab</property>.</para>
-<para>Except the specific component attributes it has all necessary attributes for JavaScript event definition.</para>
-<itemizedlist>
- <listitem><para> <emphasis><property>"onmouseover"</property></emphasis> </para></listitem>
- <listitem><para> <emphasis><property>"onmouseout"</property></emphasis> </para></listitem>
- <listitem><para>
- etc.
- </para></listitem>
-</itemizedlist>
- <para>
- Some event could be performed on the tab which has been entered/left using <emphasis><property>"ontabenter"</property></emphasis>/<emphasis><property>"ontableave"</property></emphasis> attributes. See the example below.</para>
+ <para>With this example it's possible to generate the <property>tab
+ panel</property> with the last disabled and three active
+ <property>tabs</property> (see the picture).</para>
+ <figure>
+ <title><emphasis role="bold">
+ <property><rich:tabPanel></property>
+ </emphasis> with disabled <emphasis role="bold">
+ <property><rich:tab></property>
+ </emphasis></title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/tab2.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Switching mode could be defined not only for the whole panel
+ <property>tab</property>, but also for each particular
+ <property>tab</property>, i.e. switching onto one
+ <property>tab</property> could be performed right on the client with
+ the corresponding JavaScript and onto another <property>tab</property>
+ with an Ajax request on the server. <property>Tab</property> switching
+ modes are the same as <property>tabPanel</property> ones.</para>
+ <para>Each <property>tab</property> also has an attribute name (alias for <emphasis>
+ <property>"id"</property>
+ </emphasis> attribute). Using this attribute value it's
+ possible e.g. to set an active <property>tab</property> on a model
+ level specifying this name in the corresponding attribute of the whole
+ <property>tab</property>.</para>
+ <para>Except the specific component attributes it has all necessary attributes
+ for JavaScript event definition.</para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis>
+ <property>"onmouseover"</property>
+ </emphasis>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>
+ <property>"onmouseout"</property>
+ </emphasis>
+ </para>
+ </listitem>
+ <listitem>
+ <para> etc. </para>
+ </listitem>
+ </itemizedlist>
+ <para> Some event could be performed on the tab which has been entered/left
+ using <emphasis>
+ <property>"ontabenter"</property>
+ </emphasis>/<emphasis>
+ <property>"ontableave"</property>
+ </emphasis> attributes. See the example below.</para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
<rich:tabPanel>
<rich:tab label="Tab1" ontabenter="alert()">
...
@@ -150,269 +195,293 @@
...
</rich:tabPanel>
...]]></programlisting>
- <para>
- The following example shows how on the client side to get the names of <code>entered</code>/<code>left</code> tabs.
- </para>
- <programlisting role="JAVA"><![CDATA[ontabenter="alert(leftTabName)"]]></programlisting>
- <para>
- Information about the <emphasis><property>"process"</property></emphasis> attribute usage you can find <link linkend="process">here</link>.
- </para>
- </section>
- <section>
- <title>Look-and-Feel Customization</title>
-
- <para>For skinnability implementation, the components use a <emphasis>
- <property>style class redefinition method.</property>
- </emphasis> Default style classes are mapped on <emphasis>
- <property>skin parameters.</property>
- </emphasis></para>
-
- <note><title>Note:</title><para>
- A panel appearance and content is defined with a <property>tab</property> panel i.e. on the <property>tab</property> level it's possible to define only an appearance of this <property>tab</property> header.
- </para>
- </note>
-
- <para>There are two ways to redefine the appearance of all <emphasis role="bold">
- <property><rich:tab></property>
- </emphasis> components at once:</para>
-
- <itemizedlist>
- <listitem>
- <para>Redefine the corresponding skin parameters</para>
- </listitem>
-
- <listitem>
- <para>Add to your style sheets <emphasis>
- <property>style classes</property>
- </emphasis> used by a <emphasis role="bold">
- <property><rich:tab></property>
- </emphasis> component</para>
- </listitem>
- </itemizedlist>
- </section>
-
- <section>
- <title>Skin Parameters Redefinition</title>
- <table>
- <title>Skin parameters redefinition for a tab header</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Skin parameters</entry>
- <entry>CSS properties</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>generalTextColor</entry>
- <entry>color</entry>
- </row>
- <row>
- <entry>generalSizeFont</entry>
- <entry>font-size</entry>
- </row>
- <row>
- <entry>generalFamilyFont</entry>
- <entry>font-family</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <table>
- <title>Skin parameters redefinition for an active tab</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Skin parameters</entry>
- <entry>CSS properties</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>generalTextColor</entry>
- <entry>color</entry>
- </row>
- <row>
- <entry>subBorderColor</entry>
- <entry>border-color</entry>
- </row>
- <row>
- <entry>generalBackgroundColor</entry>
- <entry>background-color</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
- <table>
- <title>Skin parameters redefinition for an inactive tab</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Skin parameters</entry>
- <entry>CSS properties</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>tabBackgroundColor</entry>
- <entry>background-color</entry>
- </row>
- <row>
- <entry>subBorderColor</entry>
- <entry>border-color</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
- <table>
- <title>Skin parameters redefinition for a disabled tab</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Skin parameters</entry>
- <entry>CSS properties</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>tabBackgroundColor</entry>
- <entry>background-color</entry>
- </row>
- <row>
- <entry>subBorderColor</entry>
- <entry>border-color</entry>
- </row>
- <row>
- <entry>tabDisabledTextColor</entry>
- <entry>color</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </section>
-
- <section>
- <title>Definition of Custom Style Classes</title>
-
- <figure>
- <title>Classes names</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/tab_cn.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
-
- <table id="tab_tab">
- <title>Classes names that define a tab</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Class name</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>rich-tab-header</entry>
- <entry>Defines styles for a tab header</entry>
- </row>
-
- <row>
- <entry>rich-tab-label</entry>
- <entry>Defines styles for a tab label</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <table>
- <title>Classes names that define a tab states</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Class name</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>rich-tab-active</entry>
- <entry>Defines styles for an active tab</entry>
- </row>
- <row>
- <entry>rich-tab-inactive</entry>
- <entry>Defines styles for an inactive tab</entry>
- </row>
- <row>
- <entry>rich-tab-disabled</entry>
- <entry>Defines styles for a disabled tab</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <para>In order to redefine styles for all <emphasis role="bold">
- <property><rich:tab></property>
- </emphasis> components on a page using CSS, it's enough to create classes with the
- same names (possible classes could be found in the tables <link linkend="tab_tab"> above</link>) and define necessary properties in them. </para>
-
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="CSS"><![CDATA[...
+ <para> The following example shows how on the client side to get the names of
+ <code>entered</code>/<code>left</code> tabs. </para>
+ <programlisting role="JAVA"><![CDATA[ontabenter="alert(leftTabName)"]]></programlisting>
+ <para> Information about the <emphasis>
+ <property>"process"</property>
+ </emphasis> attribute usage you can find <link linkend="process"
+ >here</link>. </para>
+ </section>
+ <section>
+ <title>Look-and-Feel Customization</title>
+
+ <para>For skinnability implementation, the components use a <emphasis>
+ <property>style class redefinition method.</property>
+ </emphasis> Default style classes are mapped on <emphasis>
+ <property>skin parameters.</property>
+ </emphasis></para>
+
+ <note>
+ <title>Note:</title>
+ <para> A panel appearance and content is defined with a
+ <property>tab</property> panel i.e. on the
+ <property>tab</property> level it's possible to
+ define only an appearance of this <property>tab</property>
+ header. </para>
+ </note>
+
+ <para>There are two ways to redefine the appearance of all <emphasis role="bold">
+ <property><rich:tab></property>
+ </emphasis> components at once:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>Redefine the corresponding skin parameters</para>
+ </listitem>
+
+ <listitem>
+ <para>Add to your style sheets <emphasis>
+ <property>style classes</property>
+ </emphasis> used by a <emphasis role="bold">
+ <property><rich:tab></property>
+ </emphasis> component</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section>
+ <title>Skin Parameters Redefinition</title>
+ <table>
+ <title>Skin parameters redefinition for a tab header</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>generalTextColor</entry>
+ <entry>color</entry>
+ </row>
+ <row>
+ <entry>generalSizeFont</entry>
+ <entry>font-size</entry>
+ </row>
+ <row>
+ <entry>generalFamilyFont</entry>
+ <entry>font-family</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <table>
+ <title>Skin parameters redefinition for an active tab</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>generalTextColor</entry>
+ <entry>color</entry>
+ </row>
+ <row>
+ <entry>subBorderColor</entry>
+ <entry>border-color</entry>
+ </row>
+ <row>
+ <entry>generalBackgroundColor</entry>
+ <entry>background-color</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table>
+ <title>Skin parameters redefinition for an inactive tab</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>tabBackgroundColor</entry>
+ <entry>background-color</entry>
+ </row>
+ <row>
+ <entry>subBorderColor</entry>
+ <entry>border-color</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table>
+ <title>Skin parameters redefinition for a disabled tab</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>tabBackgroundColor</entry>
+ <entry>background-color</entry>
+ </row>
+ <row>
+ <entry>subBorderColor</entry>
+ <entry>border-color</entry>
+ </row>
+ <row>
+ <entry>tabDisabledTextColor</entry>
+ <entry>color</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+
+ <section>
+ <title>Definition of Custom Style Classes</title>
+
+ <figure>
+ <title>Classes names</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/tab_cn.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+
+ <table id="tab_tab">
+ <title>Classes names that define a tab</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Class name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>rich-tab-header</entry>
+ <entry>Defines styles for a tab
+ header</entry>
+ </row>
+
+ <row>
+ <entry>rich-tab-label</entry>
+ <entry>Defines styles for a tab
+ label</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <table>
+ <title>Classes names that define a tab states</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Class name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>rich-tab-active</entry>
+ <entry>Defines styles for an active
+ tab</entry>
+ </row>
+ <row>
+ <entry>rich-tab-inactive</entry>
+ <entry>Defines styles for an inactive
+ tab</entry>
+ </row>
+ <row>
+ <entry>rich-tab-disabled</entry>
+ <entry>Defines styles for a disabled
+ tab</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <para>In order to redefine styles for all <emphasis role="bold">
+ <property><rich:tab></property>
+ </emphasis> components on a page using CSS, it's enough to
+ create classes with the same names (possible classes could be found in
+ the tables <link linkend="tab_tab"> above</link>) and define necessary
+ properties in them. </para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="CSS"><![CDATA[...
.rich-tab-header{
font-weight: bold;
}
-...]]></programlisting>
-
- <para>This is a result:</para>
-
- <figure>
- <title>Redefinition styles with predefined classes</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/tab_pc.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>In the example a header font weight was changed.</para>
-
- <para>Also it's possible to change styles of particular <emphasis role="bold"
- ><property><rich:tab></property></emphasis> component. In this case you should create own style classes and use them in corresponding <emphasis role="bold"
- ><property><rich:tab></property></emphasis> <emphasis><property>styleClass</property></emphasis> attributes. An example is placed below:</para>
-
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="CSS"><![CDATA[...
+...]]></programlisting>
+
+ <para>This is a result:</para>
+
+ <figure>
+ <title>Redefinition styles with predefined classes</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/tab_pc.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>In the example a header font weight was changed.</para>
+
+ <para>Also it's possible to change styles of particular <emphasis
+ role="bold">
+ <property><rich:tab></property>
+ </emphasis> component. In this case you should create own style
+ classes and use them in corresponding <emphasis role="bold">
+ <property><rich:tab></property>
+ </emphasis>
+ <emphasis>
+ <property>styleClass</property>
+ </emphasis> attributes. An example is placed below:</para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="CSS"><![CDATA[...
.myClass{
border-color: #5d9ffc;
}
-...]]></programlisting>
- <para>The <emphasis><property>"styleClass"</property></emphasis> attribute for <emphasis role="bold"
- ><property><rich:tab> </property></emphasis> is defined as it's shown in the example below:</para>
-
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[<rich:tab ... styleClass="myClass"/>
-]]></programlisting>
-
- <para>This is a result:</para>
-
- <figure>
- <title>Redefinition styles with own classes and <emphasis><property>styleClass</property></emphasis> attributes</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/tab_oc.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>As it could be seen on the picture above, the border color was changed.</para>
- </section>
-
-</section>
\ No newline at end of file
+...]]></programlisting>
+ <para>The <emphasis>
+ <property>"styleClass"</property>
+ </emphasis> attribute for <emphasis role="bold">
+ <property><rich:tab> </property>
+ </emphasis> is defined as it's shown in the example below:</para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[<rich:tab ... styleClass="myClass"/>
+]]></programlisting>
+
+ <para>This is a result:</para>
+
+ <figure>
+ <title>Redefinition styles with own classes and <emphasis>
+ <property>styleClass</property>
+ </emphasis> attributes</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/tab_oc.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>As it could be seen on the picture above, the border color was
+ changed.</para>
+ </section>
+
+</section>
Modified: trunk/docs/userguide/en/src/main/docbook/included/tabPanel.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/tabPanel.xml 2008-10-01 12:16:56 UTC (rev 10638)
+++ trunk/docs/userguide/en/src/main/docbook/included/tabPanel.xml 2008-10-01 12:29:54 UTC (rev 10639)
@@ -1,4 +1,4 @@
-f<?xml version='1.0' encoding='UTF-8'?>
+<?xml version='1.0' encoding='UTF-8'?>
<section>
<sectioninfo>
<keywordset>
16 years, 1 month
JBoss Rich Faces SVN: r10638 - in trunk/test-applications/seleniumTest/richfaces/src: test/java/org/richfaces/testng and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-10-01 08:16:56 -0400 (Wed, 01 Oct 2008)
New Revision: 10638
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/modalPanel/modalPanelTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ModalPanelTest.java
Log:
Modal Panel: standard HTML attributes
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/modalPanel/modalPanelTest.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ModalPanelTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ModalPanelTest.java 2008-10-01 11:06:44 UTC (rev 10637)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ModalPanelTest.java 2008-10-01 12:16:56 UTC (rev 10638)
@@ -126,6 +126,9 @@
// test height attribute - should be 104
assertStyleAttribute(panelContentId, "height: 104");
+
+ assertClassNames(panelContainerId, new String [] {"noclass"}, "Class attribute was not output to client ", true);
+ assertClassNames(panelContainerId, new String [] {"rich-modalpanel"}, "", true);
}
@Test
16 years, 1 month
JBoss Rich Faces SVN: r10637 - in trunk/test-applications/seleniumTest/richfaces/src: main/webapp/layout and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-10-01 07:06:44 -0400 (Wed, 01 Oct 2008)
New Revision: 10637
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/ModalPanelTestBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/TemplateBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/controlLayout.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/layout.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ModalPanelTest.java
Log:
Add reset method invoking during component rendering
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/ModalPanelTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/ModalPanelTestBean.java 2008-10-01 10:13:41 UTC (rev 10636)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/ModalPanelTestBean.java 2008-10-01 11:06:44 UTC (rev 10637)
@@ -80,13 +80,14 @@
}
public String reset(){
- rendered = true;
- showWhenRendered = false;
- moveable = true;
- resizeable = true;
- input = null;
- return null;
+ rendered = true;
+ showWhenRendered = false;
+ moveable = true;
+ resizeable = true;
+ input = null;
+ return null;
}
+
/**
* @return the input
*/
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/TemplateBean.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/TemplateBean.java 2008-10-01 10:13:41 UTC (rev 10636)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/TemplateBean.java 2008-10-01 11:06:44 UTC (rev 10637)
@@ -24,22 +24,26 @@
import java.util.ArrayList;
import java.util.List;
+import javax.el.ExpressionFactory;
+import javax.el.MethodExpression;
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
import javax.faces.model.SelectItem;
import org.ajax4jsf.template.Template;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
public class TemplateBean {
+
+ private static final Log log = LogFactory.getLog(TemplateBean.class);
+
public static final String PARAM_NAME = "t";
-
+
private Template template = Template.SIMPLE;
+
+ private String methodName;
- /*
- * public void initTemplate (ActionEvent event) { Map<String, String>
- * reqMap =
- * FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
- * String template = reqMap.get(PARAM_NAME); this.template = template !=
- * null ? template : "simple"; }
- */
public String getTemplateId() {
return template.toString();
@@ -76,5 +80,47 @@
return retVal;
}
+
+ /**
+ * Invokes reset method of appropriate backing bean
+ * @param actionEvent
+ */
+ public void reset(ActionEvent actionEvent) {
+ FacesContext context = FacesContext.getCurrentInstance();
+ if (context != null) {
+ if (methodName != null && methodName.trim().length() > 0) {
+ try {
+ ExpressionFactory factory = context.getApplication()
+ .getExpressionFactory();
+ if (factory != null) {
+ MethodExpression methodExpression = factory
+ .createMethodExpression(context.getELContext(),
+ methodName, Void.class, new Class[] {});
+ methodExpression.invoke(context.getELContext(),
+ new Object[] {});
+ }
+ } catch (Exception e) {
+ log.error(
+ "Reset method has not been found by this expression: "
+ + methodName, e);
+ }
+ }
+ }
+ }
+
+ /**
+ * @return the methodName
+ */
+ public String getMethodName() {
+ return methodName;
+ }
+
+ /**
+ * @param methodName the methodName to set
+ */
+ public void setMethodName(String methodName) {
+ this.methodName = methodName;
+ }
+
}
\ No newline at end of file
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/controlLayout.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/layout.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-10-01 10:13:41 UTC (rev 10636)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-10-01 11:06:44 UTC (rev 10637)
@@ -190,7 +190,29 @@
checkJSError();
}
+
+ /**
+ * Renders page
+ */
+ protected void renderPage(Template template, String resetMethodName) {
+ selenium.open(protocol + "://" + host + ":" + port + "/" + APPLICATION_NAME + filterPrefix + getTestUrl());
+ selenium.waitForPageToLoad(String.valueOf(pageRenderTime));
+ setParentId(template.getPrefix());
+ runScript("loadTemplate('" + template + "');", false);
+ waitForPageToLoad();
+
+ checkPageRendering(); // At the first we check if page has been
+ // rendered
+ checkJSError(); // At the second we check if JS errors occurred
+
+ reRenderForm(resetMethodName); // ReRender component
+
+ checkPageRendering(); // Check all again
+ checkJSError();
+
+ }
+
/**
* Writes status message on client side
*
@@ -225,6 +247,14 @@
// clickById("_Selenium_Test_ReRender_Form:_reRender");
waitForAjaxCompletion(3000);
}
+
+ /**
+ * ReRenders the component
+ */
+ private void reRenderForm(String resetMethodName) {
+ selenium.getEval("selenium.browserbot.getCurrentWindow().reRenderAll('"+resetMethodName+"');");
+ waitForAjaxCompletion(3000);
+ }
/**
* Performs script defined in parameter
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ModalPanelTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ModalPanelTest.java 2008-10-01 10:13:41 UTC (rev 10636)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ModalPanelTest.java 2008-10-01 11:06:44 UTC (rev 10637)
@@ -20,6 +20,7 @@
private final static String PANEL_ID="test_panel";
private final static String FORM_ID="form:";
+ private final static String FORM2_ID="_f:";
private final static String RESET_ID="reset";
private final static String CHANGE_RENDERED_ID="change_rendered";
private final static String CHANGE_ATTRIBUTES_ID="change_attributes";
@@ -30,7 +31,9 @@
private final static String PANEL_CONTAINER_DIV_ID = PANEL_ID + "Container";
private final static String PANEL_HEADER_ID = PANEL_ID + "Header";
+ private final static String RESET_METHOD_NAME = "#{modalPanelBean.reset}";
+
/**
* @see org.richfaces.SeleniumTestBase#getTestUrl()
*/
@@ -41,10 +44,10 @@
@Test
public void testModalPanel(Template template) throws Exception {
- renderPage(template);
+ renderPage(template, RESET_METHOD_NAME);
writeStatus("Testing modal panel");
- String panelId = getParentId() + FORM_ID + PANEL_CONTAINER_DIV_ID;
+ String panelId = getParentId() + PANEL_CONTAINER_DIV_ID;
AssertPresent(panelId);
AssertNotVisible(panelId);
@@ -63,25 +66,25 @@
@Test
public void testRenderedAttribute(Template template) throws Exception {
- renderPage(template);
+ renderPage(template, RESET_METHOD_NAME);
writeStatus("Testing rendered attribute");
- String panelId = getParentId() + FORM_ID + PANEL_CONTAINER_DIV_ID;
+ String panelId = getParentId() + PANEL_CONTAINER_DIV_ID;
AssertPresent(panelId);
clickChangeRendered();
AssertNotPresent(panelId);
- clickReset();
+
}
@Test
public void testShowWhenRenderedAttribute(Template template) throws Exception {
- renderPage(template);
+ renderPage(template, RESET_METHOD_NAME);
writeStatus("Testing showWhenRendered attribute");
- String panelId = getParentId() + FORM_ID + PANEL_CONTAINER_DIV_ID;
+ String panelId = getParentId() + PANEL_CONTAINER_DIV_ID;
AssertPresent(panelId);
AssertNotVisible(panelId);
@@ -90,19 +93,18 @@
AssertPresent(panelId);
AssertVisible(panelId);
- clickReset();
}
@Test
public void testLayoutAttributes(Template template) throws Exception {
- renderPage(template);
+ renderPage(template, RESET_METHOD_NAME);
writeStatus("Testing layout attribute");
clickShow();
- String panelContainerId = getParentId() + FORM_ID + PANEL_CONTAINER_DIV_ID;
- String panelContentId = getParentId() + FORM_ID + PANEL_CONTENT_DIV_ID;
- String panelCDivId = getParentId() + FORM_ID + PANEL_C_DIV_ID;
+ String panelContainerId = getParentId() + PANEL_CONTAINER_DIV_ID;
+ String panelContentId = getParentId() + PANEL_CONTENT_DIV_ID;
+ String panelCDivId = getParentId() + PANEL_C_DIV_ID;
AssertPresent(panelContainerId);
AssertPresent(panelContentId);
@@ -128,12 +130,12 @@
@Test
public void testDragByHeader(Template template) {
- renderPage(template);
+ renderPage(template, RESET_METHOD_NAME);
clickShow();
- String headerId = getParentId() + FORM_ID + PANEL_HEADER_ID;
- String cIdvId = getParentId() + FORM_ID + PANEL_C_DIV_ID;
+ String headerId = getParentId() + PANEL_HEADER_ID;
+ String cIdvId = getParentId() + PANEL_C_DIV_ID;
Integer left = (Integer)getLeftById(cIdvId);
Integer top = (Integer)getTopById(cIdvId);
@@ -152,12 +154,12 @@
@Test
public void testMinWidthAndMinHeight(Template template) {
- renderPage(template);
+ renderPage(template, RESET_METHOD_NAME);
clickShow();
- String resizerId = getParentId() + FORM_ID + PANEL_ID + "ResizerSEL";
- String contentId = getParentId() + FORM_ID + PANEL_CONTENT_DIV_ID;
+ String resizerId = getParentId() + PANEL_ID + "ResizerSEL";
+ String contentId = getParentId() + PANEL_CONTENT_DIV_ID;
selenium.dragAndDrop(resizerId, "-100,-100");
@@ -169,6 +171,31 @@
}
+ @Test
+ public void testNestedInputAndCommand(Template template) {
+ renderPage(template, RESET_METHOD_NAME);
+
+ final String VALUE = "69";
+
+ clickShow();
+
+ String inputId = getParentId() + FORM2_ID + "input";
+ String commandId = getParentId() + FORM2_ID + "submit";
+
+ AssertPresent(inputId);
+ AssertPresent(commandId);
+
+ setValueById(inputId, VALUE);
+
+ clickCommandAndWait(commandId);
+ clickShow();
+
+ AssertPresent(inputId);
+ AssertPresent(commandId);
+ AssertValueEquals(inputId, VALUE, "Input value does not equal to correct ");
+
+ }
+
private String getWidth(String id) {
String w = runScript("$('"+id+"').style.width", false);
@@ -205,7 +232,7 @@
}
private void clickHide() {
- String buttonId = getParentId() + FORM_ID + HIDE_ID;
+ String buttonId = getParentId() + FORM2_ID + HIDE_ID;
writeStatus("Click hide button");
clickById(buttonId);
}
16 years, 1 month
JBoss Rich Faces SVN: r10636 - trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2008-10-01 06:13:41 -0400 (Wed, 01 Oct 2008)
New Revision: 10636
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxStatusTest.java
Log:
AjaxStatus: test status is indicated only for ajax container pointed by 'for' attribute
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxStatusTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxStatusTest.java 2008-10-01 09:36:35 UTC (rev 10635)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxStatusTest.java 2008-10-01 10:13:41 UTC (rev 10636)
@@ -7,18 +7,24 @@
public class AjaxStatusTest extends SeleniumTestBase {
+ private static final String STATUS_1_ID = "region1:status";
+
+ private static final String STATUS_2_ID = "region2:status";
+
+ private static final String BTN_1_ID = "button1";
+
+ private static final String BTN_2_ID = "button2";
+
@Test
public void testAjaxStatusComponent(Template template) {
renderPage(template);
String parentId = getParentId() + "_form:";
- String btn1 = parentId + "button1";
- clickById(btn1);
+ clickById(parentId + BTN_1_ID);
- String reg1Status = parentId + "region1:status";
-
writeStatus("Ajax request is in progress");
+ String reg1Status = parentId + STATUS_1_ID;
AssertVisible(reg1Status + ".start");
AssertNotVisible(reg1Status + ".stop");
String start = getTextById(reg1Status + ".start");
@@ -32,13 +38,11 @@
String stop = getTextById(reg1Status + ".stop");
Assert.assertTrue(stop.startsWith("Complete"));
- String btn2 = parentId + "button2";
- clickById(btn2);
+ clickById(parentId + BTN_2_ID);
- String reg2Status = parentId + "region2:status";
-
writeStatus("Ajax request is in progress");
+ String reg2Status = parentId + STATUS_2_ID;
AssertVisible(reg2Status + ".start");
AssertNotVisible(reg2Status + ".stop");
start = getTextById(reg2Status + ".start");
@@ -54,6 +58,37 @@
}
+ @Test
+ public void testStatusIndicatedOnlyForAjaxContainerPointedByForAttribute(Template template) {
+ renderPage(template);
+
+ writeStatus("Check status is indicated only for ajax container pointed by 'for' attribute");
+
+ String parentId = getParentId() + "_form:";
+ String reg1Status = parentId + STATUS_1_ID;
+ String reg2Status = parentId + STATUS_2_ID;
+ String stop = "";
+
+ clickById(parentId + BTN_1_ID);
+
+ AssertNotVisible(reg2Status + ".start");
+ AssertVisible(reg2Status + ".stop");
+ stop = getTextById(reg2Status + ".stop");
+ Assert.assertTrue(stop.startsWith("Complete"),
+ "Status components have to be untouched for irrelevant ajax containers");
+ pause(3000, reg1Status);
+
+ clickById(parentId + BTN_2_ID);
+
+ AssertNotVisible(reg1Status + ".start");
+ AssertVisible(reg1Status + ".stop");
+ stop = getTextById(reg1Status + ".stop");
+ Assert.assertTrue(stop.startsWith("Complete"),
+ "Status components have to be untouched for irrelevant ajax containers");
+ pause(3000, reg2Status);
+
+ }
+
public String getTestUrl() {
return "pages/ajaxStatus/ajaxStatusTest.xhtml";
}
16 years, 1 month
JBoss Rich Faces SVN: r10635 - in trunk/test-applications/seleniumTest/richfaces/src/main: webapp/pages/modalPanel and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-10-01 05:36:35 -0400 (Wed, 01 Oct 2008)
New Revision: 10635
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/ModalPanelTestBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/modalPanel/modalPanelTest.xhtml
Log:
Modal Panel: test nested command & inputs
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/ModalPanelTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/ModalPanelTestBean.java 2008-10-01 09:36:23 UTC (rev 10634)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/ModalPanelTestBean.java 2008-10-01 09:36:35 UTC (rev 10635)
@@ -17,6 +17,7 @@
private Boolean showWhenRendered = false;
private Boolean moveable = true;
private Boolean resizeable = true;
+ private String input;
/**
* @return the rendered
*/
@@ -83,7 +84,20 @@
showWhenRendered = false;
moveable = true;
resizeable = true;
+ input = null;
return null;
}
+ /**
+ * @return the input
+ */
+ public String getInput() {
+ return input;
+ }
+ /**
+ * @param input the input to set
+ */
+ public void setInput(String input) {
+ this.input = input;
+ }
}
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/modalPanel/modalPanelTest.xhtml
===================================================================
(Binary files differ)
16 years, 1 month
JBoss Rich Faces SVN: r10634 - trunk/docs/userguide/en/src/main/docbook/modules.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2008-10-01 05:36:23 -0400 (Wed, 01 Oct 2008)
New Revision: 10634
Modified:
trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml
Log:
RF-4205 - additional information is added
Modified: trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml 2008-10-01 09:35:03 UTC (rev 10633)
+++ trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml 2008-10-01 09:36:23 UTC (rev 10634)
@@ -1196,13 +1196,13 @@
<para> RichFaces allows to redefine standard handlers responsible for processing of
different exceptional situations. It helps to define own JavaScript, which is executed
when these situations occur. </para>
- <para>
- Add the following code to web.xml:
+ <para>
+ Add the following code to web.xml:
</para>
<programlisting role="XML"><![CDATA[<context-param>
<param-name>org.ajax4jsf.handleViewExpiredOnClient</param-name>
<param-value>true</param-value>
-</context-param>]]>
+</context-param>]]>
</programlisting>
<section id="RequestErrorsHandling">
<?dbhtml filename="RequestErrorsHandling.html"?>
@@ -3047,8 +3047,10 @@
window.RICH_FACES_EXTENDED_SKINNING_ON = true;
</script>
]]></programlisting>
+ <para>
+ When NO script loading strategy is used and extended skinning is turned on then corresponding warning message will appears in the console.
+ </para>
-
<para> You also need to specify <emphasis>
<property>"media"</property>
</emphasis> attribute in the <emphasis role="bold">
16 years, 1 month