JBoss Rich Faces SVN: r6648 - in trunk/ui/progressBAR/src/main: resources/org/richfaces/renderkit/html/css and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-03-10 10:42:18 -0400 (Mon, 10 Mar 2008)
New Revision: 6648
Modified:
trunk/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java
trunk/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/css/progressBar.xcss
Log:
css class names refactoring
Modified: trunk/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java
===================================================================
--- trunk/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java 2008-03-10 14:05:05 UTC (rev 6647)
+++ trunk/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java 2008-03-10 14:42:18 UTC (rev 6648)
@@ -450,7 +450,7 @@
// <div class='completeClass' id='clientId:complete' style='style'></div>
writer.startElement("div", component);
getUtils().writeAttribute(writer, "class",
- "rich-progress-bar_height_dig rich-progress-bar-width rich-progress-bar-completed rich-progress-bar-padding " + completeClass);
+ "rich-progress-bar-height-dig rich-progress-bar-width rich-progress-bar-completed rich-progress-bar-padding " + completeClass);
getUtils().writeAttribute(writer, "id", clientId + ":complete");
getUtils().writeAttribute(writer, "style", style);
writer.endElement("div");
Modified: trunk/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/css/progressBar.xcss
===================================================================
--- trunk/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/css/progressBar.xcss 2008-03-10 14:05:05 UTC (rev 6647)
+++ trunk/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/css/progressBar.xcss 2008-03-10 14:42:18 UTC (rev 6648)
@@ -8,7 +8,7 @@
<f:verbatim>
.rich-progress-bar-height{height : 13px;}
- .rich-progress-bar_height_dig{height:}
+ .rich-progress-bar-height-dig{height:}
.rich-progress-bar-width{width : 200px}
.rich-progress-bar-block{white-space : nowrap;}
.rich-progress-bar-uploaded{background-repeat : repeat-x;}
16 years, 10 months
JBoss Rich Faces SVN: r6647 - trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-03-10 10:05:05 -0400 (Mon, 10 Mar 2008)
New Revision: 6647
Modified:
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js
Log:
positioning input's button
Modified: trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js
===================================================================
--- trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js 2008-03-10 12:43:39 UTC (rev 6646)
+++ trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js 2008-03-10 14:05:05 UTC (rev 6647)
@@ -5,6 +5,8 @@
this.button = $(buttonId);
$super(clientId, temValueKeepId, valueKeepId, tabberId, strutId, attributes, events, classes, barParams);
this.clickOnBar = false;
+
+ this.button.style.top = Richfaces.getBorderWidth(this.tempValueKeeper, "t") + "px";
},
initHandlers : function($super) {
@@ -141,7 +143,7 @@
getCurrentText : function() {
return this.inplaceInput.childNodes[7];
- },
+ }
//setStrutWidth : function() {}
});
16 years, 10 months
JBoss Rich Faces SVN: r6644 - in trunk/ui/inplaceSelect/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-03-10 07:24:01 -0400 (Mon, 10 Mar 2008)
New Revision: 6644
Modified:
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/css/inplaceselect.xcss
trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
Log:
input positioning is changed
Modified: trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/css/inplaceselect.xcss
===================================================================
--- trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/css/inplaceselect.xcss 2008-03-10 11:20:19 UTC (rev 6643)
+++ trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/css/inplaceselect.xcss 2008-03-10 11:24:01 UTC (rev 6644)
@@ -16,15 +16,16 @@
background-repeat : no-repeat;
}
-.rich-inplace {
+.rich-inplace-select {
+ position : relative;
}
.rich-inplace-select-view{
white-space : nowrap;
border-bottom-width: 1px;
border-bottom-style: dashed;
- padding-left : 3px;
- padding-right : 3px;
+ /*padding-left : 3px;
+ padding-right : 3px;*/
}
.rich-inplace-select-changed{
@@ -40,7 +41,7 @@
}
.rich-inplace-select-edit{
- position : relative;
+ /*position : relative;*/
}
.rich-inplace-select-field {
@@ -49,8 +50,9 @@
border-style: inset;
margin : 0px;
font: inherit;
- position: absolute;
- left: 0px;
+ position:absolute;
+ top:0px;
+ left:0px;
}
.rich-inplace-select-strut{
Modified: trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
===================================================================
--- trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2008-03-10 11:20:19 UTC (rev 6643)
+++ trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2008-03-10 11:24:01 UTC (rev 6644)
@@ -156,9 +156,9 @@
SELECTED : 'rich-inplace-select-item rich-inplace-select-font rich-inplace-select-selected-item #{itemSelectedClass}'
}
},
- COMPONENT : {CHANGED : {NORMAL : 'rich-inplace rich-inplace-select-view rich-inplace-select-changed #{component.attributes["changedClass"]}', HOVERED : 'rich-inplace-select-changed-hover #{component.attributes["changedHoverClass"]}'},
- VIEW : {NORMAL : 'rich-inplace rich-inplace-select-view #{component.attributes["viewClass"]}', HOVERED : 'rich-inplace-select-view-hover #{component.attributes["viewHoverClass"]}'},
- EDITABLE : 'rich-inplace rich-inplace-select-edit #{component.attributes["editClass"]}'
+ COMPONENT : {CHANGED : {NORMAL : 'rich-inplace-select rich-inplace-select-view rich-inplace-select-changed #{component.attributes["changedClass"]}', HOVERED : 'rich-inplace-select-changed-hover #{component.attributes["changedHoverClass"]}'},
+ VIEW : {NORMAL : 'rich-inplace-select rich-inplace-select-view #{component.attributes["viewClass"]}', HOVERED : 'rich-inplace-select-view-hover #{component.attributes["viewHoverClass"]}'},
+ EDITABLE : 'rich-inplace-select rich-inplace-select-edit #{component.attributes["editClass"]}'
}
};
16 years, 10 months
JBoss Rich Faces SVN: r6643 - trunk/ui/progressBAR/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-03-10 07:20:19 -0400 (Mon, 10 Mar 2008)
New Revision: 6643
Modified:
trunk/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java
Log:
RF-2363
Modified: trunk/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java
===================================================================
--- trunk/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java 2008-03-10 11:17:59 UTC (rev 6642)
+++ trunk/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java 2008-03-10 11:20:19 UTC (rev 6643)
@@ -34,6 +34,8 @@
import org.ajax4jsf.resource.CountingOutputWriter;
import org.richfaces.component.UIProgressBar;
+import com.sun.facelets.FaceletException;
+
/**
* Abstract progress bar renderer
*
@@ -226,9 +228,14 @@
String clientId = component.getClientId(context);
String containerId = ((UIComponent) AjaxRendererUtils
.findAjaxContainer(context, component)).getClientId(context);
- String formId = ((UIComponent) AjaxRendererUtils
- .getNestingForm(component)).getClientId(context);
String mode = (String) component.getAttributes().get("mode");
+ UIComponent form = AjaxRendererUtils.getNestingForm(component);
+ String formId = null;
+ if (form != null) {
+ formId = form.getClientId(context);
+ }else if ("ajax".equals(mode)){
+ throw new FaceletException("Progress bar component in ajax mode should be placed inside the form");
+ }
Number minValue = getNumber(component.getAttributes().get("minValue"));
Number maxValue = getNumber(component.getAttributes().get("maxValue"));
Number value =(Number)variables.getVariable("value");
16 years, 10 months
JBoss Rich Faces SVN: r6642 - in trunk/samples/richfaces-demo/src/main/webapp/richfaces: sortingFilteringFeatures and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2008-03-10 07:17:59 -0400 (Mon, 10 Mar 2008)
New Revision: 6642
Added:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeature.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/
trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/examples/
trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/examples/externalFiltering.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/examples/externalMultipleSorting.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/examples/simpleFiltering.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/examples/simpleSingleSorting.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/filteringUsage.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/sortingUsage.xhtml
Log:
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeature.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeature.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeature.xhtml 2008-03-10 11:17:59 UTC (rev 6642)
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:rich="http://richfaces.org/rich">
+<ui:composition template="/templates/main.xhtml">
+ <ui:define name="title">RichFaces - Open Source Rich JSF Components - Sorting and Filtering Features</ui:define>
+ <ui:define name="body">
+ <rich:tabPanel switchType="server" styleClass="top_tab" contentClass="content_tab" headerClass="header_tabs_class" inactiveTabClass="inactive_tab" activeTabClass="active_tab">
+ <rich:tab label="Filtering Feature">
+ <ui:include src="/richfaces/sortingFilteringFeatures/filteringUsage.xhtml"/>
+ </rich:tab>
+ <rich:tab label="Sorting Feature">
+ <ui:include src="/richfaces/sortingFilteringFeatures/sortingUsage.xhtml"/>
+ </rich:tab>
+ </rich:tabPanel>
+ </ui:define>
+</ui:composition>
+</html>
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/examples/externalFiltering.xhtml
===================================================================
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/examples/externalMultipleSorting.xhtml
===================================================================
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/examples/simpleFiltering.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/examples/simpleFiltering.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/examples/simpleFiltering.xhtml 2008-03-10 11:17:59 UTC (rev 6642)
@@ -0,0 +1,28 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+ <h:form>
+ <rich:panel style="overflow:auto; width:300px; height:300px;">
+ <rich:dataTable value="#{capitalsBean.capitals}" var="cap" width="500px">
+ <f:facet name="header">
+ <h:outputText value="Filtering Example"/>
+ </f:facet>
+ <rich:column>
+ <f:facet name="header">
+ <h:graphicImage value="/images/ico_DataTable.gif"></h:graphicImage>
+ </f:facet>
+ <h:graphicImage value="#{cap.stateFlag}"/>
+ </rich:column>
+ <rich:column filterBy="#{cap.state}">
+ <rich:calendar popup="true"></rich:calendar>
+ </rich:column>
+ <rich:column filterBy="#{cap.name}">
+ <rich:inplaceInput value="#{cap.name}"/>
+ </rich:column>
+ </rich:dataTable>
+ </rich:panel>
+ </h:form>
+</ui:composition>
\ No newline at end of file
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/examples/simpleSingleSorting.xhtml
===================================================================
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/filteringUsage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/filteringUsage.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/filteringUsage.xhtml 2008-03-10 11:17:59 UTC (rev 6642)
@@ -0,0 +1,29 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:rich="http://richfaces.org/rich">
+ <ui:composition template="/templates/component-sample.xhtml">
+ <ui:define name="sample">
+
+ <p>
+ SHORT DESCRIPTION
+ </p>
+
+ <div class="sample-container" >
+
+ <ui:include src="/richfaces/sortingFilteringFeatures/examples/simpleFiltering.xhtml"/>
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath" value="/richfaces/sortingFilteringFeatures/examples/simpleFiltering.xhtml"/>
+ </ui:include>
+ </div>
+
+ <p>
+ DESCRIPTION
+ </p>
+
+ </ui:define>
+
+ </ui:composition>
+</html>
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/sortingUsage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/sortingUsage.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/sortingUsage.xhtml 2008-03-10 11:17:59 UTC (rev 6642)
@@ -0,0 +1,3 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+</html>
\ No newline at end of file
16 years, 10 months
JBoss Rich Faces SVN: r6641 - in trunk/samples/richfaces-demo/src/main: webapp/richfaces/inplaceInput/examples and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2008-03-10 07:17:31 -0400 (Mon, 10 Mar 2008)
New Revision: 6641
Modified:
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties
trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceInput/examples/simple.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/modalPanel/examples/simplePanel.xhtml
Log:
Modified: trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties
===================================================================
--- trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties 2008-03-10 11:05:01 UTC (rev 6640)
+++ trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties 2008-03-10 11:17:31 UTC (rev 6641)
@@ -76,4 +76,5 @@
progressBar=richOutputs, Progress Bar, \t\t \t\t/images/ico_DataTable.gif, /images/cn_listShuttle.gif, RichFacesComponentsLibrary.html\#progressBar, jbossrichfaces/freezone/docs/tlddoc/rich/progressBar.html, \t\tjbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIprogressBar.html, \t/richfaces/progressBar.jsf
comboBox=richInputs, Combo Box, \t\t/images/ico_ComboBox.gif, \t\t/images/cn_ComboBox.gif, RichFacesComponentsLibrary.html\#comboBox, jbossrichfaces/freezone/docs/tlddoc/rich/comboBox.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIcomboBox.html, \t\t\t\t\t/richfaces/comboBox.jsf
inplaceInput=richInputs, Inplace Input, \t\t/images/ico_InplaceInput.gif, \t\t/images/cn_InplaceInput.gif, RichFacesComponentsLibrary.html\#inplaceInput, jbossrichfaces/freezone/docs/tlddoc/rich/inplaceInput.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIinplaceInput.html, \t\t\t\t\t/richfaces/inplaceInput.jsf
-inplaceSelect=richInputs, Inplace Select, \t\t/images/ico_InplaceSelect.gif, \t\t/images/cn_InplaceSelect.gif, RichFacesComponentsLibrary.html\#inplaceSelect, jbossrichfaces/freezone/docs/tlddoc/rich/inplaceSelect.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIinplaceSelect.html, \t\t\t\t\t/richfaces/inplaceSelect.jsf
\ No newline at end of file
+inplaceSelect=richInputs, Inplace Select, \t\t/images/ico_InplaceSelect.gif, \t\t/images/cn_InplaceSelect.gif, RichFacesComponentsLibrary.html\#inplaceSelect, jbossrichfaces/freezone/docs/tlddoc/rich/inplaceSelect.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIinplaceSelect.html, \t\t\t\t\t/richfaces/inplaceSelect.jsf
+sortingFiltering=richDataIterators, Sorting and Filtering Features, \t\t/images/ico_DataTable.gif, \t\t/images/cn_DataTable.gif, RichFacesComponentsLibrary.html\#dataTable, jbossrichfaces/freezone/docs/tlddoc/rich/dataTable.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIdataTable.html, \t\t\t\t\t/richfaces/sortingFilteringFeature.jsf
\ No newline at end of file
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceInput/examples/simple.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceInput/examples/simple.xhtml 2008-03-10 11:05:01 UTC (rev 6640)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceInput/examples/simple.xhtml 2008-03-10 11:17:31 UTC (rev 6641)
@@ -4,5 +4,5 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
- <rich:inplaceInput value="#{inplaceComponentsBean.inputValue}"/>
+ <rich:inplaceInput value="#{inplaceComponentsBean.inputValue}" />
</ui:composition>
\ No newline at end of file
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/modalPanel/examples/simplePanel.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/modalPanel/examples/simplePanel.xhtml 2008-03-10 11:05:01 UTC (rev 6640)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/modalPanel/examples/simplePanel.xhtml 2008-03-10 11:17:31 UTC (rev 6641)
@@ -19,10 +19,9 @@
<h:outputText value="Modal Panel Title" />
</f:facet>
<f:facet name="controls">
- <h:graphicImage value="/images/modal/close.png" style="cursor:pointer" onclick="Richfaces.hideModalPanel('mp')" />
- </f:facet>
+ </f:facet>
<p>Any JSF content might be inside the panel. In case of using
- Facelets or JSF 1.2, it might be any mixed content.</p>
+ Facelets or JSF 1.2, it might be any mixed content.</p>
<p>The RichFaces modal panel is good with <a4j:include> to create
a wizard like behavior.</p>
@@ -30,7 +29,10 @@
on <i>Richfaces</i> object. The following code
<a href="javascript:Richfaces.hideModalPanel('mp')">hide this panel</a>:
Richfaces.hideModalPanel('mp')</p>
-
+ <h:form>
+ </h:form>
</rich:modalPanel>
-
+ <h:form>
+ <a4j:commandButton value="close via request" oncomplete="alert('1');"/>
+</h:form>
</ui:composition>
\ No newline at end of file
16 years, 10 months
JBoss Rich Faces SVN: r6640 - in trunk/ui/inplaceInput/src/main: resources/org/richfaces/renderkit/html/scripts and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-03-10 07:05:01 -0400 (Mon, 10 Mar 2008)
New Revision: 6640
Modified:
trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css/inplaceinput.xcss
trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx
Log:
input positioning is changed
Modified: trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css/inplaceinput.xcss
===================================================================
--- trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css/inplaceinput.xcss 2008-03-10 10:26:56 UTC (rev 6639)
+++ trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css/inplaceinput.xcss 2008-03-10 11:05:01 UTC (rev 6640)
@@ -8,13 +8,14 @@
<![CDATA[
.rich-inplace {
+ position:relative;
}
.rich-inplace-changed {
background-position:left top;
background-repeat:no-repeat;
- padding-left:3px;
- padding-right:3px;
+ /*padding-left:3px;
+ padding-right:3px;*/
border-bottom-width: 1px;
border-bottom-style: dashed;
}
@@ -22,13 +23,13 @@
.rich-inplace-view {
border-bottom-width: 1px;
border-bottom-style: dashed;
- padding-left:3px;
- padding-right:3px;
+ /*padding-left:3px;
+ padding-right:3px;*/
white-space:nowrap;
}
.rich-inplace-edit {
- position:relative;
+ /*position:relative;*/
}
.rich-inplace-field {
Modified: trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
===================================================================
--- trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js 2008-03-10 10:26:56 UTC (rev 6639)
+++ trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js 2008-03-10 11:05:01 UTC (rev 6640)
@@ -4,7 +4,7 @@
Richfaces.InplaceInput.prototype = {
- initialize: function(clientId, temValueKeepId, valueKeepId, tabberId, strutId, attributes, events, classes, barParams, textId) {
+ initialize: function(clientId, temValueKeepId, valueKeepId, tabberId, strutId, attributes, events, classes, barParams) {
this.inplaceInput = $(clientId);
this.inplaceInput.component = this;
@@ -12,13 +12,11 @@
this.valueKeeper = $(valueKeepId);
this.attributes = attributes;
this.tabber = $(tabberId);
- this.strut = $(strutId);
+ //this.strut = $(strutId);
this.events = events;
this.classes = classes;
- this.textNode = $(textId);
-
this.currentText = this.getCurrentText();
this.value = this.valueKeeper.value;
@@ -113,8 +111,9 @@
}
var textSize = this.inplaceInput.offsetWidth;
- this.endViewState();
this.startEditableState(textSize);
+ //this.endViewState();
+
if (this.events.oneditactivated) {
this.inplaceInput.fire("rich:oneditactivated", {oldValue : this.valueKeeper.value, value : this.tempValueKeeper.value});
}
@@ -164,40 +163,32 @@
/**
* STATE'S API
*/
- endViewState : function() {
+ /*endViewState : function() {
this.deleteViewArtifacts();
- },
+ },*/
endEditableState : function() {
if (this.bar) {
this.bar.hide();
}
- this.textPositioning(this.coords);
this.tabber.show();
this.tempValueKeeper.hide();
},
- endChangedState : function() {
+ /*endChangedState : function() {
this.deleteViewArtifacts();
- },
+ },*/
startEditableState : function(textSize) {
this.changeState(Richfaces.InplaceInput.STATES[1]);
var inputSize = this.setInputWidth(textSize);
this.tabber.hide();
- this.coords = this.getCoords();
+ this.tempValueKeeper.show();
+ //this.setStrutWidth(textSize);
this.inplaceInput.className = this.classes.COMPONENT.EDITABLE;
- this.setStrutWidth(textSize);
- var strCoord = Richfaces.InplaceInput.getElemXY(this.strut);
-
- this.tempValueKeeper.style.left = 0 + "px";
- this.tempValueKeeper.style.top = (this.coords.top - strCoord.top)+ "px";
-
- this.tempValueKeeper.show();
-
if (this.bar) {
this.bar.show(inputSize, this.tempValueKeeper.offsetHeight);
}
@@ -208,17 +199,17 @@
this.tempValueKeeper.focus();
},
- setStrutWidth : function(textSize) {
+ /*setStrutWidth : function(textSize) {
this.tempValueKeeper.show();
this.strut.style.width = textSize + "px";
this.strut.show();
- },
+ },*/
startViewState : function() {
+ this.deleteViewArtifacts();
this.changeState(Richfaces.InplaceInput.STATES[0]);
this.createNewText(this.currentText);
-
this.inplaceInput.className = this.classes.COMPONENT.VIEW.NORMAL;
this.inplaceInput.observe("mouseover", function(e){this.inplaceMouseOverHandler(e);}.bindAsEventListener(this));
@@ -226,11 +217,12 @@
},
startChangedState : function () {
+ this.deleteViewArtifacts();
+
this.changeState(Richfaces.InplaceInput.STATES[2]);
//this.createNewText(this.valueKeeper.value);
this.createNewText(this.currentText);
-
this.inplaceInput.className = this.classes.COMPONENT.CHANGED.NORMAL;
//this.strut.hide();
},
@@ -328,33 +320,20 @@
},
deleteViewArtifacts : function () {
- var text = this.textNode.firstChild;
+ var text = this.inplaceInput.childNodes[5];
if (text) {
- this.textNode.removeChild(text);
+ this.inplaceInput.removeChild(text);
}
},
getCurrentText : function() {
- return this.textNode.firstChild;
+ return this.inplaceInput.childNodes[5];
},
createNewText : function(text) {
if (!this.getCurrentText()) {
- this.textNode.appendChild(document.createTextNode(text.nodeValue||text));
+ this.inplaceInput.appendChild(document.createTextNode(text.nodeValue||text));
}
- },
-
- textPositioning : function(coord) {
- this.textNode.style.left = coord.left + "px";
- this.textNode.style.top = coord.top + "px";
- },
-
- getCoords: function() {
- var coordsVal = Richfaces.InplaceInput.getElemXY(this.inplaceInput);
- var coordsStrut = Richfaces.InplaceInput.getElemXY(this.strut);
-
- //return {top : (coordsVal.top - coordsStrut.top), left : 0};
- return {top : coordsVal.top, left : coordsVal.left};
}
};
@@ -454,15 +433,4 @@
//FIXME
oTextbox.setSelectionRange(iStart, iEnd);
}
-};
-
-Richfaces.InplaceInput.getElemXY = function(elem) {
- var x = elem.offsetLeft;
- var y = elem.offsetTop;
-
- for (var parent = elem.offsetParent; parent; parent = parent.offsetParent) {
- x += parent.offsetLeft;
- y += parent.offsetTop;
- }
- return {left: x, top: y};
};
\ No newline at end of file
Modified: trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx
===================================================================
--- trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-03-10 10:26:56 UTC (rev 6639)
+++ trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-03-10 11:05:01 UTC (rev 6640)
@@ -60,10 +60,10 @@
<span id="#{clientId}" class='rich-inplace rich-inplace-view #{component.attributes["styleClass"]}'
x:passThruWithExclusions="id,styleClass,class,style">
<input id="#{clientId}tabber" type="button" value="" style="width: 1px; position: absolute; left: -32767px;" />
- <img id="#{clientId}strut" src="#{spacer}" class="rich-inplace-input-strut" style="width:100px"/>
+ <!-- img id="#{clientId}strut" src="#{spacer}" class="rich-inplace-input-strut"/-->
<input id='#{clientId}tempValue'
class='rich-inplace-field'
- style='display:none;position:absolute;'
+ style='display:none;'
type='text'
maxlength='#{component.attributes["inputMaxLength"]}'
autocomplete="off"
@@ -139,7 +139,7 @@
]]>
</jsp:scriptlet>
</div>
- <span id="#{clientId}text" style="position:absolute;">#{value}</span>
+ #{value}
</span>
@@ -151,7 +151,6 @@
var inplaceInput = new Richfaces.InplaceInput('#{clientId}', '#{clientId}tempValue', '#{clientId}value', '#{clientId}tabber',
'#{clientId}strut', attributes, events, classes, ['#{clientId}bar',
- '#{clientId}ok', '#{clientId}cancel', '#{clientId}buttons','#{clientId}btns_shadow'],
- '#{clientId}text');
+ '#{clientId}ok', '#{clientId}cancel', '#{clientId}buttons','#{clientId}btns_shadow']);
</script>
</f:root>
\ No newline at end of file
16 years, 10 months
JBoss Rich Faces SVN: r6639 - in trunk/ui/fileUpload/src: main/java/org/richfaces and 8 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-03-10 06:26:56 -0400 (Mon, 10 Mar 2008)
New Revision: 6639
Added:
trunk/ui/fileUpload/src/main/java/org/richfaces/component/
trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/
trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java
trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/html/
trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/html/images/
Removed:
trunk/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/component/
trunk/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/renderkit/
Modified:
trunk/ui/fileUpload/src/main/config/component/fileUpload.xml
trunk/ui/fileUpload/src/main/config/component/listener.ent
trunk/ui/fileUpload/src/main/java/org/richfaces/component/UIFileUpload.java
trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/html/images/UploadButtonBgGradient.java
trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/html/images/UploadButtonBgLightGradient.java
trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/html/images/UploadButtonPressedBgGradient.java
trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/css/fileUpload.xcss
trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx
trunk/ui/fileUpload/src/test/java/org/richfaces/component/FileUploadComponentTest.java
Log:
RF-2395
Modified: trunk/ui/fileUpload/src/main/config/component/fileUpload.xml
===================================================================
--- trunk/ui/fileUpload/src/main/config/component/fileUpload.xml 2008-03-10 10:07:43 UTC (rev 6638)
+++ trunk/ui/fileUpload/src/main/config/component/fileUpload.xml 2008-03-10 10:26:56 UTC (rev 6639)
@@ -9,36 +9,31 @@
<name>org.richfaces.component.FileUpload</name>
<family>org.richfaces.component.FileUpload</family>
<classname>org.richfaces.component.html.HtmlFileUpload</classname>
- <superclass>org.richfaces.org.jboss.seam.ui.component.UIFileUpload</superclass>
+ <superclass>org.richfaces.component.UIFileUpload</superclass>
<description>
<![CDATA[
-Renders a file upload control. This control must be used within a form with an encoding type of multipart/form-data, i.e:
-
-<h:form enctype="multipart/form-data">
-
-For multipart requests, the Seam Multipart servlet filter must also be configured in web.xml:
+Renders a file upload control.
-<filter>
- <filter-name>Seam Filter</filter-name>
- <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
-</filter>
+The following configuration options for ajax4jsf filter may be configured in web.xml:
-<filter-mapping>
- <filter-name>Seam Filter</filter-name>
- <url-pattern>/*</url-pattern>
-</filter-mapping>
-
-The following configuration options for multipart requests may be configured in components.xml:
-
* createTempFiles - if this option is set to true, uploaded files are streamed to a temporary file instead of in memory.
* maxRequestSize - the maximum size of a file upload request, in bytes.
Here's an example:
-<component class="org.jboss.seam.servlet.MultipartConfig">
- <property name="createTempFiles">true</property>
- <property name="maxRequestSize">1000000</property>
-</component>
+<filter>
+ <display-name>Ajax4jsf Filter</display-name>
+ <filter-name>ajax4jsf</filter-name>
+ <filter-class>org.ajax4jsf.Filter</filter-class>
+ <init-param>
+ <param-name>createTempFiles</param-name>
+ <param-value>false</param-value>
+ </init-param>
+ <init-param>
+ <param-name>maxRequestSize</param-name>
+ <param-value>20000000</param-value>
+ </init-param>
+ </filter>
]]>
</description>
<test>
Modified: trunk/ui/fileUpload/src/main/config/component/listener.ent
===================================================================
--- trunk/ui/fileUpload/src/main/config/component/listener.ent 2008-03-10 10:07:43 UTC (rev 6638)
+++ trunk/ui/fileUpload/src/main/config/component/listener.ent 2008-03-10 10:26:56 UTC (rev 6639)
@@ -4,7 +4,7 @@
org.richfaces.event.FileUploadListener
</listenerclass>
<componentclass>
- org.richfaces.org.jboss.seam.ui.component.UIFileUpload
+ org.richfaces.component.UIFileUpload
</componentclass>
<eventclass>
org.richfaces.event.UploadEvent
Copied: trunk/ui/fileUpload/src/main/java/org/richfaces/component (from rev 6632, trunk/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/component)
Modified: trunk/ui/fileUpload/src/main/java/org/richfaces/component/UIFileUpload.java
===================================================================
--- trunk/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/component/UIFileUpload.java 2008-03-09 22:16:31 UTC (rev 6632)
+++ trunk/ui/fileUpload/src/main/java/org/richfaces/component/UIFileUpload.java 2008-03-10 10:26:56 UTC (rev 6639)
@@ -1,4 +1,4 @@
-package org.richfaces.org.jboss.seam.ui.component;
+package org.richfaces.component;
import java.io.InputStream;
import java.util.Map;
@@ -18,9 +18,10 @@
import org.ajax4jsf.request.MultipartRequest;
import org.richfaces.event.FileUploadListener;
import org.richfaces.event.UploadEvent;
-import org.richfaces.org.jboss.seam.ui.renderkit.FileUploadRendererBase;
+import org.richfaces.renderkit.FileUploadRendererBase;
+
/**
* JSF component class
*
Copied: trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java (from rev 6632, trunk/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/renderkit/FileUploadRendererBase.java)
===================================================================
--- trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java (rev 0)
+++ trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java 2008-03-10 10:26:56 UTC (rev 6639)
@@ -0,0 +1,404 @@
+package org.richfaces.renderkit;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.el.ValueExpression;
+import javax.faces.FactoryFinder;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import javax.faces.render.RenderKit;
+import javax.faces.render.RenderKitFactory;
+import javax.servlet.ServletRequest;
+import javax.servlet.http.HttpSession;
+
+import org.ajax4jsf.Filter;
+import org.ajax4jsf.context.AjaxContext;
+import org.ajax4jsf.context.AjaxContextImpl;
+import org.ajax4jsf.event.AjaxEvent;
+import org.ajax4jsf.exception.FileUploadException;
+import org.ajax4jsf.javascript.JSFunction;
+import org.ajax4jsf.javascript.JSFunctionDefinition;
+import org.ajax4jsf.javascript.JSLiteral;
+import org.ajax4jsf.javascript.JSReference;
+import org.ajax4jsf.javascript.ScriptUtils;
+import org.ajax4jsf.renderkit.AjaxRendererUtils;
+import org.ajax4jsf.renderkit.RendererUtils;
+import org.ajax4jsf.request.MultipartRequest;
+import org.ajax4jsf.resource.CountingOutputWriter;
+import org.richfaces.component.UIFileUpload;
+import org.richfaces.component.UIProgressBar;
+import org.richfaces.event.UploadEvent;
+import org.richfaces.model.UploadItem;
+
+/**
+ * Class provides base renderer for upload file component
+ *
+ * @author "Andrey Markavtsov"
+ *
+ */
+public abstract class FileUploadRendererBase extends
+ TemplateEncoderRendererBase {
+
+ /** Attribute name where collection of files uploaded will be stored */
+ private static final String _FILES_UPLOADED_ATTRIBUTE_NAME = "uploadData";
+
+ /** Multipart request class name */
+ private static final String _MULTIPART_REQUEST_CLASS_NAME = MultipartRequest.class.getName();
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.renderkit.RendererBase#doDecode(javax.faces.context.FacesContext,
+ * javax.faces.component.UIComponent)
+ */
+ @Override
+ protected void doDecode(FacesContext context, UIComponent component) {
+ UIFileUpload fileUpload = (UIFileUpload) component;
+ ServletRequest request = (ServletRequest) context.getExternalContext()
+ .getRequest();
+
+ String clientId = component.getClientId(context);
+
+ new AjaxEvent(component).queue();
+
+ Class requestClazz = request.getClass();
+
+ if (_MULTIPART_REQUEST_CLASS_NAME
+ .equals(requestClazz.getName())
+ || "org.jboss.seam.web.MultipartRequest".equals(requestClazz.getName())) {
+
+ HttpSession session = (HttpSession)context.getExternalContext().getSession(false);
+ String uid = request.getParameter(Filter.UPLOAD_FILES_ID);
+ Map<String, MultipartRequest> map = (Map<String, MultipartRequest>)session.getAttribute(Filter.REQUESTS_SESSIONS_BEAN_NAME);
+
+ MultipartRequest multipartRequest = map.get(uid);
+
+ clientId = clientId + ":file";
+ String fileName = multipartRequest.getFileName(clientId);
+ Object file = multipartRequest.getFile(clientId);
+ fileUpload.setLocalFileName(fileName);
+ onUploadComplete(context, file, fileUpload);
+ }
+
+ }
+
+ /**
+ * Method checks if uploaded files count overflowed
+ *
+ * @param fileUpload
+ * @param map
+ * @return
+ */
+ private boolean checkFileCount(UIFileUpload fileUpload,
+ Collection filesUploaded) {
+ Integer max = fileUpload.getMaxFilesQuantity();
+ if (filesUploaded != null && filesUploaded.size() >= max) {
+ fileUpload.reset();
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Put uploaded file into data attribute defined
+ *
+ * @param context
+ * @param fileUpload
+ * @param file
+ */
+ @SuppressWarnings("unchecked")
+ private void storeData(FacesContext context, UIFileUpload fileUpload,
+ Object file) {
+ ValueExpression data = fileUpload
+ .getValueExpression(_FILES_UPLOADED_ATTRIBUTE_NAME);
+ if (data != null) {
+ if (data.getValue(context.getELContext()) instanceof Collection) {
+ Collection collection = (Collection) data.getValue(context
+ .getELContext());
+ if (checkFileCount(fileUpload, collection)) {
+ UploadItem item = new UploadItem(fileUpload
+ .getLocalFileName(), file);
+ new UploadEvent(fileUpload, item).queue();
+ collection.add(item);
+ } else {
+ throw new FileUploadException("Files count overflow");
+ }
+ }
+ }
+ }
+
+ /**
+ * Call with method after uploading completed
+ *
+ * @param context
+ * @param file
+ * @param fileUpload
+ */
+ private void onUploadComplete(FacesContext context, Object file,
+ UIFileUpload fileUpload) {
+ storeData(context, fileUpload, file);
+ try {
+ AjaxContext ajaxContext = AjaxContextImpl
+ .getCurrentInstance(context);
+ ajaxContext.setAjaxRequest(true);
+ } catch (Exception e) {
+ e.getMessage();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.renderkit.RendererBase#getComponentClass()
+ */
+ @Override
+ protected Class<? extends UIComponent> getComponentClass() {
+ return UIFileUpload.class;
+ }
+
+ /**
+ * Generates common JS script by action value
+ *
+ * @param context
+ * @param component
+ * @param action
+ * @param oncomplete
+ * @return
+ * @throws IOException
+ */
+ @SuppressWarnings("unchecked")
+ private String getActionScript(FacesContext context, UIComponent component,
+ String action, Object oncomplete) throws IOException {
+ JSFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(
+ component, context);
+ String clientId = component.getClientId(context);
+ Map options = AjaxRendererUtils.buildEventOptions(context, component);
+ Map parameters = (Map) options.get("parameters");
+ parameters.put("action", action);
+ parameters.put(Filter.UPLOAD_FILES_ID, new JSReference("uid"));
+ parameters.put(clientId, clientId);
+ if (oncomplete != null) {
+ options.put("onbeforedomupdate", oncomplete);
+ }
+ ajaxFunction.addParameter(options);
+
+ JSFunctionDefinition function = new JSFunctionDefinition("uid");
+ function.addParameter("event");
+ function.addToBody(ajaxFunction.toScript());
+
+ return function.toScript();
+ }
+
+ /**
+ * Return accepted types map
+ *
+ * @param context
+ * @param component
+ * @return
+ */
+ public Object getAcceptedTypes(FacesContext context, UIComponent component) {
+ String acceptedTypes = (String) component.getAttributes().get(
+ "acceptedTypes");
+ if (acceptedTypes != null) {
+ Map<String, Boolean> accepted = new HashMap<String, Boolean>();
+ String[] types = acceptedTypes.split("[,;|]");
+ if (types != null) {
+ for (String type : types) {
+ accepted.put(type.toLowerCase(), true);
+ }
+ return ScriptUtils.toScript(accepted);
+ }
+ }
+ return JSReference.NULL;
+ }
+
+ /**
+ * Generates JS script for stopping uploading process
+ *
+ * @param context
+ * @param component
+ * @return
+ * @throws IOException
+ */
+ public String getStopScript(FacesContext context, UIComponent component)
+ throws IOException {
+ return getActionScript(context, component, "stop", null);
+ }
+
+ /**
+ * Generates JS script for getting file size from server
+ *
+ * @param context
+ * @param component
+ * @return
+ * @throws IOException
+ */
+ public String getFileSizeScript(FacesContext context, UIComponent component)
+ throws IOException {
+ JSFunctionDefinition oncomplete = new JSFunctionDefinition();
+ oncomplete.addParameter("request");
+ oncomplete.addParameter("event");
+ oncomplete.addParameter("data");
+ StringBuffer body = new StringBuffer("$('");
+ body.append(component.getClientId(context));
+ body.append("').component.getFileSize(data);");
+ oncomplete.addToBody(body);
+ return getActionScript(context, component, "progress", oncomplete);
+
+ }
+
+ /**
+ * Generates progress label markup
+ *
+ * @param context
+ * @param component
+ * @return
+ * @throws IOException
+ */
+ public Object getLabelMarkup(FacesContext context, UIComponent component)
+ throws IOException {
+ CountingOutputWriter customWriter = new CountingOutputWriter();
+ StringBuffer result = null;
+ UIComponent label = component.getFacet("label");
+ try {
+ if (label != null) {
+
+ ResponseWriter writer = context.getResponseWriter();
+
+ String defaultRenderKitId = context.getApplication()
+ .getDefaultRenderKitId();
+ if (null == defaultRenderKitId) {
+ defaultRenderKitId = RenderKitFactory.HTML_BASIC_RENDER_KIT;
+ }
+ RenderKitFactory renderKitFactory = (RenderKitFactory) FactoryFinder
+ .getFactory(FactoryFinder.RENDER_KIT_FACTORY);
+ RenderKit renderKit = renderKitFactory.getRenderKit(context,
+ defaultRenderKitId);
+
+ ResponseWriter responseWriter = renderKit.createResponseWriter(
+ customWriter, null, "UTF-8");
+ context.setResponseWriter(responseWriter);
+ writeScriptBody(context, label, false);
+ if (writer != null) {
+ context.setResponseWriter(writer);
+ }
+ result = customWriter.getContent();
+ }
+
+ } catch (Exception e) {
+ e.getMessage();
+ }
+ return (result != null) ? new JSLiteral(result.toString())
+ : JSReference.NULL;
+ }
+
+ /**
+ * Generate component custom events functions
+ *
+ * @param context
+ * @param component
+ * @param attributeName
+ * @return
+ */
+ public String getAsEventHandler(FacesContext context,
+ UIComponent component, String attributeName) {
+ Object eventHandler = RendererUtils.getInstance().getAsEventHandler(
+ context, component, attributeName, "");
+ if (eventHandler != null) {
+ return eventHandler.toString();
+ }
+ return JSReference.NULL.toScript();
+ }
+
+ /**
+ * Gets progress bar Id
+ *
+ * @param context
+ * @param component
+ * @return
+ * @throws IOException
+ */
+ public String getProgressBarId(FacesContext context, UIComponent component)
+ throws IOException {
+ return getProgressBar(context, component).getClientId(context);
+ }
+
+ /**
+ * Renders progress bar
+ *
+ * @param context
+ * @param component
+ * @throws IOException
+ */
+ public void renderProgress(FacesContext context, UIComponent component)
+ throws IOException {
+ UIComponent progressBar = getProgressBar(context, component);
+ renderChild(context, progressBar);
+ }
+
+ /**
+ * Creates progress bar component
+ *
+ * @param context
+ * @param fileUpload
+ * @return
+ */
+ private UIComponent createProgressBar(FacesContext context,
+ UIComponent fileUpload) {
+ UIComponent progressBar = fileUpload.getFacet("progress");
+ if (null == progressBar) {
+ progressBar = context.getApplication().createComponent(
+ UIProgressBar.COMPONENT_TYPE);
+ }
+ fileUpload.getFacets().put("progress", progressBar);
+ return progressBar;
+ }
+
+ /**
+ * Returns progress bar
+ *
+ * @param context
+ * @param component
+ * @return
+ */
+ public UIComponent getProgressBar(FacesContext context,
+ UIComponent component) {
+ UIComponent progressBar = component.getFacet("progress");
+ if (null == progressBar) {
+ progressBar = createProgressBar(context, component);
+ }
+ progressBar.getAttributes().put("minValue", -1);
+ progressBar.getAttributes().put("enabled", false);
+ progressBar.setTransient(false);
+ return progressBar;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.renderkit.TemplateEncoderRendererBase#encodeChildren(javax.faces.context.FacesContext,
+ * javax.faces.component.UIComponent)
+ */
+ @Override
+ public void encodeChildren(FacesContext context, UIComponent component)
+ throws IOException {
+ ; // We should not render children
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.renderkit.RendererBase#doEncodeChildren(javax.faces.context.ResponseWriter,
+ * javax.faces.context.FacesContext, javax.faces.component.UIComponent)
+ */
+ @Override
+ public void doEncodeChildren(ResponseWriter writer, FacesContext context,
+ UIComponent component) throws IOException {
+ ; // We should not render children
+ }
+
+}
Copied: trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/html/images (from rev 6632, trunk/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/renderkit/html/images)
Modified: trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/html/images/UploadButtonBgGradient.java
===================================================================
--- trunk/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/renderkit/html/images/UploadButtonBgGradient.java 2008-03-09 22:16:31 UTC (rev 6632)
+++ trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/html/images/UploadButtonBgGradient.java 2008-03-10 10:26:56 UTC (rev 6639)
@@ -18,7 +18,7 @@
* 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.org.jboss.seam.ui.renderkit.html.images;
+package org.richfaces.renderkit.html.images;
import org.richfaces.renderkit.html.BaseGradient;
Modified: trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/html/images/UploadButtonBgLightGradient.java
===================================================================
--- trunk/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/renderkit/html/images/UploadButtonBgLightGradient.java 2008-03-09 22:16:31 UTC (rev 6632)
+++ trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/html/images/UploadButtonBgLightGradient.java 2008-03-10 10:26:56 UTC (rev 6639)
@@ -18,7 +18,7 @@
* 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.org.jboss.seam.ui.renderkit.html.images;
+package org.richfaces.renderkit.html.images;
import org.richfaces.renderkit.html.BaseGradient;
Modified: trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/html/images/UploadButtonPressedBgGradient.java
===================================================================
--- trunk/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/renderkit/html/images/UploadButtonPressedBgGradient.java 2008-03-09 22:16:31 UTC (rev 6632)
+++ trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/html/images/UploadButtonPressedBgGradient.java 2008-03-10 10:26:56 UTC (rev 6639)
@@ -18,7 +18,7 @@
* 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.org.jboss.seam.ui.renderkit.html.images;
+package org.richfaces.renderkit.html.images;
import org.richfaces.renderkit.html.BaseGradient;
Modified: trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/css/fileUpload.xcss
===================================================================
--- trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/css/fileUpload.xcss 2008-03-10 10:07:43 UTC (rev 6638)
+++ trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/css/fileUpload.xcss 2008-03-10 10:26:56 UTC (rev 6639)
@@ -110,7 +110,7 @@
<u:style name="padding" value="2px" />
<u:style name="cursor" value="pointer" />
<u:style name="background-image">
- <f:resource f:key="org.richfaces.org.jboss.seam.ui.renderkit.html.images.UploadButtonBgGradient" />
+ <f:resource f:key="org.richfaces.renderkit.html.images.UploadButtonBgGradient" />
</u:style>
</u:selector>
@@ -123,7 +123,7 @@
<u:style name="cursor" value="pointer" />
<u:style name="padding" value="1px" />
<u:style name="background-image">
- <f:resource f:key="org.richfaces.org.jboss.seam.ui.renderkit.html.images.UploadButtonBgLightGradient" />
+ <f:resource f:key="org.richfaces.renderkit.html.images.UploadButtonBgLightGradient" />
</u:style>
<u:style name="border-color" skin="selectControlColor" />
</u:selector>
@@ -131,7 +131,7 @@
<u:selector name=".upload_button_press">
<u:style name="background-image">
- <f:resource f:key="org.richfaces.org.jboss.seam.ui.renderkit.html.images.UploadButtonPressedBgGradient" />
+ <f:resource f:key="org.richfaces.renderkit.html.images.UploadButtonPressedBgGradient" />
</u:style>
<u:style name="border-color" skin="selectControlColor" />
<u:style name="border" value="1px solid" />
Modified: trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx
===================================================================
--- trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx 2008-03-10 10:07:43 UTC (rev 6638)
+++ trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx 2008-03-10 10:26:56 UTC (rev 6639)
@@ -3,8 +3,8 @@
xmlns:f="http://ajax4jsf.org/cdk/template"
xmlns:h=" http://ajax4jsf.org/cdk/headers"
class="org.richfaces.renderkit.html.FileUploadRenderer"
- baseclass="org.richfaces.org.jboss.seam.ui.renderkit.FileUploadRendererBase"
- component="org.richfaces.org.jboss.seam.ui.component.UIFileUpload"
+ baseclass="org.richfaces.renderkit.FileUploadRendererBase"
+ component="org.richfaces.component.UIFileUpload"
>
<h:styles>
/org/richfaces/renderkit/html/css/fileUpload.xcss,
Modified: trunk/ui/fileUpload/src/test/java/org/richfaces/component/FileUploadComponentTest.java
===================================================================
--- trunk/ui/fileUpload/src/test/java/org/richfaces/component/FileUploadComponentTest.java 2008-03-10 10:07:43 UTC (rev 6638)
+++ trunk/ui/fileUpload/src/test/java/org/richfaces/component/FileUploadComponentTest.java 2008-03-10 10:26:56 UTC (rev 6639)
@@ -30,7 +30,6 @@
import javax.faces.component.html.HtmlForm;
import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
-import org.richfaces.org.jboss.seam.ui.component.UIFileUpload;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
16 years, 10 months