JBoss Rich Faces SVN: r614 - trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/pages.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-05-02 11:51:14 -0400 (Wed, 02 May 2007)
New Revision: 614
Modified:
trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/pages/scrollable-grid.xhtml
Log:
Modified: trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/pages/scrollable-grid.xhtml
===================================================================
--- trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/pages/scrollable-grid.xhtml 2007-05-02 15:47:08 UTC (rev 613)
+++ trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/pages/scrollable-grid.xhtml 2007-05-02 15:51:14 UTC (rev 614)
@@ -32,8 +32,70 @@
<body>
- <sg:scrollable-grid>
- </sg:scrollable-grid>
-
- </body>
+ <sg:scrollable-grid>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="Column 1"></h:outputText>
+ </f:facet>
+ <h:outputText value="Test1"></h:outputText>
+ <f:facet name="footer">
+ <h:outputText value="footer1"></h:outputText>
+ </f:facet>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="hearder2"></h:outputText>
+ </f:facet>
+ <h:outputText value="Column 2"></h:outputText>
+ <f:facet name="footer">
+ <h:outputText value="footer2"></h:outputText>
+ </f:facet>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="Column 3"></h:outputText>
+ </f:facet>
+ <h:outputText value="Test3"></h:outputText>
+ <f:facet name="footer">
+ <h:outputText value="footer3"></h:outputText>
+ </f:facet>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="Column 4"></h:outputText>
+ </f:facet>
+ <h:outputText value="Test4"></h:outputText>
+ <f:facet name="footer">
+ <h:outputText value="footer4"></h:outputText>
+ </f:facet>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="Column 5"></h:outputText>
+ </f:facet>
+ <h:outputText value="Test5"></h:outputText>
+ <f:facet name="footer">
+ <h:outputText value="footer5"></h:outputText>
+ </f:facet>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="Column 6"></h:outputText>
+ </f:facet>
+ <h:outputText value="Test6"></h:outputText>
+ <f:facet name="footer">
+ <h:outputText value="footer6"></h:outputText>
+ </f:facet>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="Column 7"></h:outputText>
+ </f:facet>
+ <h:outputText value="Test7"></h:outputText>
+ <f:facet name="footer">
+ <h:outputText value="footer7"></h:outputText>
+ </f:facet>
+ </h:column>
+ </sg:scrollable-grid>
+ </body>
</html>
\ No newline at end of file
17 years, 5 months
JBoss Rich Faces SVN: r613 - trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-05-02 11:47:08 -0400 (Wed, 02 May 2007)
New Revision: 613
Modified:
trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid.jspx
Log:
Modified: trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid.jspx
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid.jspx 2007-05-02 15:46:56 UTC (rev 612)
+++ trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid.jspx 2007-05-02 15:47:08 UTC (rev 613)
@@ -73,7 +73,7 @@
}
}();
- #{this:getScriptContributions(context, component)}
+ #{this:getScriptContributions(context, component)};
Event.observe(window, 'load', #{this:getJavaScriptVarName(context, component)}.init);
// ]]>
@@ -83,115 +83,17 @@
<div id="GridContainer" style="width:60%; height:300px;" class="ClientUI_Grid">
<div id="GridHeaderTemplate">
<table class="TestGridHeader" cellpadding="0" cellspacing="0" border="1">
- <tr>
- <td frozen="true" id="testHeaderCell" align="right" valign="middle" width="100px">Column 1</td>
- <td class="SecondClolumn" width="150px">
- <table cellpadding="0" cellspacing="0" style="width:100%;">
- <tr><td style="width:100%;" align="center" class="ClientUI_Grid_HCBodyContent">Column 2</td></tr>
- <tr>
- <td style="width:100%;">
- <table class="ClientUI_Grid_HCBodyContent" cellpadding="0" cellspacing="0" style="width:100%;">
- <tr>
- <td style="font-size: 1px;" colspan="3"><div class="CustomHeaderHSep"> </div></td>
- </tr>
- <tr>
- <td class="ClientUI_Grid_HCBodyContent" align="center" width="50%">Column 2.1</td>
- <td class="CustomHeaderVSep">  </td>
- <td class="ClientUI_Grid_HCBodyContent" align="center" width="50%">Column 2.2</td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
- <td width="100px" align="right" valign="middle">Column 3</td>
- <td width="100px" valign="middle" align="center">
- <select id="ColumnFilter" style="width: 90px">
- <option id="opt1">Select option 1</option>
- <option id="opt2" selected="true">Select option 2</option>
- <option id="opt3">Select option 3</option>
- <option id="opt4">Select option 4</option>
- <option id="opt5">Select option 5</option>
- <option id="opt6">Select option 6</option>
- </select>
- </td>
- <td width="100px" align="right" valign="middle">Column 5</td>
- <td width="100px">
- <table cellpadding="0" cellspacing="0" style="width:100%;">
- <tr><td style="width:100%;" align="center" class="ClientUI_Grid_HCBodyContent">Column 6</td></tr>
- <tr>
- <td style="width:100%;">
- <table class="ClientUI_Grid_HCBodyContent" cellpadding="0" cellspacing="0" style="width:100%;">
- <tr>
- <td style="font-size: 1px;" colspan="3"><div class="CustomHeaderHSep"> </div></td>
- </tr>
- <tr>
- <td class="ClientUI_Grid_HCBodyContent" align="center" width="50%">Column 6.1</td>
- <td class="CustomHeaderVSep">  </td>
- <td class="ClientUI_Grid_HCBodyContent" align="center" width="50%">Column 6.2</td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
- <td width="100px" align="right" valign="middle">Column 7</td>
- </tr>
+ <f:call name="renderHeaders"/>
</table>
</div>
<div id="GridBodyTemplate">
<table cellpadding="0" cellspacing="0">
- <tr>
- <td class="FirstClolumn">$(0)</td>
- <td align="center">
- $(1)
- <script type="text/javascript">
- processCellValue("$(cid)", "$(1)");
- </script>
- </td>
- <td>
- <div style="position:relative; top:-2px;left:0px; width:100%; height: 20px">
- <select id="dddd$(row)" style="width: 100%; height: 100%; font:normal 8pt arial;">
- <option value="value 1">text 1</option>
- <option value="value 2">text 2</option>
- </select>
- </div>
- </td>
- <td>$(3)</td>
- <td>
- <div style="position:relative; top:-2px;left:-2px; width:100%; height: 20px">
- <input type="text" value="$(4)" style="border:1px solid blue; width: 100%; height: 18px; font:normal 8pt arial;" />
- </div>
- </td>
- <td>$(5)</td>
- <td>$(6)</td>
- </tr>
- </table>
- <!--
- <table cellpadding="0" cellspacing="0">
- <tr>
- <td>$(index_0)</td>
- <td align="center">$(index_1)</td>
- <td>$(index_2)</td>
- <td>$(index_3)</td>
- <td>$(index_4)</td>
- <td>$(index_5)</td>
- <td>$(index_6)</td>
- </tr>
- </table>
- -->
+ <vcp:body/>
+ </table>
</div>
<div id="GridFooterTemplate">
<table cellpadding="0" cellspacing="0">
- <tr>
- <td style="width: 100px">Footer 1</td>
- <td style="width: 100px">Footer 2</td>
- <td style="width: 100px">Footer 3</td>
- <td style="width: 100px">Footer 4</td>
- <td style="width: 100px">Footer 5</td>
- <td style="width: 100px">Footer 6</td>
- <td style="width: 100px">Footer 7</td>
- </tr>
+ <f:call name="renderFooters"/>
</table>
</div>
</div>
17 years, 5 months
JBoss Rich Faces SVN: r612 - trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-05-02 11:46:56 -0400 (Wed, 02 May 2007)
New Revision: 612
Added:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ColumnVisitor.java
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ColumnWalker.java
Modified:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java
Log:
Added: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ColumnVisitor.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ColumnVisitor.java (rev 0)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ColumnVisitor.java 2007-05-02 15:46:56 UTC (rev 612)
@@ -0,0 +1,18 @@
+/**
+ *
+ */
+package org.richfaces.renderkit.html;
+
+import java.io.IOException;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+
+/**
+ * @author Anton Belevich
+ *
+ */
+public interface ColumnVisitor {
+ public void visit(FacesContext context, UIComponent component, ResponseWriter writer) throws IOException;
+}
Added: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ColumnWalker.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ColumnWalker.java (rev 0)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ColumnWalker.java 2007-05-02 15:46:56 UTC (rev 612)
@@ -0,0 +1,48 @@
+/**
+ *
+ */
+package org.richfaces.renderkit.html;
+
+import java.io.IOException;
+import java.util.Iterator;
+
+import javax.faces.component.UIColumn;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+
+import org.ajax4jsf.framework.renderer.RendererUtils.HTML;
+
+/**
+ * @author Anton Belevich
+ *
+ */
+public class ColumnWalker {
+
+ static void iterateOverKids(FacesContext context, UIComponent component, ColumnVisitor visitor, ResponseWriter writer) throws IOException{
+
+ if(context == null || component == null){
+ throw new NullPointerException();
+ }
+
+ if(!component.isRendered()){
+ return ;
+ }
+
+ if(null != component.getChildren()){
+ writer.startElement(HTML.TR_ELEMENT, component);
+ writer.writeText("\n", null);
+
+ for (Iterator iter = component.getChildren().iterator(); iter.hasNext(); ) {
+ UIComponent kid = (UIComponent) iter.next();
+ if (kid.isRendered()) {
+ if (kid instanceof UIColumn){
+ visitor.visit(context, kid, writer);
+ }
+ }
+ }
+ writer.endElement(HTML.TR_ELEMENT);
+ writer.writeText("\n", null);
+ }
+ }
+}
Modified: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java 2007-05-02 15:46:36 UTC (rev 611)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java 2007-05-02 15:46:56 UTC (rev 612)
@@ -1,7 +1,12 @@
package org.richfaces.renderkit.html;
+import java.io.IOException;
+
+import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import org.ajax4jsf.framework.renderer.RendererUtils.HTML;
import org.richfaces.component.UIScrollableGrid;
import org.richfaces.renderkit.CompositeRenderer;
@@ -11,7 +16,55 @@
*/
public abstract class ScrollableGridBaseRenderer extends CompositeRenderer {
+
+ private final String FOOTER_PART = "footer";
+ private final String HEADER_PART = "header";
+
+
+ private final ColumnVisitor headerRenderer = new ColumnVisitor(){
+
+ public void visit(FacesContext context, UIComponent component, ResponseWriter writer) throws IOException {
+
+ writer.startElement(HTML.td_ELEM, component);
+ writer.writeText("\n", null);
+
+ if(component.getFacet(HEADER_PART) != null){
+ component = component.getFacet(HEADER_PART);
+ renderChild(context, component);
+ }
+ writer.endElement(HTML.td_ELEM);
+ writer.writeText("\n", null);
+ }
+ };
+
+ private final ColumnVisitor footerRenderer = new ColumnVisitor(){
+
+ public void visit(FacesContext context, UIComponent component, ResponseWriter writer) throws IOException {
+ writer.startElement(HTML.td_ELEM, component);
+ writer.writeText("\n", null);
+
+ if(component.getFacet(FOOTER_PART) != null){
+ component = component.getFacet(HEADER_PART);
+ renderChild(context, component);
+ }
+ writer.endElement(HTML.td_ELEM);
+ writer.writeText("\n", null);
+ }
+ };
+
+ private final ColumnVisitor bodyRenderer = new ColumnVisitor(){
+
+ public void visit(FacesContext context, UIComponent component, ResponseWriter writer) throws IOException {
+ writer.startElement(HTML.td_ELEM, component);
+ writer.writeText("\n", null);
+ renderChildren(context, component);
+ writer.endElement(HTML.td_ELEM);
+ writer.writeText("\n", null);
+ }
+ };
+
+
protected String getJavaScriptVarName(FacesContext context, UIScrollableGrid grid) {
String id = grid.getBaseClientId(context);
return "Richfaces_ScrollableGrid_" + id.replaceAll("[^A-Za-z0-9_]", "_");
@@ -20,4 +73,22 @@
protected String getScriptContributions(FacesContext context, UIScrollableGrid grid) {
return super.getScriptContributions(getJavaScriptVarName(context, grid), context, grid);
}
+
+ public boolean getRendersChildren() {
+ return true;
+ }
+
+ protected void doEncodeChildren(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
+ ColumnWalker.iterateOverKids(context, component, bodyRenderer, writer);
+ }
+
+ public void renderHeaders(FacesContext context, UIComponent component)throws IOException{
+ ResponseWriter writer = context.getResponseWriter();
+ ColumnWalker.iterateOverKids(context, component, headerRenderer, writer);
+ }
+
+ public void renderFooters(FacesContext context, UIComponent component) throws IOException{
+ ResponseWriter writer = context.getResponseWriter();
+ ColumnWalker.iterateOverKids(context, component, footerRenderer, writer);
+ }
}
17 years, 5 months
JBoss Rich Faces SVN: r611 - trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-05-02 11:46:36 -0400 (Wed, 02 May 2007)
New Revision: 611
Added:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGridColumn.java
Modified:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java
Log:
Modified: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java 2007-05-02 15:46:16 UTC (rev 610)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java 2007-05-02 15:46:36 UTC (rev 611)
@@ -5,11 +5,12 @@
import java.util.Iterator;
-import javax.faces.component.UIComponentBase;
+import javax.faces.component.UIComponent;
import org.ajax4jsf.ajax.repeat.DataComponentState;
import org.ajax4jsf.ajax.repeat.ExtendedDataModel;
import org.ajax4jsf.ajax.repeat.UIDataAdaptor;
+import org.apache.commons.collections.iterators.IteratorChain;
/**
* @author Anton Belevich
Added: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGridColumn.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGridColumn.java (rev 0)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGridColumn.java 2007-05-02 15:46:36 UTC (rev 611)
@@ -0,0 +1,28 @@
+/**
+ *
+ */
+package org.richfaces.component;
+
+/**
+ * @author Anton Belevich
+ *
+ */
+public class UIScrollableGridColumn extends UIColumn {
+
+ /* (non-Javadoc)
+ * @see org.richfaces.component.Column#isBreakBefore()
+ */
+ public boolean isBreakBefore() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.component.Column#setBreakBefore(boolean)
+ */
+ public void setBreakBefore(boolean arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
17 years, 5 months
JBoss Rich Faces SVN: r610 - trunk/sandbox/scrollable-grid/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-05-02 11:46:16 -0400 (Wed, 02 May 2007)
New Revision: 610
Modified:
trunk/sandbox/scrollable-grid/src/main/config/component/scrollable-grid.xml
Log:
Modified: trunk/sandbox/scrollable-grid/src/main/config/component/scrollable-grid.xml
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/config/component/scrollable-grid.xml 2007-05-02 15:45:56 UTC (rev 609)
+++ trunk/sandbox/scrollable-grid/src/main/config/component/scrollable-grid.xml 2007-05-02 15:46:16 UTC (rev 610)
@@ -16,8 +16,6 @@
<name>org.richfaces.ScrollableGridRenderer</name>
<template>org/richfaces/scrollable-grid.jspx</template>
</renderer>
-
-
<tag>
<name>scrollable-grid</name>
<classname>org.richfaces.taglib.ScrollableGridTag</classname>
@@ -27,4 +25,30 @@
</tag>
&ui_component_attributes;
</component>
+ <component>
+ <name>org.richfaces.component.ScrollableGridColumn</name>
+ <family>org.richfaces.component.ScrollableGrid</family>
+ <classname>
+ org.richfaces.component.html.HtmlScrollableGridColumn
+ </classname>
+ <superclass>org.richfaces.component.UIScrollableGridColumn</superclass>
+ <tag>
+ <name>column</name>
+ <classname>org.richfaces.taglib.ScrollableGridColumnTag</classname>
+ <superclass>
+ org.ajax4jsf.framework.taglib.HtmlComponentTagBase
+ </superclass>
+ <description>
+ <![CDATA[ Scrollable Grid custom column impl]]>
+ </description>
+ </tag>
+ <property>
+ <name>frozen</name>
+ <classname>boolean</classname>
+ <description></description>
+ <defaultvalue>true</defaultvalue>
+ </property>
+ &ui_component_attributes;
+ </component>
+
</components>
\ No newline at end of file
17 years, 5 months
JBoss Rich Faces SVN: r609 - trunk/sandbox/scrollable-grid.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-05-02 11:45:56 -0400 (Wed, 02 May 2007)
New Revision: 609
Modified:
trunk/sandbox/scrollable-grid/pom.xml
Log:
Modified: trunk/sandbox/scrollable-grid/pom.xml
===================================================================
--- trunk/sandbox/scrollable-grid/pom.xml 2007-05-02 14:37:26 UTC (rev 608)
+++ trunk/sandbox/scrollable-grid/pom.xml 2007-05-02 15:45:56 UTC (rev 609)
@@ -61,17 +61,17 @@
</plugins>
</build>
<repositories>
- <!--
+
<repository>
<releases />
<snapshots>
- <enabled>false</enabled>
- <updatePolicy>never</updatePolicy>
+ <enabled>true</enabled>
+ <updatePolicy>daily</updatePolicy>
</snapshots>
<id>maven2-repository.dev.java.net</id>
<name>Java.net Repository for Maven</name>
- <url>https://maven-repository.dev.java.net/nonav/repository</url>
- </repository> -->
+ <url>https://maven2-repository.dev.java.net/nonav/repository</url>
+ </repository>
<repository>
<releases>
<enabled>false</enabled>
17 years, 5 months
JBoss Rich Faces SVN: r608 - in trunk/richfaces/datascroller/src/main: java/org/richfaces/component and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: d.bulahov
Date: 2007-05-02 10:37:26 -0400 (Wed, 02 May 2007)
New Revision: 608
Modified:
trunk/richfaces/datascroller/src/main/config/component/datascroller.xml
trunk/richfaces/datascroller/src/main/java/org/richfaces/component/UIDatascroller.java
trunk/richfaces/datascroller/src/main/java/org/richfaces/renderkit/html/DataScrollerRenderer.java
trunk/richfaces/datascroller/src/main/templates/org/richfaces/htmlDatascroller.jspx
Log:
http://jira.jboss.com/jira/browse/RF-117 fixed
Modified: trunk/richfaces/datascroller/src/main/config/component/datascroller.xml
===================================================================
--- trunk/richfaces/datascroller/src/main/config/component/datascroller.xml 2007-05-02 13:42:43 UTC (rev 607)
+++ trunk/richfaces/datascroller/src/main/config/component/datascroller.xml 2007-05-02 14:37:26 UTC (rev 608)
@@ -227,6 +227,27 @@
<description>
</description>
</property>
+ <property>
+ <name>boundaryControls</name>
+ <classname>java.lang.String</classname>
+ <description>
+ </description>
+ <defaultvalue><![CDATA["show"]]></defaultvalue>
+ </property>
+ <property>
+ <name>fastControls</name>
+ <classname>java.lang.String</classname>
+ <description>
+ </description>
+ <defaultvalue><![CDATA["show"]]></defaultvalue>
+ </property>
+ <property>
+ <name>stepControls</name>
+ <classname>java.lang.String</classname>
+ <description>
+ </description>
+ <defaultvalue><![CDATA["show"]]></defaultvalue>
+ </property>
</component>
&listeners;
</components>
Modified: trunk/richfaces/datascroller/src/main/java/org/richfaces/component/UIDatascroller.java
===================================================================
--- trunk/richfaces/datascroller/src/main/java/org/richfaces/component/UIDatascroller.java 2007-05-02 13:42:43 UTC (rev 607)
+++ trunk/richfaces/datascroller/src/main/java/org/richfaces/component/UIDatascroller.java 2007-05-02 14:37:26 UTC (rev 608)
@@ -61,6 +61,37 @@
public static final String FAST_REWIND_FACET_NAME = "fastrewind";
+
+ public static final String FIRST_DISABLED_FACET_NAME = "first_disabled";
+
+ public static final String LAST_DISABLED_FACET_NAME = "last_disabled";
+
+ public static final String NEXT_DISABLED_FACET_NAME = "next_disabled";
+
+ public static final String PREVIOUS_DISABLED_FACET_NAME = "previous_disabled";
+
+ public static final String FAST_FORWARD_DISABLED_FACET_NAME = "fastforward_disabled";
+
+ public static final String FAST_REWIND_DISABLED_FACET_NAME = "fastrewind_disabled";
+
+ public boolean first_rendered = true;
+ public boolean first_enabled = true;
+
+ public boolean last_rendered = true;
+ public boolean last_enabled = true;
+
+ public boolean next_rendered = true;
+ public boolean next_enabled = true;
+
+ public boolean previous_rendered = true;
+ public boolean previous_enabled = true;
+
+ public boolean fast_forward_rendered = true;
+ public boolean fast_forward_enabled = true;
+
+ public boolean fast_rewind_rendered = true;
+ public boolean fast_rewind_enabled = true;
+
public void addScrollerListener(DataScrollerListener listener) {
addFacesListener(listener);
}
@@ -149,7 +180,16 @@
public abstract String getAlign();
public abstract void setAlign(String align);
+
+ public abstract String getBoundaryControls();
+ public abstract void setBoundaryControls(String boundaryControls);
+ public abstract String getFastControls();
+ public abstract void setFastControls(String fastControls);
+
+ public abstract String getStepControls();
+ public abstract void setStepControls(String stepControls);
+
/**
* Finds the dataTable which id is mapped to the "for" property
*
@@ -225,14 +265,15 @@
// check if facet is selected
if (FIRST_FACET_NAME.equals(facetName)) {
+ setFirstRow(0);
dataTable.setFirst(0);
} else if (PREVIOUS_FACET_NAME.equals(facetName)) {
int previous = dataTable.getFirst() - getRows(dataTable);
- if (previous >= 0) dataTable.setFirst(previous);
+ if (previous >= 0) setFirstRow(previous);
} else if (NEXT_FACET_NAME.equals(facetName)) {
int rows = getRows(dataTable);
int next = dataTable.getFirst() + rows;
- if (next < getRowCount(dataTable)) dataTable.setFirst(next);
+ if (next < getRowCount(dataTable)) setFirstRow(next);
//if (rows>0){
// if (((next+rows)/rows)>getMaxPages()){
// next=getMaxPages()*rows-rows;;
@@ -251,13 +292,13 @@
// next=getMaxPages()*rows-rows;;
//}
//}
- dataTable.setFirst(next);
+ setFirstRow(next);
} else if (FAST_REWIND_FACET_NAME.equals(facetName)) {
int fastStep = getFastStep();
if (fastStep <= 0) fastStep = 1;
int previous = dataTable.getFirst() - getRows(dataTable) * fastStep;
if (previous < 0) previous = 0;
- dataTable.setFirst(previous);
+ setFirstRow(previous);
} else if (LAST_FACET_NAME.equals(facetName)) {
int rowcount = getRowCount(dataTable);
int rows = getRows(dataTable);
@@ -270,9 +311,9 @@
// first=getMaxPages()*rows-rows;
//}
//}
- dataTable.setFirst(first);
+ setFirstRow(first);
} else {
- dataTable.setFirst(0);
+ setFirstRow(0);
}
}
// the paginator is selected
@@ -284,7 +325,7 @@
} else if (pageindex <= 0) {
pageindex = 1;
}
- dataTable.setFirst(getRows(dataTable) * (pageindex - 1));
+ setFirstRow(getRows(dataTable) * (pageindex - 1));
}
}
@@ -302,7 +343,7 @@
+ uiData.getId() + "'");
}
if (page > 0) {
- uiData.setFirst(page * rows);
+ setFirstRow(page * rows);
}
}
@@ -406,9 +447,142 @@
public int getFirstRow() {
return getFirstRow(getDataTable());
}
+ public void setControls(){
+
+ int rowCount=getRowCount();
+
+ if (getBoundaryControls().equals("auto")){
+
+
+ if (getFirstRow()==0){
+ first_rendered = false;
+ first_enabled = false;
+ }else{
+ first_enabled = true;
+ first_rendered = true;
+ }
+ if ((rowCount - 1)<=(getFirstRow()+getRows())){
+ last_enabled = false;
+ last_rendered = false;
+ }
+ else{
+ last_enabled = true;
+ last_rendered = true;
+ }
+
+ }
+ else if (getBoundaryControls().equals("hide")){
+ first_rendered = false;
+ first_enabled = false;
+ last_rendered = false;
+ last_enabled = false;
+
+ }
+ else if (getBoundaryControls().equals("show")){
+ first_rendered = true;
+ last_rendered = true;
+ if (getFirstRow()==0){
+ first_enabled = false;
+ }else{
+ first_enabled = true;
+ }
+ if ((rowCount - 1)<=(getFirstRow()+getRows())){
+ last_enabled = false;
+ }
+ else{
+ last_enabled = true;
+ }
+ }
- public void setFirstRow(int rows) {
+ if (getFastControls().equals("auto")){
+ if (getFirstRow()==0){
+ fast_rewind_rendered = false;
+ fast_rewind_enabled = false;
+ }else{
+ fast_rewind_rendered = true;
+ fast_rewind_enabled = true;
+ }
+ if ((rowCount - 1)<=(getFirstRow()+getRows())){
+ fast_forward_rendered = false;
+ fast_forward_enabled = false;
+ }
+ else{
+ fast_forward_rendered = true;
+ fast_forward_enabled = true;
+ }
+
+ }
+ else if (getFastControls().equals("hide")){
+ fast_forward_rendered = false;
+ fast_forward_enabled = false;
+ fast_rewind_rendered = false;
+ fast_rewind_enabled = false;
+
+ }
+ else if (getFastControls().equals("show")){
+ fast_rewind_rendered = true;
+ fast_forward_rendered = true;
+ if (getFirstRow()==0){
+ fast_rewind_enabled = false;
+ }else{
+ fast_rewind_enabled = true;
+ }
+ if ((rowCount - 1)<=(getFirstRow()+getRows())){
+ fast_forward_enabled = false;
+ }
+ else{
+ fast_forward_enabled = true;
+ }
+
+
+ }
+
+ if (getStepControls().equals("auto")){
+ if (getFirstRow()==0){
+ previous_enabled = false;
+ previous_rendered = false;
+
+ }else{
+ previous_enabled = true;
+ previous_rendered = true;
+ }
+ if ((rowCount - 1)<=(getFirstRow()+getRows())){
+ next_enabled = false;
+ next_rendered = false;
+ }
+ else{
+ next_enabled = true;
+ next_rendered = true;
+ }
+ }
+ else if (getStepControls().equals("hide")){
+ next_rendered = false;
+ next_enabled = false;
+ previous_rendered = false;
+ previous_enabled = false;
+
+ }
+ else if (getStepControls().equals("show")){
+ next_rendered = true;
+ previous_rendered = true;
+ if (getFirstRow()==0){
+ previous_enabled = false;
+ }else{
+ previous_enabled = true;
+ }
+ if ((rowCount - 1)<=(getFirstRow()+getRows())){
+ next_enabled = false;
+ }
+ else{
+ next_enabled = true;
+ }
+ }
+ }
+
+
+ public void setFirstRow(int rows) {
getDataTable().setFirst(rows);
+ //setControls();
}
public String getFamily() {
Modified: trunk/richfaces/datascroller/src/main/java/org/richfaces/renderkit/html/DataScrollerRenderer.java
===================================================================
--- trunk/richfaces/datascroller/src/main/java/org/richfaces/renderkit/html/DataScrollerRenderer.java 2007-05-02 13:42:43 UTC (rev 607)
+++ trunk/richfaces/datascroller/src/main/java/org/richfaces/renderkit/html/DataScrollerRenderer.java 2007-05-02 14:37:26 UTC (rev 608)
@@ -53,7 +53,7 @@
ComponentVariables variables = ComponentsVariableResolver.getVariables(this, component);
variables.setVariable("dataTable", dataTable);
-
+ scroller.setControls();
if (!(scroller.getPageCount(dataTable) == 1) || (scroller.isRenderIfSinglePage()))
{
variables.setVariable("rendered", Boolean.TRUE);
Modified: trunk/richfaces/datascroller/src/main/templates/org/richfaces/htmlDatascroller.jspx
===================================================================
--- trunk/richfaces/datascroller/src/main/templates/org/richfaces/htmlDatascroller.jspx 2007-05-02 13:42:43 UTC (rev 607)
+++ trunk/richfaces/datascroller/src/main/templates/org/richfaces/htmlDatascroller.jspx 2007-05-02 14:37:26 UTC (rev 608)
@@ -26,118 +26,249 @@
style="#{component.attributes['style']};">
<table id="#{clientId}_table" align="#{component.attributes['align']}" border="0" cellpadding="0" cellspacing="1" class="dr-dscr-t rich-dtascroller-table #{component.attributes['tableStyleClass']}">
<tbody>
- <tr>
+ <tr>
<jsp:scriptlet><![CDATA[
- variables.setVariable("onclick", getOnClick(context,component,component.FIRST_FACET_NAME));
- if(component.getFacet(component.FIRST_FACET_NAME)!=null ) {
+ String facet;
+ if (component.first_rendered){
+ if (component.first_enabled){
+ variables.setVariable("color", "");
+ variables.setVariable("onclick", getOnClick(context,component,component.FIRST_FACET_NAME));
+ variables.setVariable("facet", component.FIRST_FACET_NAME);
+ facet=component.FIRST_FACET_NAME;
+ }else{
+ variables.setVariable("color", "color: " + org.ajax4jsf.framework.skin.SkinFactory.getInstance().getSkin(context).getParameter(context, "panelBorderColor", "gray")+ ";");
+ variables.setVariable("onclick", "");
+ variables.setVariable("facet", component.FIRST_DISABLED_FACET_NAME);
+ facet=component.FIRST_DISABLED_FACET_NAME;
+ };
+ if(component.getFacet(facet)!=null ) {
]]></jsp:scriptlet>
- <td align="center" class="dr-dscr-button rich-datascr-button" onclick="#{onclick}">
- <u:insertFacet name="first"/>
+ <td style="#{color}" align="center" class="dr-dscr-button rich-datascr-button" onclick="#{onclick}">
+ <jsp:scriptlet>
+ <![CDATA[if(component.FIRST_FACET_NAME.equals(facet)){]]>
+ </jsp:scriptlet>
+ <u:insertFacet name="first"/>
+ <jsp:scriptlet>
+ <![CDATA[}else{]]>
+ </jsp:scriptlet>
+ <u:insertFacet name="first_disabled"/>
+ <jsp:scriptlet>
+ <![CDATA[}]]>
+ </jsp:scriptlet>
</td>
<jsp:scriptlet><![CDATA[
}else{
]]></jsp:scriptlet>
- <td align="center" class="dr-dscr-button rich-datascr-button" onclick="#{onclick}">
+ <td style="#{color}" align="center" class="dr-dscr-button rich-datascr-button" onclick="#{onclick}">
<jsp:scriptlet><![CDATA[
writer.write("««");
]]></jsp:scriptlet>
</td>
<jsp:scriptlet><![CDATA[
}
+ }
]]></jsp:scriptlet>
-
- <jsp:scriptlet><![CDATA[
- variables.setVariable("onclick", getOnClick(context,component,component.FAST_REWIND_FACET_NAME));
- if(component.getFacet(component.FAST_REWIND_FACET_NAME)!=null ) {
+ <jsp:scriptlet><![CDATA[
+ if (component.fast_rewind_rendered){
+ if (component.fast_rewind_enabled){
+ variables.setVariable("color", "");
+ variables.setVariable("onclick", getOnClick(context,component,component.FAST_REWIND_FACET_NAME));
+ variables.setVariable("facet", component.FAST_REWIND_FACET_NAME);
+ facet=component.FAST_REWIND_FACET_NAME;
+ }else{
+ variables.setVariable("color", "color: " + org.ajax4jsf.framework.skin.SkinFactory.getInstance().getSkin(context).getParameter(context, "panelBorderColor", "gray")+ ";");
+ variables.setVariable("onclick", "");
+ variables.setVariable("facet", component.FAST_REWIND_DISABLED_FACET_NAME);
+ facet=component.FAST_REWIND_DISABLED_FACET_NAME;
+ }
+ if(component.getFacet(facet)!=null ) {
]]></jsp:scriptlet>
- <td align="center" class="dr-dscr-button rich-datascr-button" onclick="#{onclick}">
- <u:insertFacet name="fastrewind"/>
+ <td style="#{color}" align="center" class="dr-dscr-button rich-datascr-button" onclick="#{onclick}">
+ <jsp:scriptlet>
+ <![CDATA[if(component.FAST_REWIND_FACET_NAME.equals(facet)){]]>
+ </jsp:scriptlet>
+ <u:insertFacet name="fastrewind"/>
+ <jsp:scriptlet>
+ <![CDATA[}else{]]>
+ </jsp:scriptlet>
+ <u:insertFacet name="fastrewind_disabled"/>
+ <jsp:scriptlet>
+ <![CDATA[}]]>
+ </jsp:scriptlet>
</td>
<jsp:scriptlet><![CDATA[
}else{
]]></jsp:scriptlet>
- <td align="center" class="dr-dscr-button rich-datascr-button" onclick="#{onclick}">
+ <td style="#{color}" align="center" class="dr-dscr-button rich-datascr-button" onclick="#{onclick}">
<jsp:scriptlet><![CDATA[
writer.write("«");
]]></jsp:scriptlet>
</td>
<jsp:scriptlet><![CDATA[
- }
+ }
+ }
]]></jsp:scriptlet>
-
- <jsp:scriptlet><![CDATA[
- variables.setVariable("onclick", getOnClick(context,component,component.PREVIOUS_FACET_NAME));
- if(component.getFacet(component.PREVIOUS_FACET_NAME)!=null ) {
+
+ <jsp:scriptlet><![CDATA[
+ if (component.previous_rendered){
+ if (component.previous_enabled){
+ variables.setVariable("color", "");
+ variables.setVariable("onclick", getOnClick(context,component,component.PREVIOUS_FACET_NAME));
+ variables.setVariable("facet", component.PREVIOUS_FACET_NAME);
+ facet=component.PREVIOUS_FACET_NAME;
+ }else{
+ variables.setVariable("onclick", "");
+ variables.setVariable("color", "color: " + org.ajax4jsf.framework.skin.SkinFactory.getInstance().getSkin(context).getParameter(context, "panelBorderColor", "gray")+ ";");
+ variables.setVariable("facet", component.PREVIOUS_DISABLED_FACET_NAME);
+ facet=component.PREVIOUS_DISABLED_FACET_NAME;
+ }
+ if(component.getFacet(facet)!=null ) {
]]></jsp:scriptlet>
- <td align="center" class="dr-dscr-button rich-datascr-button" onclick="#{onclick}">
- <u:insertFacet name="previous"/>
+ <td style="#{color}" align="center" class="dr-dscr-button rich-datascr-button" onclick="#{onclick}">
+ <jsp:scriptlet>
+ <![CDATA[if(component.PREVIOUS_FACET_NAME.equals(facet)){]]>
+ </jsp:scriptlet>
+ <u:insertFacet name="previous"/>
+ <jsp:scriptlet>
+ <![CDATA[}else{]]>
+ </jsp:scriptlet>
+ <u:insertFacet name="previous_disabled"/>
+ <jsp:scriptlet>
+ <![CDATA[}]]>
+ </jsp:scriptlet>
</td>
<jsp:scriptlet><![CDATA[
}else{
]]></jsp:scriptlet>
- <td align="center" class="dr-dscr-button rich-datascr-button" onclick="#{onclick}">
-
+ <td style="#{color}" align="center" class="dr-dscr-button rich-datascr-button" onclick="#{onclick}">
</td>
<jsp:scriptlet><![CDATA[
}
+ }
]]></jsp:scriptlet>
- <f:call name="renderPager"/>
+ <f:call name="renderPager"/>
-
<jsp:scriptlet><![CDATA[
- variables.setVariable("onclick", getOnClick(context,component,component.NEXT_FACET_NAME));
- if(component.getFacet(component.NEXT_FACET_NAME)!=null ) {
+ if (component.next_rendered){
+ if (component.next_enabled){
+ variables.setVariable("onclick", getOnClick(context,component,component.NEXT_FACET_NAME));
+ variables.setVariable("color", "");
+ variables.setVariable("facet", component.NEXT_FACET_NAME);
+ facet=component.NEXT_FACET_NAME;
+ }else{
+ variables.setVariable("onclick", "");
+ variables.setVariable("color", "color: " + org.ajax4jsf.framework.skin.SkinFactory.getInstance().getSkin(context).getParameter(context, "panelBorderColor", "gray")+ ";");
+ variables.setVariable("facet", component.NEXT_DISABLED_FACET_NAME);
+ facet=component.NEXT_DISABLED_FACET_NAME;
+ }
+ if(component.getFacet(facet)!=null ) {
]]></jsp:scriptlet>
- <td align="center" class="dr-dscr-button rich-datascr-button" onclick="#{onclick}">
- <u:insertFacet name="next"/>
+ <td style="#{color}" align="center" class="dr-dscr-button rich-datascr-button" onclick="#{onclick}">
+ <jsp:scriptlet>
+ <![CDATA[if(component.NEXT_FACET_NAME.equals(facet)){]]>
+ </jsp:scriptlet>
+ <u:insertFacet name="next"/>
+ <jsp:scriptlet>
+ <![CDATA[}else{]]>
+ </jsp:scriptlet>
+ <u:insertFacet name="next_disabled"/>
+ <jsp:scriptlet>
+ <![CDATA[}]]>
+ </jsp:scriptlet>
</td>
<jsp:scriptlet><![CDATA[
}else{
]]></jsp:scriptlet>
- <td align="center" class="dr-dscr-button rich-datascr-button" onclick="#{onclick}">
+ <td style="#{color}" align="center" class="dr-dscr-button rich-datascr-button" onclick="#{onclick}">
</td>
<jsp:scriptlet><![CDATA[
}
+ }
]]></jsp:scriptlet>
<jsp:scriptlet><![CDATA[
- variables.setVariable("onclick", getOnClick(context,component,component.FAST_FORWARD_FACET_NAME));
- if(component.getFacet(component.FAST_FORWARD_FACET_NAME)!=null ) {
+ if (component.fast_forward_rendered){
+ if (component.fast_forward_enabled){
+ variables.setVariable("onclick", getOnClick(context,component,component.FAST_FORWARD_FACET_NAME));
+ variables.setVariable("color", "");
+ variables.setVariable("facet", component.FAST_FORWARD_FACET_NAME);
+ facet=component.FAST_FORWARD_FACET_NAME;
+ }
+ else{
+ variables.setVariable("onclick", "");
+ variables.setVariable("color", "color: " + org.ajax4jsf.framework.skin.SkinFactory.getInstance().getSkin(context).getParameter(context, "panelBorderColor", "gray")+ ";");
+ variables.setVariable("facet", component.FAST_FORWARD_DISABLED_FACET_NAME);
+ facet=component.FAST_FORWARD_DISABLED_FACET_NAME;
+ }
+ if(component.getFacet(facet)!=null ) {
]]></jsp:scriptlet>
- <td align="center" class="dr-dscr-button rich-datascr-button" onclick="#{onclick}">
- <u:insertFacet name="fastforward"/>
+ <td style="#{color}" align="center" class="dr-dscr-button rich-datascr-button" onclick="#{onclick}">
+ <jsp:scriptlet>
+ <![CDATA[if(component.FAST_FORWARD_FACET_NAME.equals(facet)){]]>
+ </jsp:scriptlet>
+ <u:insertFacet name="fastforward"/>
+ <jsp:scriptlet>
+ <![CDATA[}else{]]>
+ </jsp:scriptlet>
+ <u:insertFacet name="fastforward_disabled"/>
+ <jsp:scriptlet>
+ <![CDATA[}]]>
+ </jsp:scriptlet>
</td>
<jsp:scriptlet><![CDATA[
}else{
]]></jsp:scriptlet>
- <td align="center" class="dr-dscr-button rich-datascr-button" onclick="#{onclick}">
+ <td style="#{color}" align="center" class="dr-dscr-button rich-datascr-button" onclick="#{onclick}">
<jsp:scriptlet><![CDATA[
writer.write("»");
]]></jsp:scriptlet>
</td>
<jsp:scriptlet><![CDATA[
- }
+ }
+ }
]]></jsp:scriptlet>
<jsp:scriptlet><![CDATA[
- variables.setVariable("onclick", getOnClick(context,component,component.LAST_FACET_NAME));
- if(component.getFacet(component.LAST_FACET_NAME)!=null ) {
+ if (component.last_rendered){
+ if (component.last_enabled){
+ variables.setVariable("onclick", getOnClick(context,component,component.LAST_FACET_NAME));
+ variables.setVariable("color", "");
+ variables.setVariable("facet", component.LAST_FACET_NAME);
+ facet=component.LAST_FACET_NAME;
+ }else{
+ variables.setVariable("onclick", "");
+ variables.setVariable("color", "color: " + org.ajax4jsf.framework.skin.SkinFactory.getInstance().getSkin(context).getParameter(context, "panelBorderColor", "gray")+ ";");
+ variables.setVariable("facet", component.LAST_DISABLED_FACET_NAME);
+ facet=component.LAST_DISABLED_FACET_NAME;
+ }
+ if(component.getFacet(facet)!=null ) {
]]></jsp:scriptlet>
- <td align="center" class="dr-dscr-button rich-datascr-button" onclick="#{onclick}">
- <u:insertFacet name="last"/>
+ <td style="#{color}" align="center" class="dr-dscr-button rich-datascr-button" onclick="#{onclick}">
+ <jsp:scriptlet>
+ <![CDATA[if(component.LAST_FACET_NAME.equals(facet)){]]>
+ </jsp:scriptlet>
+ <u:insertFacet name="last"/>
+ <jsp:scriptlet>
+ <![CDATA[}else{]]>
+ </jsp:scriptlet>
+ <u:insertFacet name="last_disabled"/>
+ <jsp:scriptlet>
+ <![CDATA[}]]>
+ </jsp:scriptlet>
</td>
<jsp:scriptlet><![CDATA[
}else{
]]></jsp:scriptlet>
- <td align="center" class="dr-dscr-button rich-datascr-button" onclick="#{onclick}">
+ <td style="#{color}" align="center" class="dr-dscr-button rich-datascr-button" onclick="#{onclick}">
<jsp:scriptlet><![CDATA[
writer.write("»»");
]]></jsp:scriptlet>
</td>
<jsp:scriptlet><![CDATA[
}
+ }
]]></jsp:scriptlet>
</tr>
<vcp:body>
17 years, 5 months
JBoss Rich Faces SVN: r607 - in trunk/richfaces/suggestionbox/src: main/java/org/richfaces/component and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: a.izobov
Date: 2007-05-02 09:42:43 -0400 (Wed, 02 May 2007)
New Revision: 607
Removed:
trunk/richfaces/suggestionbox/src/main/java/org/richfaces/component/SuggestionEvent.java
trunk/richfaces/suggestionbox/src/test/java/org/richfaces/component/SuggestionEventTest.java
Modified:
trunk/richfaces/suggestionbox/src/main/config/component/suggestionbox.xml
trunk/richfaces/suggestionbox/src/main/java/org/richfaces/component/UISuggestionBox.java
trunk/richfaces/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java
Log:
RF-112 fixed
Modified: trunk/richfaces/suggestionbox/src/main/config/component/suggestionbox.xml
===================================================================
--- trunk/richfaces/suggestionbox/src/main/config/component/suggestionbox.xml 2007-05-02 13:29:05 UTC (rev 606)
+++ trunk/richfaces/suggestionbox/src/main/config/component/suggestionbox.xml 2007-05-02 13:42:43 UTC (rev 607)
@@ -123,13 +123,13 @@
</description>
</property>
-
+
<property>
<name>onsubmit</name>
<classname>java.lang.String</classname>
<description>JavaScript code for call before submission of ajax event.</description>
</property>
-
+
<property>
<name>selectedClass</name>
<classname>java.lang.String</classname>
@@ -299,7 +299,6 @@
<classname>java.lang.String</classname>
<description>align</description>
</property>
-
<property>
<name>zindex</name>
<classname>int</classname>
@@ -308,5 +307,11 @@
</description>
<defaultvalue>200</defaultvalue>
</property>
+ <property hidden="true">
+ <name>submitedValue</name>
+ <classname>java.lang.Object</classname>
+ <description>submitedValue</description>
+ </property>
+
</component>
</components>
Deleted: trunk/richfaces/suggestionbox/src/main/java/org/richfaces/component/SuggestionEvent.java
===================================================================
--- trunk/richfaces/suggestionbox/src/main/java/org/richfaces/component/SuggestionEvent.java 2007-05-02 13:29:05 UTC (rev 606)
+++ trunk/richfaces/suggestionbox/src/main/java/org/richfaces/component/SuggestionEvent.java 2007-05-02 13:42:43 UTC (rev 607)
@@ -1,74 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces 3.0 - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.component;
-
-import javax.faces.component.UIComponent;
-
-/**
- * Event implementation for SuggestionBox component.
- */
-public class SuggestionEvent extends javax.faces.event.ActionEvent {
-
- /**
- * Serial Version UID.
- */
- private static final long serialVersionUID = 3192468135298986660L;
-
- /**
- * Submitted value.
- */
- private Object submittedValue;
-
- /**
- * Constructor.
- *
- * @param component {@link javax.faces.component.UIComponent}
- * @param value The submitted value to set
- */
- public SuggestionEvent(final UIComponent component, final Object value) {
- super(component);
- this.submittedValue = value;
- }
-
- /**
- * Constructor.
- *
- * @param component {@link javax.faces.component.UIComponent}
- */
- public SuggestionEvent(final UIComponent component) {
- super(component);
- }
-
- /**
- * @return Returns the submittedValie.
- */
- public final Object getSubmittedValue() {
- return this.submittedValue;
- }
-
- /**
- * @param value The submittedValie to set.
- */
- public final void setSubmittedValue(final Object value) {
- this.submittedValue = value;
- }
-}
Modified: trunk/richfaces/suggestionbox/src/main/java/org/richfaces/component/UISuggestionBox.java
===================================================================
--- trunk/richfaces/suggestionbox/src/main/java/org/richfaces/component/UISuggestionBox.java 2007-05-02 13:29:05 UTC (rev 606)
+++ trunk/richfaces/suggestionbox/src/main/java/org/richfaces/component/UISuggestionBox.java 2007-05-02 13:42:43 UTC (rev 607)
@@ -83,6 +83,10 @@
*
* @return for value from local variable or value bindings
*/
+ public abstract Object getSubmitedValue();
+
+ public abstract void setSubmitedValue(Object v);
+
public abstract String getFor();
/**
@@ -249,7 +253,7 @@
/**
* Getter for submitted.
- *
+ *
* @return TRUE if submited
*/
public boolean isSubmitted() {
@@ -270,39 +274,12 @@
public abstract void setZindex(int zindex);
/* (non-Javadoc)
- * @see javax.faces.component.UIComponentBase#queueEvent(javax.faces.event.FacesEvent)
- */
- public final void queueEvent(final FacesEvent event) {
- if (event instanceof SuggestionEvent) {
- if (isImmediate()) {
- event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
- } else if (isBypassUpdates()) {
- event.setPhaseId(PhaseId.PROCESS_VALIDATIONS);
- } else {
- event.setPhaseId(PhaseId.INVOKE_APPLICATION);
- }
- }
- super.queueEvent(event);
- }
-
-
- /* (non-Javadoc)
* @see javax.faces.component.UIData#broadcast(javax.faces.event.FacesEvent)
*/
public final void broadcast(final FacesEvent event)
throws AbortProcessingException {
super.broadcast(event);
- if (event instanceof SuggestionEvent) {
- SuggestionEvent suggestionEvent = (SuggestionEvent) event;
- Object value = suggestionEvent.getSubmittedValue();
- MethodBinding suggestingAction = getSuggestionAction();
- if (null != suggestingAction) {
- // TODO - use converter
- setValue(suggestingAction.invoke(
- getFacesContext(), new Object[]{value}));
- getFacesContext().renderResponse();
- }
- } else if (event instanceof AjaxEvent) {
+ if (event instanceof AjaxEvent) {
FacesContext context = getFacesContext();
AjaxRendererUtils.addRegionsFromComponent(this, context);
AjaxRendererUtils.addRegionByName(context, this, this.getId());
Modified: trunk/richfaces/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java
===================================================================
--- trunk/richfaces/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java 2007-05-02 13:29:05 UTC (rev 606)
+++ trunk/richfaces/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java 2007-05-02 13:42:43 UTC (rev 607)
@@ -36,7 +36,6 @@
import org.ajax4jsf.framework.util.javascript.JSFunction;
import org.ajax4jsf.framework.util.javascript.JSFunctionDefinition;
import org.richfaces.component.AjaxSuggestionEvent;
-import org.richfaces.component.SuggestionEvent;
import org.richfaces.component.UISuggestionBox;
import javax.faces.FacesException;
@@ -46,6 +45,7 @@
import javax.faces.component.UIData;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
+import javax.faces.el.MethodBinding;
import javax.faces.event.FacesEvent;
import java.io.IOException;
import java.util.ArrayList;
@@ -138,8 +138,7 @@
paramName = "inputvalue";
}
Object elementValue = requestParameterMap.get(paramName);
- FacesEvent event = new SuggestionEvent(component, elementValue);
- component.queueEvent(event);
+ ((UISuggestionBox)component).setSubmitedValue(elementValue);
component.queueEvent(
new AjaxSuggestionEvent(component, elementValue));
}
@@ -248,6 +247,13 @@
throws IOException {
UISuggestionBox suggestionBox = (UISuggestionBox) component;
if (suggestionBox.isSubmitted()) {
+ Object value = suggestionBox.getSubmitedValue();
+ MethodBinding suggestingAction = suggestionBox.getSuggestionAction();
+ if (null != suggestingAction) {
+ // TODO - use converter
+ suggestionBox.setValue(suggestingAction.invoke(
+ context, new Object[]{value}));
+ }
body.encode(getTemplateContext(context, suggestionBox));
// Replace rendered area ID from component to suggestion table
suggestionBox.setRowIndex(-1);
Deleted: trunk/richfaces/suggestionbox/src/test/java/org/richfaces/component/SuggestionEventTest.java
===================================================================
--- trunk/richfaces/suggestionbox/src/test/java/org/richfaces/component/SuggestionEventTest.java 2007-05-02 13:29:05 UTC (rev 606)
+++ trunk/richfaces/suggestionbox/src/test/java/org/richfaces/component/SuggestionEventTest.java 2007-05-02 13:42:43 UTC (rev 607)
@@ -1,72 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces 3.0 - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.component;
-
-import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
-
-/**
- * Unit test for SuggestionEvent.
- */
-public class SuggestionEventTest extends AbstractAjax4JsfTestCase {
-
- private SuggestionEvent event1;
- private SuggestionEvent event2;
- private UISuggestionBox sb;
-
- /**
- * Create the test case
- *
- * @param testName name of the test case
- */
- public SuggestionEventTest(String testName) {
- super(testName);
- }
-
- /* (non-Javadoc)
- * @see org.ajax4jsf.tests.AbstractAjax4JsfTestCase#setUp()
- */
- public void setUp() throws Exception {
- super.setUp();
-
- sb = (UISuggestionBox)application.createComponent("org.richfaces.SuggestionBox");
- event1 = new SuggestionEvent(sb);
- event2 = new SuggestionEvent(sb, "VALUE2");
- }
-
- /* (non-Javadoc)
- * @see org.ajax4jsf.tests.AbstractAjax4JsfTestCase#tearDown()
- */
- public void tearDown() throws Exception {
- super.tearDown();
- event1 = null;
- event2 = null;
- sb = null;
- }
-
- public void testEvent() throws Exception {
- assertNull(event1.getSubmittedValue());
- event1.setSubmittedValue("VALUE1");
- assertEquals("VALUE1", event1.getSubmittedValue());
-
- assertEquals("VALUE2", event2.getSubmittedValue());
- }
-}
17 years, 5 months
JBoss Rich Faces SVN: r606 - trunk/richfaces/togglePanel/src/main/templates.
by richfaces-svn-commits@lists.jboss.org
Author: F.antonov
Date: 2007-05-02 09:29:05 -0400 (Wed, 02 May 2007)
New Revision: 606
Modified:
trunk/richfaces/togglePanel/src/main/templates/togglePanel.jspx
Log:
Fix for bug http://jira.jboss.com/jira/browse/RF-124.
Modified: trunk/richfaces/togglePanel/src/main/templates/togglePanel.jspx
===================================================================
--- trunk/richfaces/togglePanel/src/main/templates/togglePanel.jspx 2007-05-02 13:25:52 UTC (rev 605)
+++ trunk/richfaces/togglePanel/src/main/templates/togglePanel.jspx 2007-05-02 13:29:05 UTC (rev 606)
@@ -21,5 +21,6 @@
<div id="#{clientId}">
<vcp:body/>
<f:call name="handleFacets"/>
+ <f:call name="setValue"/>
</div>
</f:root>
\ No newline at end of file
17 years, 5 months
JBoss Rich Faces SVN: r605 - trunk/richfaces/togglePanel/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: F.antonov
Date: 2007-05-02 09:25:52 -0400 (Wed, 02 May 2007)
New Revision: 605
Modified:
trunk/richfaces/togglePanel/src/main/java/org/richfaces/renderkit/html/TogglePanelRenderer.java
Log:
Fix for bug http://jira.jboss.com/jira/browse/RF-124.
Modified: trunk/richfaces/togglePanel/src/main/java/org/richfaces/renderkit/html/TogglePanelRenderer.java
===================================================================
--- trunk/richfaces/togglePanel/src/main/java/org/richfaces/renderkit/html/TogglePanelRenderer.java 2007-05-02 12:53:26 UTC (rev 604)
+++ trunk/richfaces/togglePanel/src/main/java/org/richfaces/renderkit/html/TogglePanelRenderer.java 2007-05-02 13:25:52 UTC (rev 605)
@@ -167,4 +167,14 @@
public boolean getRendersChildren() {
return true;
}
+
+ public void setValue(FacesContext context, UIComponent component) {
+ UITogglePanel panel = (UITogglePanel) component;
+ Object value = panel.getValue();
+ if (value == null) {
+ value = panel.getStateOrderList().size() > 0
+ ? panel.getStateOrderList().get(0) : "";
+ panel.setValue(value);
+ }
+ }
}
\ No newline at end of file
17 years, 5 months