JBoss Rich Faces SVN: r9088 - in trunk/test-applications/facelets/src/main: webapp/InplaceSelect and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2008-06-18 03:56:57 -0400 (Wed, 18 Jun 2008)
New Revision: 9088
Added:
trunk/test-applications/facelets/src/main/webapp/InplaceSelect/InplaceSelectProperty.xhtml
Modified:
trunk/test-applications/facelets/src/main/java/rich/RichBean.java
trunk/test-applications/facelets/src/main/webapp/InplaceSelect/InplaceSelect.xhtml
Log:
Separate InplaceSelect.xhtml on 2 files
Modified: trunk/test-applications/facelets/src/main/java/rich/RichBean.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/rich/RichBean.java 2008-06-18 00:06:07 UTC (rev 9087)
+++ trunk/test-applications/facelets/src/main/java/rich/RichBean.java 2008-06-18 07:56:57 UTC (rev 9088)
@@ -67,7 +67,7 @@
map.add("ProgressBar", add("/ProgressBar/ProgressBar", new boolean [] {false, false, false}));
map.add("SortingAndFiltering", add("/SortingAndFiltering/SortingAndFiltering", new boolean [] {false, false, false}));
map.add("FileUpload", add("/FileUpload/FileUpload", new boolean [] {false, false, false}));
- map.add("InplaceSelect", add("/InplaceSelect/InplaceSelect", new boolean [] {false, false, false}));
+ map.add("InplaceSelect", add("/InplaceSelect/InplaceSelect", new boolean [] {false, true, false}));
map.add("InplaceInput", add("/InplaceInput/InplaceInput", new boolean [] {false, true, false}));
map.add("Skinning", add("/Skinning/Skinning", new boolean [] {false, false, false}));
Iterator<String> iterator = map.getSet().iterator();
Modified: trunk/test-applications/facelets/src/main/webapp/InplaceSelect/InplaceSelect.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/InplaceSelect/InplaceSelect.xhtml 2008-06-18 00:06:07 UTC (rev 9087)
+++ trunk/test-applications/facelets/src/main/webapp/InplaceSelect/InplaceSelect.xhtml 2008-06-18 07:56:57 UTC (rev 9088)
@@ -55,7 +55,10 @@
onselect="#{event.onselect}"
onviewactivated="#{evant.onviewactivated}"
onviewactivation="#{event.onviewactivation}"
- layout="#{inplaceSelect.layout}">
+ layout="#{inplaceSelect.layout}"
+ valueChangeListener="#{inplaceSelect.valueChangeListener}"
+ value="#{inplaceSelect.value}" >
+
<f:selectItem itemLabel="errors" itemValue="errors" />
<f:selectItem itemLabel="fatals" itemValue="fatals" />
<f:selectItem itemLabel="infos" itemValue="infos" />
@@ -65,96 +68,9 @@
are easy to exploit.
<h:panelGrid columns="2">
- <a4j:commandButton value="refresh" reRender="inplaceSelectValueCLID"></a4j:commandButton>
+ <a4j:commandButton value="reRender" reRender="inplaceSelectValueCLID, inplaceSelectID"></a4j:commandButton>
<h:outputText id="inplaceSelectValueCLID"
value="#{inplaceSelect.valueCL}"></h:outputText>
</h:panelGrid>
-
- <h:panelGrid columns="2">
- <h:outputText value="value"></h:outputText>
- <h:outputText value="#{inplaceSelect.value}"></h:outputText>
-
- <h:outputText value="defaultLabel"></h:outputText>
- <h:inputText value="#{inplaceSelect.defaultLabel}"
- onchange="submit();"></h:inputText>
-
- <h:outputText value="editEvent"></h:outputText>
- <h:inputText value="#{inplaceSelect.editEvent}" onchange="submit();"></h:inputText>
-
- <h:outputText value="selectWidth"></h:outputText>
- <h:inputText value="#{inplaceSelect.selectWidth}" onchange="submit();"></h:inputText>
-
- <h:outputText value="maxSelectWidth"></h:outputText>
- <h:inputText value="#{inplaceSelect.maxSelectWidth}"
- onchange="submit();"></h:inputText>
-
- <h:outputText value="minSelectWidth"></h:outputText>
- <h:inputText value="#{inplaceSelect.minSelectWidth}"
- onchange="submit();"></h:inputText>
-
- <h:outputText value="listWidth"></h:outputText>
- <h:inputText value="#{inplaceSelect.listWidth}" onchange="submit();"></h:inputText>
-
- <h:outputText value="listHeight"></h:outputText>
- <h:inputText value="#{inplaceSelect.listHeight}" onchange="submit();"></h:inputText>
-
- <h:outputText value="controlsVerticalPosition"></h:outputText>
- <h:selectOneRadio value="#{inplaceSelect.controlsVerticalPosition}"
- onchange="submit();">
- <f:selectItem itemLabel="top" itemValue="top" />
- <f:selectItem itemLabel="center" itemValue="center" />
- <f:selectItem itemLabel="bottom" itemValue="bottom" />
- </h:selectOneRadio>
-
- <h:outputText value="controlsHorizontalPosition"></h:outputText>
- <h:selectOneRadio value="#{inplaceSelect.controlsHorizontalPosition}"
- onchange="submit();">
- <f:selectItem itemLabel="right" itemValue="right" />
- <f:selectItem itemLabel="center" itemValue="center" />
- <f:selectItem itemLabel="left" itemValue="left" />
- </h:selectOneRadio>
- <h:outputText value="tabindex"></h:outputText>
- <h:inputText value="#{inplaceSelect.tabindex}" onchange="submit();"></h:inputText>
-
- <h:outputText value="showControls"></h:outputText>
- <h:selectBooleanCheckbox value="#{inplaceSelect.showControls}"
- onchange="submit();"></h:selectBooleanCheckbox>
-
- <h:outputText value="applyFromControlsOnly"></h:outputText>
- <h:selectBooleanCheckbox
- value="#{inplaceSelect.applyFromControlsOnly}" onchange="submit();"></h:selectBooleanCheckbox>
-
- <h:outputText value="openOnEdit"></h:outputText>
- <h:selectBooleanCheckbox value="#{inplaceSelect.openOnEdit}"
- onchange="submit();"></h:selectBooleanCheckbox>
-
- <h:outputText value="rendered"></h:outputText>
- <h:selectBooleanCheckbox value="#{inplaceSelect.rendered}"
- onchange="submit();"></h:selectBooleanCheckbox>
-
- <h:commandButton actionListener="#{inplaceSelect.checkBinding}" value="Binding"></h:commandButton>
- <h:outputText value="#{inplaceSelect.bindLabel}"></h:outputText>
-
- <h:outputText value="immediate"></h:outputText>
- <h:selectBooleanCheckbox value="#{inplaceSelect.immediate}"
- onchange="submit();"></h:selectBooleanCheckbox>
-
- <h:outputText value="required"></h:outputText>
- <h:selectBooleanCheckbox value="#{inplaceSelect.required}"
- onchange="submit();"></h:selectBooleanCheckbox>
-
- <h:outputText value="requiredMessage"></h:outputText>
- <h:inputText value="#{inplaceSelect.requiredMessage}" onchange="submit();"></h:inputText>
-
- <h:outputText value="layout"></h:outputText>
- <h:inputText value="#{inplaceSelect.layout}" onchange="submit();"></h:inputText>
-
- </h:panelGrid>
- <a4j:commandLink onclick="$('formID:inplaceSelectSubviewID:inplaceSelectID').component.edit()" value="edit"></a4j:commandLink> <br/>
- <a4j:commandLink onclick="$('formID:inplaceSelectSubviewID:inplaceSelectID').component.save()" value="save"></a4j:commandLink> <br/>
- <a4j:commandLink onclick="$('formID:inplaceSelectSubviewID:inplaceSelectID').component.cancel()" value="cancel"></a4j:commandLink> <br/>
- <a4j:commandLink onclick="$('formID:inplaceSelectSubviewID:inplaceSelectID').component.getValue()" value="getValue"></a4j:commandLink> <br/>
- <a4j:commandLink onclick="$('formID:inplaceSelectSubviewID:inplaceSelectID').component.setValue('setValue')" value="setValuel"></a4j:commandLink>
-
</f:subview>
\ No newline at end of file
Added: trunk/test-applications/facelets/src/main/webapp/InplaceSelect/InplaceSelectProperty.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/InplaceSelect/InplaceSelectProperty.xhtml (rev 0)
+++ trunk/test-applications/facelets/src/main/webapp/InplaceSelect/InplaceSelectProperty.xhtml 2008-06-18 07:56:57 UTC (rev 9088)
@@ -0,0 +1,90 @@
+<f:subview xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:a4j="http://richfaces.org/a4j" xmlns:h="http://java.sun.com/jsf/html" xmlns:rich="http://richfaces.org/rich" id="inplaceSelectPropertySubviewID">
+
+ <h:panelGrid columns="2">
+ <h:outputText value="value"></h:outputText>
+ <h:outputText value="#{inplaceSelect.value}"></h:outputText>
+
+ <h:outputText value="defaultLabel"></h:outputText>
+ <h:inputText value="#{inplaceSelect.defaultLabel}"
+ onchange="submit();"></h:inputText>
+
+ <h:outputText value="editEvent"></h:outputText>
+ <h:inputText value="#{inplaceSelect.editEvent}" onchange="submit();"></h:inputText>
+
+ <h:outputText value="selectWidth"></h:outputText>
+ <h:inputText value="#{inplaceSelect.selectWidth}" onchange="submit();"></h:inputText>
+
+ <h:outputText value="maxSelectWidth"></h:outputText>
+ <h:inputText value="#{inplaceSelect.maxSelectWidth}"
+ onchange="submit();"></h:inputText>
+
+ <h:outputText value="minSelectWidth"></h:outputText>
+ <h:inputText value="#{inplaceSelect.minSelectWidth}"
+ onchange="submit();"></h:inputText>
+
+ <h:outputText value="listWidth"></h:outputText>
+ <h:inputText value="#{inplaceSelect.listWidth}" onchange="submit();"></h:inputText>
+
+ <h:outputText value="listHeight"></h:outputText>
+ <h:inputText value="#{inplaceSelect.listHeight}" onchange="submit();"></h:inputText>
+
+ <h:outputText value="controlsVerticalPosition"></h:outputText>
+ <h:selectOneRadio value="#{inplaceSelect.controlsVerticalPosition}"
+ onchange="submit();">
+ <f:selectItem itemLabel="top" itemValue="top" />
+ <f:selectItem itemLabel="center" itemValue="center" />
+ <f:selectItem itemLabel="bottom" itemValue="bottom" />
+ </h:selectOneRadio>
+
+ <h:outputText value="controlsHorizontalPosition"></h:outputText>
+ <h:selectOneRadio value="#{inplaceSelect.controlsHorizontalPosition}"
+ onchange="submit();">
+ <f:selectItem itemLabel="right" itemValue="right" />
+ <f:selectItem itemLabel="center" itemValue="center" />
+ <f:selectItem itemLabel="left" itemValue="left" />
+ </h:selectOneRadio>
+ <h:outputText value="tabindex"></h:outputText>
+ <h:inputText value="#{inplaceSelect.tabindex}" onchange="submit();"></h:inputText>
+
+ <h:outputText value="showControls"></h:outputText>
+ <h:selectBooleanCheckbox value="#{inplaceSelect.showControls}"
+ onchange="submit();"></h:selectBooleanCheckbox>
+
+ <h:outputText value="applyFromControlsOnly"></h:outputText>
+ <h:selectBooleanCheckbox
+ value="#{inplaceSelect.applyFromControlsOnly}" onchange="submit();"></h:selectBooleanCheckbox>
+
+ <h:outputText value="openOnEdit"></h:outputText>
+ <h:selectBooleanCheckbox value="#{inplaceSelect.openOnEdit}"
+ onchange="submit();"></h:selectBooleanCheckbox>
+
+ <h:outputText value="rendered"></h:outputText>
+ <h:selectBooleanCheckbox value="#{inplaceSelect.rendered}"
+ onchange="submit();"></h:selectBooleanCheckbox>
+
+ <h:commandButton actionListener="#{inplaceSelect.checkBinding}" value="Binding"></h:commandButton>
+ <h:outputText value="#{inplaceSelect.bindLabel}"></h:outputText>
+
+ <h:outputText value="immediate"></h:outputText>
+ <h:selectBooleanCheckbox value="#{inplaceSelect.immediate}"
+ onchange="submit();"></h:selectBooleanCheckbox>
+
+ <h:outputText value="required"></h:outputText>
+ <h:selectBooleanCheckbox value="#{inplaceSelect.required}"
+ onchange="submit();"></h:selectBooleanCheckbox>
+
+ <h:outputText value="requiredMessage"></h:outputText>
+ <h:inputText value="#{inplaceSelect.requiredMessage}" onchange="submit();"></h:inputText>
+
+ <h:outputText value="layout"></h:outputText>
+ <h:inputText value="#{inplaceSelect.layout}" onchange="submit();"></h:inputText>
+
+ </h:panelGrid>
+
+ <a4j:commandLink onclick="$('formID:inplaceSelectSubviewID:inplaceSelectID').component.edit()" value="edit"></a4j:commandLink> <br/>
+ <a4j:commandLink onclick="$('formID:inplaceSelectSubviewID:inplaceSelectID').component.save()" value="save"></a4j:commandLink> <br/>
+ <a4j:commandLink onclick="$('formID:inplaceSelectSubviewID:inplaceSelectID').component.cancel()" value="cancel"></a4j:commandLink> <br/>
+ <a4j:commandLink onclick="$('formID:inplaceSelectSubviewID:inplaceSelectID').component.getValue()" value="getValue"></a4j:commandLink> <br/>
+ <a4j:commandLink onclick="$('formID:inplaceSelectSubviewID:inplaceSelectID').component.setValue('setValue')" value="setValuel"></a4j:commandLink>
+
+</f:subview>
\ No newline at end of file
16 years
JBoss Rich Faces SVN: r9087 - trunk/ui/panelbar/src/main/templates.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-06-17 20:06:07 -0400 (Tue, 17 Jun 2008)
New Revision: 9087
Modified:
trunk/ui/panelbar/src/main/templates/panelBarItem.jspx
Log:
http://jira.jboss.com/jira/browse/RF-3584
Modified: trunk/ui/panelbar/src/main/templates/panelBarItem.jspx
===================================================================
--- trunk/ui/panelbar/src/main/templates/panelBarItem.jspx 2008-06-17 23:48:59 UTC (rev 9086)
+++ trunk/ui/panelbar/src/main/templates/panelBarItem.jspx 2008-06-18 00:06:07 UTC (rev 9087)
@@ -44,7 +44,7 @@
]]></jsp:scriptlet>
</div>
- <div style="display: none; width: 100%;">
+ <div style="display: none; width: 100%;" class="rich-panelbar-content-exterior">
<table cellpadding="0" cellspacing="0" width="100%" style="height: 100%;"><tbody><tr><td class="dr-pnlbar-c rich-panelbar-content #{panel.attributes['contentClass']} #{component.attributes['contentClass']}"
style="#{panel.attributes['contentStyle']};#{component.attributes['contentStyle']}">
<vcp:body>
16 years
JBoss Rich Faces SVN: r9086 - in trunk/ui/dataFilterSlider/src/main/java/org/richfaces: event and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-06-17 19:48:59 -0400 (Tue, 17 Jun 2008)
New Revision: 9086
Modified:
trunk/ui/dataFilterSlider/src/main/java/org/richfaces/component/UIDataFltrSlider.java
trunk/ui/dataFilterSlider/src/main/java/org/richfaces/event/DataFilterSliderAdapter.java
Log:
http://jira.jboss.com/jira/browse/RF-3719
Modified: trunk/ui/dataFilterSlider/src/main/java/org/richfaces/component/UIDataFltrSlider.java
===================================================================
--- trunk/ui/dataFilterSlider/src/main/java/org/richfaces/component/UIDataFltrSlider.java 2008-06-17 23:16:38 UTC (rev 9085)
+++ trunk/ui/dataFilterSlider/src/main/java/org/richfaces/component/UIDataFltrSlider.java 2008-06-17 23:48:59 UTC (rev 9086)
@@ -74,20 +74,21 @@
}
public void broadcast(FacesEvent event) throws AbortProcessingException {
- super.broadcast(event);
if (event instanceof DataFilterSliderEvent){
- FacesContext context = FacesContext.getCurrentInstance();
- AjaxRendererUtils.addRegionByName(context, this, this.getId());
- String forAttr = this.getFor();
- RendererUtils rendUtil = RendererUtils.getInstance();
- AjaxRendererUtils.addRegionByName(context, this, rendUtil.correctForIdReference(forAttr, this));
-
- if(getSliderListeners().length < 1){
- addSliderListener(new DataFilterSliderAdapter(getSliderListener()));
- }
- }
+ FacesContext context = FacesContext.getCurrentInstance();
+ AjaxRendererUtils.addRegionByName(context, this, this.getId());
+ String forAttr = this.getFor();
+ RendererUtils rendUtil = RendererUtils.getInstance();
+ AjaxRendererUtils.addRegionByName(context, this, rendUtil.correctForIdReference(forAttr, this));
+
+ if(getSliderListeners().length < 1){
+ addSliderListener(new DataFilterSliderAdapter(getSliderListener()));
+ }
+ }
+ super.broadcast(event);
+
}
public void processDecodes(FacesContext context) {
Modified: trunk/ui/dataFilterSlider/src/main/java/org/richfaces/event/DataFilterSliderAdapter.java
===================================================================
--- trunk/ui/dataFilterSlider/src/main/java/org/richfaces/event/DataFilterSliderAdapter.java 2008-06-17 23:16:38 UTC (rev 9085)
+++ trunk/ui/dataFilterSlider/src/main/java/org/richfaces/event/DataFilterSliderAdapter.java 2008-06-17 23:48:59 UTC (rev 9086)
@@ -23,8 +23,8 @@
import javax.faces.component.StateHolder;
import javax.faces.component.UIComponentBase;
+import javax.faces.context.FacesContext;
import javax.faces.el.MethodBinding;
-import javax.faces.context.FacesContext;
/**
* @author Wesley Hales
@@ -59,7 +59,9 @@
*/
public void processSlider(DataFilterSliderEvent event) {
FacesContext context = FacesContext.getCurrentInstance();
- sliderMethod.invoke(context, new Object[]{event});
+ if (sliderMethod != null) {
+ sliderMethod.invoke(context, new Object[]{event});
+ }
}
/**
16 years
JBoss Rich Faces SVN: r9085 - trunk/framework/impl/src/main/java/org/ajax4jsf/component.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2008-06-17 19:16:38 -0400 (Tue, 17 Jun 2008)
New Revision: 9085
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java
Log:
Fix reset data model behavior
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java 2008-06-17 19:25:51 UTC (rev 9084)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java 2008-06-17 23:16:38 UTC (rev 9085)
@@ -444,7 +444,6 @@
*/
public void encodeAjaxChild(FacesContext context, String path,
final Set<String> ids, final Set<String> renderedAreas) throws IOException {
- resetDataModel();
Renderer renderer = getRenderer(context);
if (null != renderer && renderer instanceof AjaxChildrenRenderer) {
@@ -591,7 +590,7 @@
* decode phase and before component encoding.
*/
protected void resetDataModel() {
- this.setExtendedDataModel(null);
+ this._currentModel = null;
_modelsMap.clear();
}
@@ -1650,8 +1649,9 @@
public void beforeRenderResponse(PhaseEvent event) {
FacesContext context = event.getFacesContext();
resetDataModel();
+ this._encoded = null;
if (null != childState && !keepSaved(context)) {
- childState.remove(getBaseClientId(context));
+ childState.clear();
}
}
}
16 years
JBoss Rich Faces SVN: r9084 - in management/design: state and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2008-06-17 15:25:51 -0400 (Tue, 17 Jun 2008)
New Revision: 9084
Added:
management/design/state/
management/design/state/JSF_page_state.doc
Log:
state component description added
Added: management/design/state/JSF_page_state.doc
===================================================================
(Binary files differ)
Property changes on: management/design/state/JSF_page_state.doc
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
16 years
JBoss Rich Faces SVN: r9083 - in trunk/ui/datascroller/src/main/resources: META-INF and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-06-17 12:59:32 -0400 (Tue, 17 Jun 2008)
New Revision: 9083
Added:
trunk/ui/datascroller/src/main/resources/META-INF/
trunk/ui/datascroller/src/main/resources/META-INF/services/
trunk/ui/datascroller/src/main/resources/META-INF/services/org.richfaces.component.ComponentPhaseEventHandler
Log:
RF-2815
Added: trunk/ui/datascroller/src/main/resources/META-INF/services/org.richfaces.component.ComponentPhaseEventHandler
===================================================================
--- trunk/ui/datascroller/src/main/resources/META-INF/services/org.richfaces.component.ComponentPhaseEventHandler (rev 0)
+++ trunk/ui/datascroller/src/main/resources/META-INF/services/org.richfaces.component.ComponentPhaseEventHandler 2008-06-17 16:59:32 UTC (rev 9083)
@@ -0,0 +1 @@
+org.richfaces.component.DataScrollerViewPhaseListener
\ No newline at end of file
16 years
JBoss Rich Faces SVN: r9082 - trunk/framework/impl/src/main/resources/META-INF/services.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-06-17 12:55:55 -0400 (Tue, 17 Jun 2008)
New Revision: 9082
Added:
trunk/framework/impl/src/main/resources/META-INF/services/org.ajax4jsf.resource.InternetResourceBuilder
Modified:
trunk/framework/impl/src/main/resources/META-INF/services/org.richfaces.component.ComponentPhaseEventHandler
Log:
RF-2815
Added: trunk/framework/impl/src/main/resources/META-INF/services/org.ajax4jsf.resource.InternetResourceBuilder
===================================================================
--- trunk/framework/impl/src/main/resources/META-INF/services/org.ajax4jsf.resource.InternetResourceBuilder (rev 0)
+++ trunk/framework/impl/src/main/resources/META-INF/services/org.ajax4jsf.resource.InternetResourceBuilder 2008-06-17 16:55:55 UTC (rev 9082)
@@ -0,0 +1 @@
+org.ajax4jsf.resource.ResourceBuilderImpl
Modified: trunk/framework/impl/src/main/resources/META-INF/services/org.richfaces.component.ComponentPhaseEventHandler
===================================================================
--- trunk/framework/impl/src/main/resources/META-INF/services/org.richfaces.component.ComponentPhaseEventHandler 2008-06-17 16:42:54 UTC (rev 9081)
+++ trunk/framework/impl/src/main/resources/META-INF/services/org.richfaces.component.ComponentPhaseEventHandler 2008-06-17 16:55:55 UTC (rev 9082)
@@ -1 +1 @@
-org.richfaces.component.DataScrollerViewPhaseListener
\ No newline at end of file
+org.ajax4jsf.component.UIDataAdaptorPhaseEventHandler
\ No newline at end of file
16 years
JBoss Rich Faces SVN: r9081 - trunk/framework/impl/src/main/resources/META-INF/services.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-06-17 12:42:54 -0400 (Tue, 17 Jun 2008)
New Revision: 9081
Removed:
trunk/framework/impl/src/main/resources/META-INF/services/org.ajax4jsf.resource.InternetResourceBuilder
Log:
RF-2815
Deleted: trunk/framework/impl/src/main/resources/META-INF/services/org.ajax4jsf.resource.InternetResourceBuilder
===================================================================
--- trunk/framework/impl/src/main/resources/META-INF/services/org.ajax4jsf.resource.InternetResourceBuilder 2008-06-17 16:29:43 UTC (rev 9080)
+++ trunk/framework/impl/src/main/resources/META-INF/services/org.ajax4jsf.resource.InternetResourceBuilder 2008-06-17 16:42:54 UTC (rev 9081)
@@ -1 +0,0 @@
-org.ajax4jsf.resource.ResourceBuilderImpl
16 years
JBoss Rich Faces SVN: r9080 - in trunk: framework/impl/src/main/java/org/ajax4jsf/application and 6 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-06-17 12:29:43 -0400 (Tue, 17 Jun 2008)
New Revision: 9080
Removed:
trunk/ui/datascroller/src/main/config/faces/
trunk/ui/datascroller/src/main/java/org/richfaces/component/DataScrollerPhaseListener.java
Modified:
trunk/framework/api/src/main/java/org/richfaces/event/ComponentPhaseEventHandler.java
trunk/framework/impl/src/main/java/org/ajax4jsf/application/AjaxViewHandler.java
trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java
trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptorPhaseEventHandler.java
trunk/framework/impl/src/main/java/org/richfaces/event/ComponentViewPhaseListener.java
trunk/framework/impl/src/main/java/org/richfaces/util/ComponentPhaseEventHandlerUtils.java
trunk/framework/impl/src/main/resources/META-INF/services/org.richfaces.component.ComponentPhaseEventHandler
trunk/ui/datascroller/src/main/java/org/richfaces/component/DataScrollerViewPhaseListener.java
Log:
RF-2815
Modified: trunk/framework/api/src/main/java/org/richfaces/event/ComponentPhaseEventHandler.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/event/ComponentPhaseEventHandler.java 2008-06-17 15:01:56 UTC (rev 9079)
+++ trunk/framework/api/src/main/java/org/richfaces/event/ComponentPhaseEventHandler.java 2008-06-17 16:29:43 UTC (rev 9080)
@@ -7,6 +7,12 @@
public interface ComponentPhaseEventHandler extends Serializable {
- void beforePhase(UIComponent component, PhaseEvent event);
+ Object beforePhaseBegin(PhaseEvent event);
+ void componentBegin(UIComponent component, PhaseEvent event, Object state);
+
+ void componentEnd(UIComponent component, PhaseEvent event, Object state);
+
+ void beforePhaseEnd(PhaseEvent event, Object state);
+
}
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/application/AjaxViewHandler.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/application/AjaxViewHandler.java 2008-06-17 15:01:56 UTC (rev 9079)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/application/AjaxViewHandler.java 2008-06-17 16:29:43 UTC (rev 9080)
@@ -22,7 +22,6 @@
package org.ajax4jsf.application;
import java.io.IOException;
-import java.util.List;
import javax.faces.FacesException;
import javax.faces.application.ViewHandler;
@@ -39,9 +38,7 @@
import org.ajax4jsf.resource.InternetResourceBuilder;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.richfaces.event.ComponentPhaseEventHandler;
import org.richfaces.event.ComponentViewPhaseListener;
-import org.richfaces.util.ComponentPhaseEventHandlerUtils;
/**
* @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
@@ -93,9 +90,7 @@
}
}
- List<ComponentPhaseEventHandler> handlers = ComponentPhaseEventHandlerUtils.getHandlers();
- ComponentViewPhaseListener phaseListener = new ComponentViewPhaseListener(handlers);
- riRoot.addPhaseListener(phaseListener);
+ riRoot.addPhaseListener(new ComponentViewPhaseListener());
return riRoot;
}
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java 2008-06-17 15:01:56 UTC (rev 9079)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java 2008-06-17 16:29:43 UTC (rev 9080)
@@ -1647,7 +1647,7 @@
super.setValue(value);
}
- public void beforePhase(PhaseEvent event) {
+ public void beforeRenderResponse(PhaseEvent event) {
FacesContext context = event.getFacesContext();
resetDataModel();
if (null != childState && !keepSaved(context)) {
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptorPhaseEventHandler.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptorPhaseEventHandler.java 2008-06-17 15:01:56 UTC (rev 9079)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptorPhaseEventHandler.java 2008-06-17 16:29:43 UTC (rev 9080)
@@ -14,17 +14,35 @@
/**
*
*/
- private static final long serialVersionUID = -9027449995146628492L;
+ private static final long serialVersionUID = -1356035330152521515L;
/* (non-Javadoc)
- * @see org.richfaces.component.ComponentPhaseEventHandler#beforePhase(javax.faces.component.UIComponent, javax.faces.event.PhaseEvent)
+ * @see org.richfaces.event.ComponentPhaseEventHandler#bcomponentEnd(javax.faces.component.UIComponent, javax.faces.event.PhaseEvent, java.lang.Object)
*/
- public void beforePhase(UIComponent component, PhaseEvent event) {
+ public void componentEnd(UIComponent component, PhaseEvent event,
+ Object state) {}
+
+ /* (non-Javadoc)
+ * @see org.richfaces.event.ComponentPhaseEventHandler#beforePhaseBegin(javax.faces.event.PhaseEvent)
+ */
+ public Object beforePhaseBegin(PhaseEvent event) {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.event.ComponentPhaseEventHandler#beforePhaseEnd(javax.faces.event.PhaseEvent, java.lang.Object)
+ */
+ public void beforePhaseEnd(PhaseEvent event, Object state) {}
+
+ /* (non-Javadoc)
+ * @see org.richfaces.event.ComponentPhaseEventHandler#componentBegin(javax.faces.component.UIComponent, javax.faces.event.PhaseEvent, java.lang.Object)
+ */
+ public void componentBegin(UIComponent component, PhaseEvent event,
+ Object state) {
if (component instanceof UIDataAdaptor) {
- ((UIDataAdaptor) component).beforePhase(event);
+ ((UIDataAdaptor) component).beforeRenderResponse(event);
}
-
}
}
Modified: trunk/framework/impl/src/main/java/org/richfaces/event/ComponentViewPhaseListener.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/event/ComponentViewPhaseListener.java 2008-06-17 15:01:56 UTC (rev 9079)
+++ trunk/framework/impl/src/main/java/org/richfaces/event/ComponentViewPhaseListener.java 2008-06-17 16:29:43 UTC (rev 9080)
@@ -1,7 +1,6 @@
package org.richfaces.event;
import java.util.Iterator;
-import java.util.List;
import javax.faces.component.UIComponent;
import javax.faces.component.UIViewRoot;
@@ -10,6 +9,8 @@
import javax.faces.event.PhaseId;
import javax.faces.event.PhaseListener;
+import org.richfaces.util.ComponentPhaseEventHandlerUtils;
+
public class ComponentViewPhaseListener implements PhaseListener {
/**
@@ -17,34 +18,39 @@
*/
private static final long serialVersionUID = -2437433246178955788L;
- private List<ComponentPhaseEventHandler> handlers = null;
-
- public ComponentViewPhaseListener(List<ComponentPhaseEventHandler> handlers) {
- this.handlers = handlers;
- }
+ private static ComponentPhaseEventHandler[] handlers = ComponentPhaseEventHandlerUtils.getHandlers();
+ private static Object[] states = null;
public void afterPhase(PhaseEvent event) {
}
- private void doBeforePhase(PhaseEvent event, UIComponent component) {
- if (component.isRendered() && handlers != null) {
- for (ComponentPhaseEventHandler handler : handlers) {
- handler.beforePhase(component, event);
- }
- Iterator<UIComponent> children = component.getFacetsAndChildren();
- while (children.hasNext()) {
- doBeforePhase(event, children.next());
- }
+ private void beforePhase(PhaseEvent event, UIComponent component) {
+ for (int i = 0; i < handlers.length; i++) {
+ handlers[i].componentBegin(component, event, states[i]);
}
-
+ Iterator<UIComponent> children = component.getFacetsAndChildren();
+ while (children.hasNext()) {
+ beforePhase(event, children.next());
+ }
+ for (int i = 0; i < handlers.length; i++) {
+ handlers[i].componentEnd(component, event, states[i]);
+ }
}
public void beforePhase(PhaseEvent event) {
+ states = new Object[handlers.length];
+ for (int i = 0; i < handlers.length; i++) {
+ states[i] = handlers[i].beforePhaseBegin(event);
+ }
FacesContext facesContext = event.getFacesContext();
UIViewRoot viewRoot = facesContext.getViewRoot();
- if (viewRoot != null) {
- doBeforePhase(event, viewRoot);
+ if (viewRoot != null && handlers != null) {
+ beforePhase(event, viewRoot);
}
+ for (int i = 0; i < handlers.length; i++) {
+ handlers[i].beforePhaseEnd(event, states[i]);
+ }
+ states = null;
}
public PhaseId getPhaseId() {
Modified: trunk/framework/impl/src/main/java/org/richfaces/util/ComponentPhaseEventHandlerUtils.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/util/ComponentPhaseEventHandlerUtils.java 2008-06-17 15:01:56 UTC (rev 9079)
+++ trunk/framework/impl/src/main/java/org/richfaces/util/ComponentPhaseEventHandlerUtils.java 2008-06-17 16:29:43 UTC (rev 9080)
@@ -3,9 +3,8 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
-import java.util.ArrayList;
import java.util.Enumeration;
-import java.util.List;
+import java.util.LinkedList;
import java.util.Scanner;
import javax.faces.FacesException;
@@ -16,11 +15,11 @@
public class ComponentPhaseEventHandlerUtils{
- static private List<ComponentPhaseEventHandler> handlers = null;
+ static private ComponentPhaseEventHandler[] handlers = null;
private ComponentPhaseEventHandlerUtils() {}
- public static List<ComponentPhaseEventHandler> getHandlers() {
+ public static ComponentPhaseEventHandler[] getHandlers() {
if (handlers == null) {
synchronized(ComponentPhaseEventHandlerUtils.class) {
if (handlers == null) {
@@ -32,7 +31,7 @@
}
private static void init() {
- handlers = new ArrayList<ComponentPhaseEventHandler>();
+ LinkedList<ComponentPhaseEventHandler> list = new LinkedList<ComponentPhaseEventHandler>();
ClassLoader loader = Thread.currentThread().getContextClassLoader();
String resource = "META-INF/services/org.richfaces.component.ComponentPhaseEventHandler";
try {
@@ -46,7 +45,7 @@
Class<?> handlerClass = ServicesUtils.loadClass(loader, handlerClassName);
Object handler = handlerClass.newInstance();
if (handler instanceof ComponentPhaseEventHandler) {
- handlers.add((ComponentPhaseEventHandler) handler);
+ list.add((ComponentPhaseEventHandler) handler);
}
} catch (Exception e) {
throw new FacesException("Error create instance for class "+ handlerClassName, e);
@@ -57,5 +56,6 @@
} catch (IOException e) {
throw new FacesException("Error load resource "+ resource, e);
}
+ handlers = list.toArray(new ComponentPhaseEventHandler[list.size()]);
}
}
Modified: trunk/framework/impl/src/main/resources/META-INF/services/org.richfaces.component.ComponentPhaseEventHandler
===================================================================
--- trunk/framework/impl/src/main/resources/META-INF/services/org.richfaces.component.ComponentPhaseEventHandler 2008-06-17 15:01:56 UTC (rev 9079)
+++ trunk/framework/impl/src/main/resources/META-INF/services/org.richfaces.component.ComponentPhaseEventHandler 2008-06-17 16:29:43 UTC (rev 9080)
@@ -1 +1 @@
-org.ajax4jsf.component.UIDataAdaptorPhaseEventHandler
\ No newline at end of file
+org.richfaces.component.DataScrollerViewPhaseListener
\ No newline at end of file
Deleted: trunk/ui/datascroller/src/main/java/org/richfaces/component/DataScrollerPhaseListener.java
===================================================================
--- trunk/ui/datascroller/src/main/java/org/richfaces/component/DataScrollerPhaseListener.java 2008-06-17 15:01:56 UTC (rev 9079)
+++ trunk/ui/datascroller/src/main/java/org/richfaces/component/DataScrollerPhaseListener.java 2008-06-17 16:29:43 UTC (rev 9080)
@@ -1,64 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.component;
-
-import javax.faces.component.UIViewRoot;
-import javax.faces.context.FacesContext;
-import javax.faces.event.PhaseEvent;
-import javax.faces.event.PhaseId;
-import javax.faces.event.PhaseListener;
-
-/**
- * Created 08.03.2008
- * @author Nick Belaevski
- * @since 3.2
- */
-
-public class DataScrollerPhaseListener implements PhaseListener {
-
- /**
- *
- */
- private static final long serialVersionUID = -3614288642745891577L;
-
- private static final String ATTRIBUTE_NAME = DataScrollerPhaseListener.class.getName();
-
- private PhaseListener listener = new DataScrollerViewPhaseListener();
-
- public void afterPhase(PhaseEvent event) {
- }
-
- public void beforePhase(PhaseEvent event) {
- FacesContext facesContext = event.getFacesContext();
- UIViewRoot viewRoot = facesContext.getViewRoot();
- if (viewRoot != null && !Boolean.TRUE.equals(
- viewRoot.getAttributes().get(ATTRIBUTE_NAME))) {
- viewRoot.addPhaseListener(listener);
- viewRoot.getAttributes().put(ATTRIBUTE_NAME, Boolean.TRUE);
- }
- }
-
- public PhaseId getPhaseId() {
- return PhaseId.RENDER_RESPONSE;
- }
-
-}
Modified: trunk/ui/datascroller/src/main/java/org/richfaces/component/DataScrollerViewPhaseListener.java
===================================================================
--- trunk/ui/datascroller/src/main/java/org/richfaces/component/DataScrollerViewPhaseListener.java 2008-06-17 15:01:56 UTC (rev 9079)
+++ trunk/ui/datascroller/src/main/java/org/richfaces/component/DataScrollerViewPhaseListener.java 2008-06-17 16:29:43 UTC (rev 9080)
@@ -33,16 +33,14 @@
import javax.el.ValueExpression;
import javax.faces.component.UIComponent;
import javax.faces.component.UIData;
-import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
import javax.faces.event.PhaseEvent;
-import javax.faces.event.PhaseId;
-import javax.faces.event.PhaseListener;
import org.ajax4jsf.Messages;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.richfaces.component.util.MessageUtil;
+import org.richfaces.event.ComponentPhaseEventHandler;
/**
@@ -51,7 +49,7 @@
* @since 3.2
*/
-public class DataScrollerViewPhaseListener implements PhaseListener {
+public class DataScrollerViewPhaseListener implements ComponentPhaseEventHandler {
/**
*
@@ -84,9 +82,6 @@
}
}
- public void afterPhase(PhaseEvent event) {
- }
-
private static boolean isRendered(List<UIComponent> components) {
boolean rendered;
@@ -110,7 +105,10 @@
return true;
}
- private void collectConnections(UIComponent component, ComponentConnections connections, LinkedList<UIComponent> parentComponents) {
+ public void componentBegin(UIComponent component, PhaseEvent event, Object state) {
+ Object[] objects = (Object[]) state;
+ ComponentConnections connections = (ComponentConnections) objects[0];
+ LinkedList<UIComponent> parentComponents = (LinkedList<UIComponent>) objects[1];
parentComponents.addLast(component);
if (component instanceof UIDatascroller && isRendered(parentComponents)) {
@@ -119,13 +117,6 @@
connections.addConnection(dataTable, datascroller);
}
-
- Iterator<UIComponent> children = component.getFacetsAndChildren();
- while(children.hasNext()) {
- collectConnections(children.next(), connections, parentComponents);
- }
-
- parentComponents.removeLast();
}
private static boolean same(Object o1, Object o2) {
@@ -141,96 +132,98 @@
return (o1 != null && o1.equals(o2)) || (o1 == null && o2 == null);
}
- public void beforePhase(PhaseEvent event) {
+ public void beforePhaseEnd(PhaseEvent event, Object state) {
+ Object[] objects = (Object[]) state;
+ ComponentConnections connections = (ComponentConnections) objects[0];
FacesContext facesContext = event.getFacesContext();
- UIViewRoot viewRoot = facesContext.getViewRoot();
- if (viewRoot != null) {
- ComponentConnections connections = new ComponentConnections();
- collectConnections(viewRoot, connections, new LinkedList<UIComponent>());
- Iterator<Entry<UIData, List<UIDatascroller>>> entries =
- connections.iterator();
+ Iterator<Entry<UIData, List<UIDatascroller>>> entries =
+ connections.iterator();
- while (entries.hasNext()) {
- Entry<UIData, List<UIDatascroller>> entry = entries.next();
- List<UIDatascroller> scrollers = entry.getValue();
- if (!scrollers.isEmpty()) {
- List<Object> values = new ArrayList<Object>(scrollers.size());
-
- UIData data = entry.getKey();
- UIDatascroller activeComponent = null;
-
- Map<String, Object> attributes = data.getAttributes();
- Object pageValue = attributes.get(UIDatascroller.SCROLLER_STATE_ATTRIBUTE);
+ while (entries.hasNext()) {
+ Entry<UIData, List<UIDatascroller>> entry = entries.next();
+ List<UIDatascroller> scrollers = entry.getValue();
+ if (!scrollers.isEmpty()) {
+ List<Object> values = new ArrayList<Object>(scrollers.size());
+
+ UIData data = entry.getKey();
+ UIDatascroller activeComponent = null;
+
+ Map<String, Object> attributes = data.getAttributes();
+ Object pageValue = attributes.get(UIDatascroller.SCROLLER_STATE_ATTRIBUTE);
- if (pageValue == null) {
- boolean valid = true;
+ if (pageValue == null) {
+ boolean valid = true;
- for (UIDatascroller datascroller : scrollers) {
- Object nextPageValue = null;
+ for (UIDatascroller datascroller : scrollers) {
+ Object nextPageValue = null;
- if (datascroller.isLocalPageSet()) {
- nextPageValue = datascroller.getPage();
- attributes.put(UIDatascroller.SCROLLER_STATE_ATTRIBUTE, nextPageValue);
- datascroller.resetLocalPage();
- } else {
- nextPageValue = datascroller.getValueExpression("page");
- }
+ if (datascroller.isLocalPageSet()) {
+ nextPageValue = datascroller.getPage();
+ attributes.put(UIDatascroller.SCROLLER_STATE_ATTRIBUTE, nextPageValue);
+ datascroller.resetLocalPage();
+ } else {
+ nextPageValue = datascroller.getValueExpression("page");
+ }
- if (!values.isEmpty() && !same(values.get(values.size() - 1), nextPageValue)) {
- valid = false;
- }
-
- values.add(nextPageValue);
-
- if (nextPageValue != null) {
- activeComponent = datascroller;
- pageValue = nextPageValue;
- }
+ if (!values.isEmpty() && !same(values.get(values.size() - 1), nextPageValue)) {
+ valid = false;
}
+
+ values.add(nextPageValue);
- if (!valid) {
- StringBuilder builder = new StringBuilder("\n[");
- Iterator<UIDatascroller> scrollerItr = scrollers.iterator();
- Iterator<Object> valueItr = values.iterator();
+ if (nextPageValue != null) {
+ activeComponent = datascroller;
+ pageValue = nextPageValue;
+ }
+ }
+
+ if (!valid) {
+ StringBuilder builder = new StringBuilder("\n[");
+ Iterator<UIDatascroller> scrollerItr = scrollers.iterator();
+ Iterator<Object> valueItr = values.iterator();
+
+ while (scrollerItr.hasNext()) {
+ UIDatascroller next = scrollerItr.next();
+ builder.append(MessageUtil.getLabel(facesContext, next));
+ builder.append(": ");
- while (scrollerItr.hasNext()) {
- UIDatascroller next = scrollerItr.next();
- builder.append(MessageUtil.getLabel(facesContext, next));
- builder.append(": ");
-
- Object value = valueItr.next();
- if (value instanceof Expression) {
- builder.append(((Expression) value).getExpressionString());
- } else {
- builder.append(value);
- }
-
- builder.append(scrollerItr.hasNext() ? ",\n" : "]");
+ Object value = valueItr.next();
+ if (value instanceof Expression) {
+ builder.append(((Expression) value).getExpressionString());
+ } else {
+ builder.append(value);
}
- String formattedMessage = Messages.getMessage(Messages.DATASCROLLER_PAGES_DIFFERENT,
- new Object[] {MessageUtil.getLabel(facesContext, data), builder});
-
-
- log.error(formattedMessage);
+ builder.append(scrollerItr.hasNext() ? ",\n" : "]");
}
- }
+ String formattedMessage = Messages.getMessage(Messages.DATASCROLLER_PAGES_DIFFERENT,
+ new Object[] {MessageUtil.getLabel(facesContext, data), builder});
- if (activeComponent == null) {
- activeComponent = scrollers.get(scrollers.size() - 1);
+
+ log.error(formattedMessage);
}
+
+ }
- if (pageValue != null) {
- activeComponent.setupFirstRowValue();
- }
+ if (activeComponent == null) {
+ activeComponent = scrollers.get(scrollers.size() - 1);
}
+
+ if (pageValue != null) {
+ activeComponent.setupFirstRowValue();
+ }
}
}
}
- public PhaseId getPhaseId() {
- return PhaseId.RENDER_RESPONSE;
+ public Object beforePhaseBegin(PhaseEvent event) {
+ return new Object[] {new ComponentConnections(), new LinkedList<UIComponent>()};
}
+ public void componentEnd(UIComponent component, PhaseEvent event, Object state) {
+ Object[] objects = (Object[]) state;
+ LinkedList<?> parentComponents = (LinkedList<?>) objects[1];
+ parentComponents.removeLast();
+ }
}
16 years
JBoss Rich Faces SVN: r9079 - in trunk/test-applications/seleniumTest/src: test/java/org/richfaces/testng and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: alevkovsky
Date: 2008-06-17 11:01:56 -0400 (Tue, 17 Jun 2008)
New Revision: 9079
Added:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxOutputPanelTest.java
Removed:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxOutputPanelTest.java
Modified:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JOutputPanelTestBean.java
Log:
Adjust test code
Modified: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JOutputPanelTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JOutputPanelTestBean.java 2008-06-17 14:25:04 UTC (rev 9078)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JOutputPanelTestBean.java 2008-06-17 15:01:56 UTC (rev 9079)
@@ -72,6 +72,7 @@
}
public String b1Action(){
+ setPanel2VisibleFlag(false);
return null;
}
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxOutputPanelTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxOutputPanelTest.java 2008-06-17 14:25:04 UTC (rev 9078)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxOutputPanelTest.java 2008-06-17 15:01:56 UTC (rev 9079)
@@ -1,247 +0,0 @@
-/*
- * AjaxOutputPanel.java Date created: 10.06.2008
- * Last modified by: $Author$
- * $Revision$ $Date$
- */
-
-package org.richfaces.testng;
-
-import org.ajax4jsf.template.Template;
-import org.richfaces.RichSeleniumTest;
-import org.richfaces.SeleniumTestBase;
-import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Parameters;
-import org.testng.annotations.Test;
-
-/**
- * Ajax Output Panel selenium test
- * @author Alexandr Levkovsky
- *
- */
-public class AjaxOutputPanelTest extends SeleniumTestBase implements RichSeleniumTest {
-
- public AjaxOutputPanelTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeMethod
- @Parameters( { "browser", "filterPrefix" })
- public void startSelenium(String browser, String filterPrefix) {
- super.startSelenium(browser, filterPrefix);
-
- //TODO should pass as parameter
- renderPage(Template.SIMPLE);
- }
-
- @BeforeMethod
- @Parameters( { "loadStyleStrategy", "loadScriptStrategy" })
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy) throws Exception {
- super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
- }
-
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterMethod(alwaysRun = true)
- public void stopSelenium() {
- super.stopSelenium();
- }
-
- public String getTestUrl() {
- return "pages/ajaxOutputPanel/ajaxOutputPanelTest.xhtml";
- }
-
- @Test
- public void testLayoutAttribute() throws Exception {
- // panel_1 has layout=inline(default)
- // panel_2 has layout=block
- // panel_3 has layout=none
- writeStatus("Testing layout attribute...");
-
- String panelId = "form:panel_1";
- String panel2Id = "form:panel_2";
- String panel3Id = getParentId() + "form:panel_3";
-
- String type = runScript("getElementType('" + panelId + "')");
- Assert.assertEquals(type.toLowerCase(), "span", "panel_1 has layout=inline(default) and should be 'span' element");
-
- type = runScript("getElementType('" + panel2Id + "')");
- Assert.assertEquals(type.toLowerCase(), "div", "panel_2 has layout=block and should be 'div' element");
-
- // panel_3 has layout=none and should not present if a child component
- // is rendered
- if (isPresentById(panel3Id)) {
- Assert.fail("panel_3 has layout=none and should not peresent if a child component is rendered ");
- }
-
- // remove child component rendering
- writeStatus("Click button 3");
- String buttonId = getParentId() + "form:b3";
- clickById(buttonId);
- waitForAjaxCompletion();
- // panel_3 has layout=none and should present if no child component is
- // rendered with id of a child component and display:none style
- if (!isPresentById(panel3Id + "_text")) {
- Assert.fail("panel_3 has layout=none and should peresent if no child component is rendered with id of a child component");
- }
- if (isVisibleById(panel3Id + "_text")) {
- Assert.fail("panel_3 has layout=none and should peresent if no child component is rendered with display:none style");
- }
- }
-
- @Test
- public void testRenderedAttribute() throws Exception {
- writeStatus("Testing rendered attribute...");
-
- String panelId = getParentId() + "form:panel_4";
-
- // panel_4 has rendered=true and should present on page
- AssertRendered(panelId);
-
- // change rendered attribute to false
- writeStatus("Click button 4");
- String buttonId = getParentId() + "form:b4";
- clickCommandAndWait(buttonId);
-
- // panel_4 has rendered=false and should not present on page
- AssertNotRendered(panelId);
- }
-
- @Test
- public void testAjaxRenderedAttribute() throws Exception {
- // panel_1 has ajaxRendered=false and is reRender by b1
- // panel_2 has ajaxRendered=true
- writeStatus("Testing ajaxRendered attribute...");
-
- String parentId = getParentId() + "form:";
- String panelId = parentId + "panel_1_text";
- String panelId2 = parentId + "panel_2_text";
- String buttonId = parentId + "b2";
- writeStatus("Click button 2");
- // set panel_1 text visible flag to false
- clickById(buttonId);
- waitForAjaxCompletion();
- // panel_1 text should be visible as it reRendered only by b1
- if (!isPresentById(panelId)) {
- Assert.fail("panel_1 text should be visible as it reRendered only by b1");
- }
- // panel_2 text should not be visible as it has ajaxRendered=true
- if (isPresentById(panelId2)) {
- Assert.fail("panel_2 text should not be visible as it has ajaxRendered=true");
- }
-
- buttonId = parentId + "b1";
- writeStatus("Click button 1");
- clickById(buttonId);
- waitForAjaxCompletion();
- // panel text should NOT be visible as it reRendered by b1
- if (isPresentById(panelId)) {
- Assert.fail("panel_1 text should not be visible as it reRendered by b1");
- }
- }
-
- @Test
- public void testOnDoubleClickEvent() throws Exception {
- String parentId = getParentId() + "form:";
- String panelId = parentId + "panel_5";
- writeStatus("Check ondoubleclick event");
- selenium.doubleClick(panelId);
- String panelResultId = panelId + "_result";
- AssertTextEquals(panelResultId, "Yes");
- }
-
- @Test
- public void testOnKeyDownEvent() throws Exception {
- String parentId = getParentId() + "form:";
- String panelId = parentId + "panel_6";
- writeStatus("Check onkeydown event");
- selenium.keyDown(panelId, "1");
- String panelResultId = panelId + "_result";
- AssertTextEquals(panelResultId, "Yes");
- }
-
- @Test
- public void testOnKeyPressEvent() throws Exception {
- String parentId = getParentId() + "form:";
- String panelId = parentId + "panel_7";
- writeStatus("Check onkeypress event");
- selenium.keyPress(panelId, "1");
- String panelResultId = panelId + "_result";
- AssertTextEquals(panelResultId, "Yes");
- }
-
- @Test
- public void testOnKeyUpEvent() throws Exception {
- String parentId = getParentId() + "form:";
- String panelId = parentId + "panel_8";
- writeStatus("Check onkeyup event");
- selenium.keyUp(panelId, "1");
- String panelResultId = panelId + "_result";
- AssertTextEquals(panelResultId, "Yes");
- }
-
- @Test
- public void testOnMouseDownEvent() throws Exception {
- String parentId = getParentId() + "form:";
- String panelId = parentId + "panel_9";
- writeStatus("Check onmousedown event");
- selenium.mouseDown(panelId);
- String panelResultId = panelId + "_result";
- AssertTextEquals(panelResultId, "Yes");
- }
-
- @Test
- public void testOnMouseMoveEvent() throws Exception {
- String parentId = getParentId() + "form:";
- String panelId = parentId + "panel_10";
- writeStatus("Check onmousemove event");
- selenium.mouseMove(panelId);
- String panelResultId = panelId + "_result";
- AssertTextEquals(panelResultId, "Yes");
- }
-
- @Test
- public void testOnMouseOutEvent() throws Exception {
- String parentId = getParentId() + "form:";
- String panelId = parentId + "panel_11";
- writeStatus("Check onmouseout event");
- selenium.mouseOut(panelId);
- String panelResultId = panelId + "_result";
- AssertTextEquals(panelResultId, "Yes");
- }
-
- @Test
- public void testOnMouseOverEvent() throws Exception {
- String parentId = getParentId() + "form:";
- String panelId = parentId + "panel_12";
- writeStatus("Check onmouseover event");
- selenium.mouseOver(panelId);
- String panelResultId = panelId + "_result";
- AssertTextEquals(panelResultId, "Yes");
- }
-
- @Test
- public void testOnMouseUpEvent() throws Exception {
- String parentId = getParentId() + "form:";
- String panelId = parentId + "panel_13";
- writeStatus("Check onmouseup event");
- selenium.mouseUp(panelId);
- String panelResultId = panelId + "_result";
- AssertTextEquals(panelResultId, "Yes");
- }
-
- @Test
- public void testOnClickEvent() throws Exception {
- String parentId = getParentId() + "form:";
- String panelId = parentId + "panel_14";
- writeStatus("Check onclick event");
- selenium.click(panelId);
- String panelResultId = panelId + "_result";
- AssertTextEquals(panelResultId, "Yes");
- }
-}
Added: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxOutputPanelTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxOutputPanelTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxOutputPanelTest.java 2008-06-17 15:01:56 UTC (rev 9079)
@@ -0,0 +1,303 @@
+/*
+ * AjaxOutputPanel.java Date created: 10.06.2008
+ * Last modified by: $Author$
+ * $Revision$ $Date$
+ */
+
+package org.richfaces.testng;
+
+import org.ajax4jsf.template.Template;
+import org.richfaces.RichSeleniumTest;
+import org.richfaces.SeleniumTestBase;
+import org.testng.Assert;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+/**
+ * Ajax Output Panel selenium test
+ *
+ * @author Alexandr Levkovsky
+ *
+ */
+public class AjaxOutputPanelTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ private final static String FORM_ID = "form:";
+
+ private final static String PANEL1_ID = "panel_1";
+
+ private final static String PANEL2_ID = "panel_2";
+
+ private final static String PANEL3_ID = "panel_3";
+
+ private final static String PANEL4_ID = "panel_4";
+
+ private final static String BUTTON1_ID = "b1";
+
+ private final static String BUTTON2_ID = "b2";
+
+ private final static String BUTTON3_ID = "b3";
+
+ private final static String BUTTON4_ID = "b4";
+
+ private final static String TEXT_SUFFIX = "_text";
+
+ private final static String RESULT_SUFFIX = "_result";
+
+ public AjaxOutputPanelTest() {
+ super("http", "localhost", serverPort);
+ }
+
+ /**
+ * This method are invoking before selenium tests started
+ */
+ @BeforeMethod
+ @Parameters( { "browser", "filterPrefix" })
+ public void startSelenium(String browser, String filterPrefix) {
+ super.startSelenium(browser, filterPrefix);
+
+ // TODO should pass as parameter
+ renderPage(Template.SIMPLE);
+ }
+
+ @BeforeMethod
+ @Parameters( { "loadStyleStrategy", "loadScriptStrategy" })
+ protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy) throws Exception {
+ super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
+ }
+
+ /**
+ * This method are invoking after selenium tests completed
+ */
+ @AfterMethod(alwaysRun = true)
+ public void stopSelenium() {
+ super.stopSelenium();
+ }
+
+ public String getTestUrl() {
+ return "pages/ajaxOutputPanel/ajaxOutputPanelTest.xhtml";
+ }
+
+ @Test
+ public void testLayoutAttribute() throws Exception {
+ // panel_1 has layout=inline(default)
+ // panel_2 has layout=block
+ // panel_3 has layout=none
+ writeStatus("Testing layout attribute...");
+
+ String panelId = getParentId() + FORM_ID + PANEL1_ID;
+ String panel2Id = getParentId() + FORM_ID + PANEL2_ID;
+ String panel3Id = getParentId() + FORM_ID + PANEL3_ID;
+
+ Assert.assertTrue(isPresentById(panelId));
+ String type = runScript("getElementType('" + panelId + "')");
+ Assert.assertEquals(type.toLowerCase(), "span", "panel_1 has layout=inline(default) and should be 'span' element");
+
+ Assert.assertTrue(isPresentById(panel2Id));
+ type = runScript("getElementType('" + panel2Id + "')");
+ Assert.assertEquals(type.toLowerCase(), "div", "panel_2 has layout=block and should be 'div' element");
+
+ // panel_3 has layout=none and should not present if a child component
+ // is rendered
+ Assert.assertFalse(isPresentById(panel3Id), "panel_3 has layout=none and should not peresent if a child component is rendered ");
+
+ // remove child component rendering
+ writeStatus("Click button 3");
+ String buttonId = getParentId() + FORM_ID + BUTTON3_ID;
+ clickById(buttonId);
+ waitForAjaxCompletion();
+
+ // panel_3 has layout=none and should present if no child component is
+ // rendered with id of a child component and display:none style
+ Assert.assertTrue(isPresentById(panel3Id + "_text"), "panel_3 has layout=none and should peresent if no child component is rendered with id of a child component");
+ Assert.assertFalse(isVisibleById(panel3Id + "_text"), "panel_3 has layout=none and should peresent if no child component is rendered with display:none style");
+
+ }
+
+ @Test
+ public void testRenderedAttribute() throws Exception {
+ writeStatus("Testing rendered attribute...");
+
+ String panelId = getParentId() + FORM_ID + PANEL4_ID;
+
+ // panel_4 has rendered=true and should present on page
+ AssertRendered(panelId);
+
+ // change rendered attribute to false
+ writeStatus("Click button 4");
+ String buttonId = getParentId() + FORM_ID + BUTTON4_ID;
+ clickCommandAndWait(buttonId);
+
+ // panel_4 has rendered=false and should not present on page
+ AssertNotRendered(panelId);
+ }
+
+ @Test
+ public void testAjaxRenderedAttribute() throws Exception {
+ // panel_1 has ajaxRendered=false and is reRender by b1
+ // panel_2 has ajaxRendered=true
+ writeStatus("Testing ajaxRendered attribute...");
+
+ String parentId = getParentId() + FORM_ID;
+ String panelId = parentId + PANEL1_ID + TEXT_SUFFIX;
+ String panelId2 = parentId + PANEL2_ID + TEXT_SUFFIX;
+ String buttonId = parentId + BUTTON2_ID;
+ writeStatus("Click button 2");
+ // set panel_1 text visible flag to false
+ clickById(buttonId);
+ waitForAjaxCompletion();
+ // panel_1 text should be visible as it reRendered only by b1
+ Assert.assertTrue(isPresentById(panelId), "panel_1 text should be visible as it reRendered only by b1");
+
+ // panel_2 text should not be visible as it has ajaxRendered=true
+ Assert.assertFalse(isPresentById(panelId2), "panel_2 text should not be visible as it has ajaxRendered=true");
+
+ buttonId = parentId + BUTTON1_ID;
+ writeStatus("Click button 1");
+ clickById(buttonId);
+ waitForAjaxCompletion();
+ // panel text should NOT be visible as it reRendered by b1
+ Assert.assertFalse(isPresentById(panelId), "panel_1 text should not be visible as it reRendered by b1");
+
+ }
+
+ @Test
+ public void testAjaxRenderedAttributeWithLimitToList() throws Exception {
+ // panel_1 has ajaxRendered=false and is reRender by b1 with
+ // limitToList=true
+ // panel_2 has ajaxRendered=true
+ writeStatus("Testing ajaxRendered attribute with limitToList=true...");
+
+ String parentId = getParentId() + FORM_ID;
+ String panelId2 = parentId + PANEL2_ID + TEXT_SUFFIX;
+ String buttonId = parentId + BUTTON1_ID;
+ String button2Id = parentId + BUTTON2_ID;
+
+ Assert.assertTrue(isPresentById(panelId2));
+ writeStatus("Click button 1");
+ // set panel_2 text visible flag to false
+ clickById(buttonId);
+ waitForAjaxCompletion();
+ // panel_2 text should be visible as b1 has limitToList=true and
+ // rerender only panel_1
+ Assert.assertTrue(isPresentById(panelId2), "panel_2 text should be visible as b1 has limitToList=true and rerender only panel_1");
+ writeStatus("Click button 2");
+ clickById(button2Id);
+ waitForAjaxCompletion();
+ // panel_2 text should not be visible as it has ajaxRendered=true and b2
+ // has limitToList=false
+ Assert.assertFalse(isPresentById(panelId2), "panel_2 text should not be visible as it has ajaxRendered=true and b2 has limitToList=false");
+
+ }
+
+ @Test
+ public void testOnDoubleClickEvent() throws Exception {
+ String parentId = getParentId() + FORM_ID;
+ String panelId = parentId + "panel_5";
+ String panelResultId = panelId + RESULT_SUFFIX;
+ writeStatus("Check ondoubleclick event");
+ AssertTextEquals(panelResultId, "No");
+ selenium.doubleClick(panelId);
+ AssertTextEquals(panelResultId, "Yes");
+ }
+
+ @Test
+ public void testOnKeyDownEvent() throws Exception {
+ String parentId = getParentId() + FORM_ID;
+ String panelId = parentId + "panel_6";
+ String panelResultId = panelId + RESULT_SUFFIX;
+ writeStatus("Check onkeydown event");
+ AssertTextEquals(panelResultId, "No");
+ selenium.keyDown(panelId, "1");
+ AssertTextEquals(panelResultId, "Yes");
+ }
+
+ @Test
+ public void testOnKeyPressEvent() throws Exception {
+ String parentId = getParentId() + FORM_ID;
+ String panelId = parentId + "panel_7";
+ String panelResultId = panelId + RESULT_SUFFIX;
+ writeStatus("Check onkeypress event");
+ AssertTextEquals(panelResultId, "No");
+ selenium.keyPress(panelId, "1");
+ AssertTextEquals(panelResultId, "Yes");
+ }
+
+ @Test
+ public void testOnKeyUpEvent() throws Exception {
+ String parentId = getParentId() + FORM_ID;
+ String panelId = parentId + "panel_8";
+ String panelResultId = panelId + RESULT_SUFFIX;
+ writeStatus("Check onkeyup event");
+ AssertTextEquals(panelResultId, "No");
+ selenium.keyUp(panelId, "1");
+ AssertTextEquals(panelResultId, "Yes");
+ }
+
+ @Test
+ public void testOnMouseDownEvent() throws Exception {
+ String parentId = getParentId() + FORM_ID;
+ String panelId = parentId + "panel_9";
+ String panelResultId = panelId + RESULT_SUFFIX;
+ writeStatus("Check onmousedown event");
+ AssertTextEquals(panelResultId, "No");
+ selenium.mouseDown(panelId);
+ AssertTextEquals(panelResultId, "Yes");
+ }
+
+ @Test
+ public void testOnMouseMoveEvent() throws Exception {
+ String parentId = getParentId() + FORM_ID;
+ String panelId = parentId + "panel_10";
+ String panelResultId = panelId + RESULT_SUFFIX;
+ writeStatus("Check onmousemove event");
+ AssertTextEquals(panelResultId, "No");
+ selenium.mouseMove(panelId);
+ AssertTextEquals(panelResultId, "Yes");
+ }
+
+ @Test
+ public void testOnMouseOutEvent() throws Exception {
+ String parentId = getParentId() + FORM_ID;
+ String panelId = parentId + "panel_11";
+ String panelResultId = panelId + RESULT_SUFFIX;
+ writeStatus("Check onmouseout event");
+ AssertTextEquals(panelResultId, "No");
+ selenium.mouseOut(panelId);
+ AssertTextEquals(panelResultId, "Yes");
+ }
+
+ @Test
+ public void testOnMouseOverEvent() throws Exception {
+ String parentId = getParentId() + FORM_ID;
+ String panelId = parentId + "panel_12";
+ String panelResultId = panelId + RESULT_SUFFIX;
+ writeStatus("Check onmouseover event");
+ AssertTextEquals(panelResultId, "No");
+ selenium.mouseOver(panelId);
+ AssertTextEquals(panelResultId, "Yes");
+ }
+
+ @Test
+ public void testOnMouseUpEvent() throws Exception {
+ String parentId = getParentId() + FORM_ID;
+ String panelId = parentId + "panel_13";
+ String panelResultId = panelId + RESULT_SUFFIX;
+ writeStatus("Check onmouseup event");
+ AssertTextEquals(panelResultId, "No");
+ selenium.mouseUp(panelId);
+ AssertTextEquals(panelResultId, "Yes");
+ }
+
+ @Test
+ public void testOnClickEvent() throws Exception {
+ String parentId = getParentId() + FORM_ID;
+ String panelId = parentId + "panel_14";
+ String panelResultId = panelId + RESULT_SUFFIX;
+ writeStatus("Check onclick event");
+ AssertTextEquals(panelResultId, "No");
+ selenium.click(panelId);
+ AssertTextEquals(panelResultId, "Yes");
+ }
+}
16 years