JBoss Ajax4JSF SVN: r319 - in branches/version_1_0_7: src/framework/java/org/ajax4jsf/framework/ajax and 1 other directory.
by ajax4jsf-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-10-11 06:39:29 -0400 (Thu, 11 Oct 2007)
New Revision: 319
Modified:
branches/version_1_0_7/new-build.xml
branches/version_1_0_7/src/framework/java/org/ajax4jsf/framework/ajax/AjaxActionComponent.java
Log:
ps-111
Modified: branches/version_1_0_7/new-build.xml
===================================================================
--- branches/version_1_0_7/new-build.xml 2007-09-17 14:55:28 UTC (rev 318)
+++ branches/version_1_0_7/new-build.xml 2007-10-11 10:39:29 UTC (rev 319)
@@ -224,7 +224,7 @@
<attribute name="Implementation-Title" value="Ajax4JSF"/>
<attribute name="Implementation-Version" value="${a4j.version}"/>
<attribute name="Implementation-Vendor" value="${a4j.vendor}"/>
- <attribute name="SVN-Revision" value="317"/>
+ <attribute name="SVN-Revision" value="319"/>
<attribute name="Built-On" value="${TODAY} ${TSTAMP}"/>
</manifest>
</jar>
Modified: branches/version_1_0_7/src/framework/java/org/ajax4jsf/framework/ajax/AjaxActionComponent.java
===================================================================
--- branches/version_1_0_7/src/framework/java/org/ajax4jsf/framework/ajax/AjaxActionComponent.java 2007-09-17 14:55:28 UTC (rev 318)
+++ branches/version_1_0_7/src/framework/java/org/ajax4jsf/framework/ajax/AjaxActionComponent.java 2007-10-11 10:39:29 UTC (rev 319)
@@ -23,6 +23,7 @@
import javax.faces.component.ActionSource;
import javax.faces.component.UIComponentBase;
+import javax.faces.component.UICommand;
import javax.faces.context.FacesContext;
import javax.faces.el.MethodBinding;
import javax.faces.event.AbortProcessingException;
@@ -39,66 +40,16 @@
* @version $Revision: 1.3 $ $Date: 2006/12/07 19:45:26 $
*
*/
-public abstract class AjaxActionComponent extends UIComponentBase implements ActionSource,
+public abstract class AjaxActionComponent extends UICommand implements ActionSource,
AjaxComponent, AjaxSource {
- /**
- * @exception NullPointerException
- */
- public void addActionListener(ActionListener listener) {
-
- addFacesListener(listener);
-
- }
-
-
- public ActionListener[] getActionListeners() {
-
- ActionListener al[] = (ActionListener [])
- getFacesListeners(ActionListener.class);
- return (al);
-
- }
-
-
-
- /**
- * @exception NullPointerException
- */
- public void removeActionListener(ActionListener listener) {
-
- removeFacesListener(listener);
-
- }
-
-
/* (non-Javadoc)
* @see javax.faces.component.UIComponentBase#broadcast(javax.faces.event.FacesEvent)
*/
public void broadcast(FacesEvent event) throws AbortProcessingException {
// perform default
super.broadcast(event);
- if (event instanceof ActionEvent) {
- FacesContext context = getFacesContext();
- // Perform actionListener.
- MethodBinding action = getActionListener();
- if (null != action) {
- action.invoke(context, new Object[] { event });
- }
- action = getAction();
- // Difference from command - default action listener not perform for null actions ( ajax not use navigations, in common ).
- // TODO - make navigation to different page ?
- if(null != action){
- ActionListener listener =
- context.getApplication().getActionListener();
- if (listener != null) {
- listener.processAction((ActionEvent) event);
- }
-
- } else {
- context.renderResponse();
- }
- } else if (event instanceof AjaxEvent) {
+ if (event instanceof AjaxEvent) {
// complete re-Render fields. AjaxEvent deliver before render response.
setupReRender();
}
@@ -118,16 +69,21 @@
* @see javax.faces.component.UIComponentBase#queueEvent(javax.faces.event.FacesEvent)
*/
public void queueEvent(FacesEvent event) {
- if (event instanceof ActionEvent && event.getComponent()==this) {
- if (isImmediate()) {
- event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
- } else if (isBypassUpdates()) {
- event.setPhaseId(PhaseId.PROCESS_VALIDATIONS);
- }else {
- event.setPhaseId(PhaseId.INVOKE_APPLICATION);
- }
- }
- super.queueEvent(event);
+ if (event instanceof ActionEvent) {
+ if (event.getComponent() == this) {
+ if (isImmediate()) {
+ event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
+ } else if (isBypassUpdates()) {
+ event.setPhaseId(PhaseId.PROCESS_VALIDATIONS);
+ } else {
+ event.setPhaseId(PhaseId.INVOKE_APPLICATION);
+ }
+ }
+ // UICommand set Phase ID for all ActionEvents - bypass it.
+ getParent().queueEvent(event);
+ } else {
+ super.queueEvent(event);
+ }
}
17 years, 2 months