You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2006/01/17 23:46:17 UTC
svn commit: r369949 - in /incubator/tobago/trunk: ./
tobago-core/src/main/java/org/apache/myfaces/tobago/component/
tobago-core/src/main/java/org/apache/myfaces/tobago/event/
tobago-core/src/main/java/org/apache/myfaces/tobago/model/
tobago-core/src/ma...
Author: bommel
Date: Tue Jan 17 14:45:55 2006
New Revision: 369949
URL: http://svn.apache.org/viewcvs?rev=369949&view=rev
Log:
fixed save/restoreState
Modified:
incubator/tobago/trunk/pom.xml
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UICommand.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIData.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIInput.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UITabGroup.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UITree.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/DefaultTreeActionListener.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/model/SheetState.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/taglib/component/CommandTag.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/taglib/component/InTag.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/taglib/component/TreeTag.java
incubator/tobago/trunk/tobago-example/tobago-example-demo/pom.xml
incubator/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/actionlistener/TreeEditor.java
incubator/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/InRenderer.java
Modified: incubator/tobago/trunk/pom.xml
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/pom.xml?rev=369949&r1=369948&r2=369949&view=diff
==============================================================================
--- incubator/tobago/trunk/pom.xml (original)
+++ incubator/tobago/trunk/pom.xml Tue Jan 17 14:45:55 2006
@@ -16,7 +16,8 @@
* limitations under the License.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.myfaces.tobago</groupId>
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java?rev=369949&r1=369948&r2=369949&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java Tue Jan 17 14:45:55 2006
@@ -41,6 +41,7 @@
import javax.faces.component.UISelectItem;
import javax.faces.component.UISelectItems;
import javax.faces.component.ValueHolder;
+import javax.faces.component.ActionSource;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.el.MethodBinding;
@@ -873,7 +874,20 @@
}
- public static void setActionListener(org.apache.myfaces.tobago.component.UICommand command, String actionListener) {
+ public static void setSuggestMethodBinding(UIComponent component, String suggestMethod) {
+ if (suggestMethod != null) {
+ if (UIComponentTag.isValueReference(suggestMethod)) {
+ final MethodBinding methodBinding = FacesContext.getCurrentInstance().getApplication()
+ .createMethodBinding(suggestMethod, new Class[]{String.class});
+ ((UIInput)component).setSuggestMethod(methodBinding);
+ } else {
+ throw new IllegalArgumentException(
+ "Must be a valueReference (suggestMethod): " + suggestMethod);
+ }
+ }
+ }
+
+ public static void setActionListener(ActionSource command, String actionListener) {
final FacesContext facesContext = FacesContext.getCurrentInstance();
final Application application = facesContext.getApplication();
if (actionListener != null) {
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UICommand.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UICommand.java?rev=369949&r1=369948&r2=369949&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UICommand.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UICommand.java Tue Jan 17 14:45:55 2006
@@ -29,9 +29,6 @@
public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.Command";
-// private boolean active;
-
-
public void processDecodes(FacesContext context) {
if (context == null) {
@@ -52,33 +49,13 @@
throw e;
}
-// if (active) {
- // Process all facets and children of this component
Iterator kids = getFacetsAndChildren();
while (kids.hasNext()) {
UIComponent kid = (UIComponent) kids.next();
kid.processDecodes(context);
}
-// }
-
- }
- public void processValidators(FacesContext facesContext) {
-// if (active) {
- super.processValidators(facesContext);
-// }
}
-
- public void processUpdates(FacesContext facesContext) {
-// if (active) {
- super.processUpdates(facesContext);
-// }
- }
-
-// public void setActive(boolean active) {
-// this.active = active;
-// }
-
public void encodeChildren(FacesContext facesContext) throws IOException {
if (isRendered() ) {
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIData.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIData.java?rev=369949&r1=369948&r2=369949&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIData.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIData.java Tue Jan 17 14:45:55 2006
@@ -338,7 +338,7 @@
saveState[0] = super.saveState(context);
saveState[1] = state;
saveState[2] = sorter;
- saveState[3] = stateChangeListener;
+ saveState[3] = saveAttachedState(context, stateChangeListener);
if (showHeaderSet) {
saveState[4] = showHeader;
}
@@ -350,7 +350,7 @@
super.restoreState(context, values[0]);
state = (SheetState) values[1];
sorter = (Sorter) values[2];
- stateChangeListener = (MethodBinding) values[3];
+ stateChangeListener = (MethodBinding) restoreAttachedState(context, values[3]);
if (values[4] != null) {
showHeaderSet = true;
showHeader = (Boolean) values[4];
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIInput.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIInput.java?rev=369949&r1=369948&r2=369949&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIInput.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIInput.java Tue Jan 17 14:45:55 2006
@@ -26,12 +26,37 @@
import org.apache.myfaces.tobago.ajax.api.AjaxUtils;
import javax.faces.context.FacesContext;
+import javax.faces.el.MethodBinding;
import java.io.IOException;
public class UIInput extends javax.faces.component.UIInput implements AjaxComponent {
private static final Log LOG = LogFactory.getLog(UIInput.class);
public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.Input";
+
+ private javax.faces.el.MethodBinding suggestMethod;
+
+ public void restoreState(FacesContext context, Object state) {
+ Object values[] = (Object[])state;
+ super.restoreState(context, values[0]);
+ suggestMethod = (MethodBinding)restoreAttachedState(context, values[1]);
+ }
+
+ public Object saveState(FacesContext context) {
+ Object values[] = new Object[2];
+ values[0] = super.saveState(context);
+ values[1] = saveAttachedState(context, suggestMethod);
+ return values;
+ }
+
+ public MethodBinding getSuggestMethod() {
+ return suggestMethod;
+ }
+
+ public void setSuggestMethod(MethodBinding suggestMethod) {
+ this.suggestMethod = suggestMethod;
+ }
+
// TODO can this removed?
public void updateModel(FacesContext facesContext) {
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UITabGroup.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UITabGroup.java?rev=369949&r1=369948&r2=369949&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UITabGroup.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UITabGroup.java Tue Jan 17 14:45:55 2006
@@ -234,7 +234,7 @@
state[0] = super.saveState(context);
state[1] = new Integer(renderedIndex);
state[2] = new Integer(activeIndex);
- state[3] = tabChangeListener;
+ state[3] = saveAttachedState(context, tabChangeListener);
return state;
}
@@ -243,7 +243,7 @@
super.restoreState(context, values[0]);
renderedIndex = ((Integer)values[1]).intValue();
activeIndex = ((Integer)values[2]).intValue();
- tabChangeListener = (MethodBinding) values[3];
+ tabChangeListener = (MethodBinding) restoreAttachedState(context, values[3]);
}
public void encodeAjax(FacesContext facesContext) throws IOException {
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UITree.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UITree.java?rev=369949&r1=369948&r2=369949&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UITree.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UITree.java Tue Jan 17 14:45:55 2006
@@ -39,6 +39,8 @@
import javax.faces.el.MethodBinding;
import javax.faces.el.ValueBinding;
import javax.faces.event.ActionListener;
+import javax.faces.event.FacesEvent;
+import javax.faces.event.AbortProcessingException;
import javax.faces.validator.Validator;
import javax.faces.validator.ValidatorException;
import javax.swing.tree.DefaultMutableTreeNode;
@@ -82,8 +84,7 @@
private Command[] commands;
- private ActionListener actionListener;
-
+ private MethodBinding actionListener;
private TreeState state;
private boolean showJunctions = true;
@@ -115,6 +116,17 @@
// ---------------------------- interface ActionSource
+ public void broadcast(FacesEvent event) throws AbortProcessingException {
+ super.broadcast(event);
+
+ MethodBinding binding = getActionListener();
+
+ if (binding != null) {
+ FacesContext context = getFacesContext();
+ binding.invoke(context, new Object[] { event });
+ }
+ }
+
public MethodBinding getAction() {
return null;
}
@@ -124,29 +136,23 @@
}
public MethodBinding getActionListener() {
- return null;
+ return actionListener;
}
- public void setActionListener(MethodBinding methodBinding) {
-
+ public void setActionListener(MethodBinding actionListener) {
+ this.actionListener = actionListener;
}
public void addActionListener(ActionListener actionListener) {
- this.actionListener = actionListener;
+ addFacesListener(actionListener);
}
public ActionListener[] getActionListeners() {
- if (actionListener != null) {
- return new ActionListener[] {actionListener};
- } else {
- return new ActionListener[0];
- }
+ return (ActionListener[]) getFacesListeners(ActionListener.class);
}
public void removeActionListener(ActionListener actionListener) {
- if (actionListener.equals(this.actionListener)) {
- this.actionListener = null;
- }
+ removeFacesListener(actionListener);
}
// ----------------------------------------------------------- business methods
@@ -161,18 +167,16 @@
}
super.encodeBegin(facesContext);
}
-
+ // TODO move this to renderkit
public void createDefaultToolbar(FacesContext facesContext) {
UIComponent toolbar = ComponentUtil.createComponent(
facesContext, UIPanel.COMPONENT_TYPE, RENDERER_TYPE_TOOL_BAR);
toolbar.getAttributes().put(ATTR_ICON_SIZE, ToolBarTag.ICON_SMALL);
toolbar.getAttributes().put(ATTR_LABEL_POSITION, ToolBarTag.LABEL_OFF);
- ActionListener handler = null;
ActionListener[] handlers = getActionListeners();
- if (handlers != null && handlers.length > 0) {
- handler = handlers[0];
- } else {
+
+ if ( (handlers == null || handlers.length == 0) && getActionListener() == null ) {
LOG.error("No actionListener found in tree, so tree editing will not work!");
}
@@ -183,9 +187,11 @@
toolbar.getChildren().add(command);
command.setId("button" + i);
command.getAttributes().put(ATTR_ACTION_STRING, commands[i].getCommand());
- if (handler != null) {
- command.addActionListener(handler);
+
+ for (ActionListener listener : getActionListeners()) {
+ command.addActionListener(listener);
}
+ command.setActionListener(getActionListener());
command.getAttributes().put(
ATTR_IMAGE, "image/tobago.tree." + commands[i].getCommand() + ".gif");
String title = ResourceManagerUtil.getPropertyNotNull(facesContext, "tobago",
@@ -340,14 +346,14 @@
public Object saveState(FacesContext context) {
Object[] state = new Object[2];
state[0] = super.saveState(context);
- state[1] = actionListener;
+ state[1] = saveAttachedState(context, actionListener);
return state;
}
public void restoreState(FacesContext context, Object state) {
Object[] values = (Object[]) state;
super.restoreState(context, values[0]);
- actionListener = (ActionListener) values[1];
+ actionListener = (MethodBinding) restoreAttachedState(context, values[1]);
}
// ------------------------------------------------------------ getter + setter
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/DefaultTreeActionListener.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/DefaultTreeActionListener.java?rev=369949&r1=369948&r2=369949&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/DefaultTreeActionListener.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/DefaultTreeActionListener.java Tue Jan 17 14:45:55 2006
@@ -37,16 +37,8 @@
public class DefaultTreeActionListener implements ActionListener {
-// ///////////////////////////////////////////// constant
-
private static final Log LOG = LogFactory.getLog(DefaultTreeActionListener.class);
-// ///////////////////////////////////////////// attribute
-
-// ///////////////////////////////////////////// constructor
-
-// ///////////////////////////////////////////// code
-
protected DefaultMutableTreeNode create(FacesContext facesContext) {
String label = ResourceManagerUtil.getPropertyNotNull(facesContext, "tobago", "treeNodeNew");
return new DefaultMutableTreeNode(label);
@@ -133,7 +125,4 @@
}
}
}
-
-// ///////////////////////////////////////////// bean getter + setter
-
}
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/model/SheetState.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/model/SheetState.java?rev=369949&r1=369948&r2=369949&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/model/SheetState.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/model/SheetState.java Tue Jan 17 14:45:55 2006
@@ -24,8 +24,9 @@
import java.util.ArrayList;
import java.util.List;
-
-public class SheetState {
+import java.io.Serializable;
+// TODO find a better solution for this
+public class SheetState implements Serializable {
private static final Log LOG = LogFactory.getLog(SheetState.class);
public static final String SEPARATOR = ",";
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/taglib/component/CommandTag.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/taglib/component/CommandTag.java?rev=369949&r1=369948&r2=369949&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/taglib/component/CommandTag.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/taglib/component/CommandTag.java Tue Jan 17 14:45:55 2006
@@ -12,8 +12,7 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
-/*
+ *
* $Id$
*/
package org.apache.myfaces.tobago.taglib.component;
@@ -91,5 +90,4 @@
public void setDisabled(String disabled) {
this.disabled = disabled;
}
-}
-
+}
\ No newline at end of file
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/taglib/component/InTag.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/taglib/component/InTag.java?rev=369949&r1=369948&r2=369949&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/taglib/component/InTag.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/taglib/component/InTag.java Tue Jan 17 14:45:55 2006
@@ -25,12 +25,6 @@
import org.apache.myfaces.tobago.component.ComponentUtil;
import javax.faces.component.UIComponent;
-import javax.faces.webapp.UIComponentTag;
-import javax.faces.context.FacesContext;
-import javax.faces.el.MethodBinding;
-
-import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
-import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
public class InTag extends TextInputTag implements InTagDeclaration {
@@ -56,19 +50,7 @@
}
ComponentUtil.setBooleanProperty(component, ATTR_PASSWORD, password);
- setSuggestMethodBinding(component, suggestMethod);
- }
-
- private void setSuggestMethodBinding(UIComponent component, String suggestMethod) {
- if (suggestMethod != null) {
- if (UIComponentTag.isValueReference(suggestMethod)) {
- final MethodBinding methodBinding = FacesContext.getCurrentInstance().getApplication()
- .createMethodBinding(suggestMethod, new Class[]{String.class});
- component.getAttributes().put("suggestMethod", methodBinding);
- } else {
- component.getAttributes().put("suggestMethod", suggestMethod);
- }
- }
+ ComponentUtil.setSuggestMethodBinding(component, suggestMethod);
}
public String getPassword() {
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/taglib/component/TreeTag.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/taglib/component/TreeTag.java?rev=369949&r1=369948&r2=369949&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/taglib/component/TreeTag.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/taglib/component/TreeTag.java Tue Jan 17 14:45:55 2006
@@ -33,8 +33,10 @@
import org.apache.myfaces.tobago.taglib.decl.HasState;
import org.apache.myfaces.tobago.taglib.decl.HasTreeNodeValue;
import org.apache.myfaces.tobago.taglib.decl.IsRequired;
+import org.apache.myfaces.tobago.taglib.decl.HasActionListener;
import javax.faces.component.UIComponent;
+import javax.faces.component.ActionSource;
/**
* Renders a tree view.
@@ -44,7 +46,7 @@
@Preliminary("Implement a var attribute for the tree like in the sheet (http://issues.apache.org/jira/browse/MYFACES-903)")
public class TreeTag extends TobagoTag
implements HasIdBindingAndRendered, HasTreeNodeValue, HasState,
- HasIdReference, HasNameReference, IsRequired {
+ HasIdReference, HasActionListener, HasNameReference, IsRequired {
private String value;
private String state;
@@ -62,6 +64,8 @@
private String required;
+ private String actionListener;
+
public String getComponentType() {
return UITree.COMPONENT_TYPE;
}
@@ -83,6 +87,7 @@
ComponentUtil.setStringProperty(component, ATTR_ID_REFERENCE, idReference);
ComponentUtil.setStringProperty(component, ATTR_NAME_REFERENCE, nameReference);
ComponentUtil.setBooleanProperty(component, ATTR_REQUIRED, required);
+ ComponentUtil.setActionListener((ActionSource)component, actionListener);
}
public void release() {
@@ -98,6 +103,7 @@
idReference = null;
nameReference = null;
required = null;
+ actionListener = null;
}
public String getValue() {
@@ -120,7 +126,12 @@
return showIcons;
}
-
+ public void setActionListener(String actionListener) {
+ this.actionListener = actionListener;
+ }
+ public String getActionListener() {
+ return actionListener;
+ }
/**
*
*/
Modified: incubator/tobago/trunk/tobago-example/tobago-example-demo/pom.xml
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-example/tobago-example-demo/pom.xml?rev=369949&r1=369948&r2=369949&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-example/tobago-example-demo/pom.xml (original)
+++ incubator/tobago/trunk/tobago-example/tobago-example-demo/pom.xml Tue Jan 17 14:45:55 2006
@@ -16,8 +16,9 @@
* limitations under the License.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.myfaces.tobago</groupId>
Modified: incubator/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/actionlistener/TreeEditor.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/actionlistener/TreeEditor.java?rev=369949&r1=369948&r2=369949&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/actionlistener/TreeEditor.java (original)
+++ incubator/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/actionlistener/TreeEditor.java Tue Jan 17 14:45:55 2006
@@ -30,14 +30,6 @@
public class TreeEditor extends DefaultTreeActionListener {
-// ///////////////////////////////////////////// constant
-
-// ///////////////////////////////////////////// attribute
-
-// ///////////////////////////////////////////// constructor
-
-// ///////////////////////////////////////////// code
-
protected String nextId() {
return "m" + System.currentTimeMillis();
}
@@ -56,13 +48,9 @@
}
public void processAction(ActionEvent event) throws AbortProcessingException {
-
super.processAction(event);
-
FacesContext facesContext = FacesContext.getCurrentInstance();
facesContext.renderResponse();
}
-
-// ///////////////////////////////////////////// bean getter + setter
}
Modified: incubator/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/InRenderer.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/InRenderer.java?rev=369949&r1=369948&r2=369949&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/InRenderer.java (original)
+++ incubator/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/InRenderer.java Tue Jan 17 14:45:55 2006
@@ -75,8 +75,11 @@
ATTR_PASSWORD) ? "password" : "text";
// Todo: check for valid binding
- boolean renderAjaxSuggest
- = input.getAttributes().get("suggestMethod") != null;
+ boolean renderAjaxSuggest = false;
+ if (input instanceof org.apache.myfaces.tobago.component.UIInput) {
+ renderAjaxSuggest =
+ ((org.apache.myfaces.tobago.component.UIInput)input).getSuggestMethod() != null;
+ }
String onchange = HtmlUtils.generateOnchange(input, facesContext);
@@ -187,13 +190,15 @@
public void encodeAjax(FacesContext context, UIComponent uiComponent) throws IOException
{
- AjaxUtils.checkParamValidity(context, uiComponent, UIInput.class);
+ AjaxUtils.checkParamValidity(context, uiComponent,
+ org.apache.myfaces.tobago.component.UIInput.class);
- UIInput input = (UIInput) uiComponent;
+ org.apache.myfaces.tobago.component.UIInput input =
+ (org.apache.myfaces.tobago.component.UIInput) uiComponent;
MethodBinding mb;
- Object o = input.getAttributes().get("suggestMethod");
+ Object o = input.getSuggestMethod();
if (o instanceof MethodBinding) {
mb = (MethodBinding) o;
} else {