Modified: 
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/spec/IEventListener.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/spec/IEventListener.java?view=diff&rev=533285&r1=533284&r2=533285
==============================================================================
--- 
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/spec/IEventListener.java
 (original)
+++ 
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/spec/IEventListener.java
 Fri Apr 27 20:36:03 2007
@@ -25,7 +25,6 @@
  * Specification for something that can listen to and act on client side 
generated
  * browser events.
  *
- * @author jkuhnert
  */
 public interface IEventListener
 {
@@ -39,20 +38,37 @@
      * @param methodName
      *          The page/component listener name that should be executed when
      *          one of the supplied events occurs.
+     * @param formId
+     *          The optional id of the form that should be submitted as part 
of this event invocation.
+     * @param validateForm
+     *          If a formId was specified, whether or not that form should 
have client side valiation
+     *          invoked during the process.
      * @param async 
      *          If submitting a form, whether or not to do it asynchronously.
      * @param focus
      *          If submitting a form, controls whether or not to focus it 
after an update.
+     * @param autoSubmit
+     *          If true - auto form wiring is performed on any component 
targets implementing [EMAIL PROTECTED] org.apache.tapestry.form.IFormComponent} 
so
+     *          that the enclosing form is submitted as part of the event in 
order to maintain consistent form state as in normal listener method
+     *          invocations.
      */
-    void addEventListener(String componentId, String[] events, 
-            String methodName, String formId, boolean validateForm, boolean 
async, boolean focus, boolean autoSubmit);
+    void addEventListener(String componentId, String[] events, String 
methodName,
+                          String formId, boolean validateForm, boolean async, 
boolean focus, boolean autoSubmit);
     
     /**
      * Adds a deferred event listener binding for the specified html element.
      * 
      * @param elementId
+     *          The client side html element id to match against.
      * @param events
+     *          The client side events to bind to.
      * @param methodName
+     *          The listener that should be invoked when the event happens.
+     * @param formId
+     *          The optional id of the form that should be submitted as part 
of this event invocation.
+     * @param validateForm
+     *          If a formId was specified, whether or not that form should 
have client side valiation
+     *          invoked during the process.
      * @param async 
      *          If submitting a form, whether or not to do it asynchronously.
      * @param focus
@@ -62,7 +78,7 @@
             String methodName, String formId, boolean validateForm, boolean 
async, boolean focus);
 
     /**
-     * Invoked during rendering when a component has been detected as a [EMAIL 
PROTECTED] org.apache.tapestry.form.IFormComponent} and maye
+     * Invoked during rendering when a component has been detected as a [EMAIL 
PROTECTED] org.apache.tapestry.form.IFormComponent} and may
      * possibly need its events to be wired up as form events.
      *
      * @param componentId The components standard base id.
@@ -113,4 +129,37 @@
      * @return Mapped elements events, if any.
      */
     Map getElementEvents();
+
+    /**
+     * Gets all component event mappings.
+     *
+     * @return Map of component [EMAIL PROTECTED] ComponentEventProperty} 
values this component is listening to.
+     */
+    Map getComponentEvents();
+
+    /**
+     * Invoked during page load to map event connections previously made via 
the [EMAIL PROTECTED] org.apache.tapestry.IComponent#getId()} identifier
+     * to use the more unique [EMAIL PROTECTED] 
org.apache.tapestry.IComponent#getIdPath()}.
+     *
+     * @param componentId
+     *          The basic component id.
+     * @param idPath
+     *          The id of the component pre-pended with the path of components 
containing it.
+     */
+    void rewireComponentId(String componentId, String idPath);
+
+    /**
+     * Used during page load to test if this event listener has already had 
its component / form target
+     * id paths resolved.
+     *
+     * @return True if connections have been resolved, false otherwise.
+     */
+    boolean getTargetsResolved();
+
+    /**
+     * Sets the resolved state to that found, ie what is returned by [EMAIL 
PROTECTED] #getTargetsResolved()}.
+     *
+     * @param resolved The resolution state.
+     */
+    void setTargetsResolved(boolean resolved);
 }

Modified: 
tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/internal/event/ComponentEventPropertyTest.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/internal/event/ComponentEventPropertyTest.java?view=diff&rev=533285&r1=533284&r2=533285
==============================================================================
--- 
tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/internal/event/ComponentEventPropertyTest.java
 (original)
+++ 
tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/internal/event/ComponentEventPropertyTest.java
 Fri Apr 27 20:36:03 2007
@@ -17,6 +17,7 @@
 import org.apache.tapestry.event.BrowserEvent;
 import org.testng.annotations.Test;
 
+import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 
@@ -166,5 +167,50 @@
         assertEquals(listener.getComponentId(), "compid");
         assertEquals(listener.getFormId(), "form");
         assertEquals(listener.getMethodName(), "doFoo");
+    }
+
+    public void test_ReWire_Component_Id()
+    {
+        String[] events = {"onClick", "onFoo"};
+        ComponentEventProperty prop = new ComponentEventProperty("compid");
+
+        prop.addListener(events, "doFoo", null, false, false, false);
+        prop.addListener(new String[]{"onchange"}, "doBar", "form2", false, 
false, false);
+        prop.addListener(new String[]{"onchange"}, "secondForm", "form1", 
false, false, false);
+        
+        assertEquals("compid", prop.getComponentId());
+        assertEquals(prop.getEvents().size(), 2);
+        assertEquals(prop.getFormEvents().size(), 1);
+
+        String path = "new/Path/Id";
+        prop.rewireComponentId(path);
+
+        assertEquals(prop.getComponentId(), path);
+
+        Iterator it = prop.getEvents().iterator();
+        while (it.hasNext())
+        {
+            String key = (String) it.next();
+
+            List listeners = prop.getEventListeners(key);
+            for (int i=0; i < listeners.size(); i++) {
+
+                EventBoundListener listener = (EventBoundListener) 
listeners.get(i);
+                assertEquals(listener.getComponentId(), path);
+            }
+        }
+
+        it = prop.getFormEvents().iterator();
+        while (it.hasNext())
+        {
+            String key = (String) it.next();
+
+            List listeners = prop.getFormEventListeners(key);
+            for (int i=0; i < listeners.size(); i++) {
+
+                EventBoundListener listener = (EventBoundListener) 
listeners.get(i);
+                assertEquals(listener.getComponentId(), path);
+            }
+        }
     }
 }

Modified: 
tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/internal/event/impl/ComponentEventInvokerTest.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/internal/event/impl/ComponentEventInvokerTest.java?view=diff&rev=533285&r1=533284&r2=533285
==============================================================================
--- 
tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/internal/event/impl/ComponentEventInvokerTest.java
 (original)
+++ 
tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/internal/event/impl/ComponentEventInvokerTest.java
 Fri Apr 27 20:36:03 2007
@@ -17,7 +17,6 @@
 import org.apache.tapestry.event.BrowserEvent;
 import org.apache.tapestry.event.EventTarget;
 import org.apache.tapestry.form.FormSupport;
-import org.apache.tapestry.form.IFormComponent;
 import org.apache.tapestry.internal.event.ComponentEventProperty;
 import org.apache.tapestry.listener.ListenerInvoker;
 import org.apache.tapestry.listener.ListenerMap;
@@ -74,62 +73,6 @@
         assertEquals(p.getFormEvents().size(), 1);
     }
 
-     public void test_Connect_Auto_Submit_Events()
-    {
-        IForm form = newMock(IForm.class);
-        checkOrder(form, false);
-        
-        IFormComponent formComponent = newMock(IFormComponent.class);
-        checkOrder(formComponent, false);
-        
-        ComponentEventInvoker invoker = new ComponentEventInvoker();
-        
-        IComponentSpecification spec = new ComponentSpecification();
-        spec.addEventListener("comp1", new String[] {"onClick"}, "testFoo", 
null, false, true, false, true);
-        spec.addEventListener("comp1", new String[] {"onClick"}, "testBar", 
null, false, true, false, true);
-
-        assert spec.getComponentEvents("comp1") != null;
-
-        ComponentEventProperty p = spec.getComponentEvents("comp1");
-
-        // should be only form events bound
-        
-        assertEquals(p.getEvents().size(), 1);
-        assertEquals(p.getEventListeners("onClick").size(), 2);
-
-        assertEquals(p.getComponentId(), "comp1");
-        assertEquals(p.getFormEventListeners("onClick").size(), 0);
-        assertEquals(p.getFormEvents().size(), 1);
-
-        // now re-connect with form
-
-        expect(formComponent.getForm()).andReturn(form);
-
-        expect(form.getId()).andReturn("form").anyTimes();
-        
-        expect(formComponent.getId()).andReturn("comp1").anyTimes();
-
-        replay();
-
-        invoker.addEventListener("comp1", spec);
-
-        invoker.connectAutoSubmitEvents(formComponent);
-
-        verify();
-
-        assertEquals(invoker.getEventListeners("comp1").size(), 1);
-        assertEquals(invoker.getFormEventListeners("form").size(), 1);
-
-        assertEquals(p.getEvents().size(), 0);
-        assertEquals(p.getEventListeners("onClick").size(), 0);
-
-        assertEquals(p.getComponentId(), "comp1");
-        assertEquals(p.getFormEventListeners("onClick").size(), 2);
-        assertEquals(p.getFormEvents().size(), 1);
-
-        assertEquals(invoker.getPreviouslyMappedFormId("comp1"), "form");
-    }
-
     public void test_Invoke_Component_Listener()
     {
         IRequestCycle cycle = newCycle();
@@ -157,15 +100,12 @@
         spec.addEventListener("testId", new String[] { "onSelect" }, 
                 "fooListener", null, false, false, false, false);
         invoker.addEventListener("testId", spec);
-        
-        expect(comp.getId()).andReturn("testId").anyTimes();
-        
+
+        expect(comp.getIdPath()).andReturn("testId").anyTimes();
         expect(comp.getSpecification()).andReturn(spec).anyTimes();
-        
         expect(comp.getPage()).andReturn(page);
-        
+
         expect(page.getComponents()).andReturn(comps);
-        
         expect(comp.getListeners()).andReturn(listenerMap);
         
         expect(listenerMap.getListener("fooListener")).andReturn(listener1);
@@ -206,14 +146,10 @@
                 "fooListener", null, false, true, true);
         invoker.addEventListener("testId", spec);
         
-        expect(comp.getId()).andReturn("testId").anyTimes();
-        
+        expect(comp.getIdPath()).andReturn("testId").anyTimes();
         expect(comp.getSpecification()).andReturn(spec).anyTimes();
-        
         expect(comp.getPage()).andReturn(page);
-        
         expect(page.getComponents()).andReturn(comps);
-        
         expect(comp.getListeners()).andReturn(listenerMap);
         
         expect(listenerMap.getListener("fooListener")).andReturn(listener);
@@ -256,15 +192,12 @@
         invoker.addFormEventListener("form1", spec);
         
         expect(formSupport.getForm()).andReturn(form);
-        
-        expect(form.getId()).andReturn("form1").anyTimes();
-        
+        expect(form.getIdPath()).andReturn("form1").anyTimes();
         expect(form.getPage()).andReturn(page);
-        
+
         expect(page.getComponents()).andReturn(comps);
         
         expect(form.getSpecification()).andReturn(spec);
-        
         expect(form.getListeners()).andReturn(listenerMap);
         
         expect(listenerMap.getListener("fooListener")).andReturn(listener);
@@ -309,15 +242,12 @@
         invoker.addFormEventListener("form1", spec);
         
         expect(formSupport.getForm()).andReturn(form);
-        
-        expect(form.getId()).andReturn("form1").anyTimes();
-        
+        expect(form.getIdPath()).andReturn("form1").anyTimes();
         expect(form.getPage()).andReturn(page);
         
         expect(page.getComponents()).andReturn(comps);
         
         expect(form.getSpecification()).andReturn(spec);
-        
         expect(form.getListeners()).andReturn(listenerMap);
         
         expect(listenerMap.getListener("fooListener")).andReturn(listener);

Added: 
tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/pageload/TestEventConnectionVisitor.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/pageload/TestEventConnectionVisitor.java?view=auto&rev=533285
==============================================================================
--- 
tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/pageload/TestEventConnectionVisitor.java
 (added)
+++ 
tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/pageload/TestEventConnectionVisitor.java
 Fri Apr 27 20:36:03 2007
@@ -0,0 +1,141 @@
+package org.apache.tapestry.pageload;
+
+import org.apache.hivemind.ApplicationRuntimeException;
+import org.apache.hivemind.Location;
+import org.apache.tapestry.BaseComponentTestCase;
+import org.apache.tapestry.IComponent;
+import org.apache.tapestry.IPage;
+import org.apache.tapestry.internal.event.ComponentEventProperty;
+import org.apache.tapestry.internal.event.IComponentEventInvoker;
+import org.apache.tapestry.spec.ComponentSpecification;
+import org.apache.tapestry.spec.IComponentSpecification;
+import static org.easymock.EasyMock.checkOrder;
+import static org.easymock.EasyMock.expect;
+import org.testng.annotations.Test;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Tests functionality of [EMAIL PROTECTED] EventConnectionVisitor}.
+ */
[EMAIL PROTECTED]
+public class TestEventConnectionVisitor extends BaseComponentTestCase {
+
+    public void test_Targets_Resolved()
+    {
+        IComponentSpecification spec = new ComponentSpecification();
+        spec.setTargetsResolved(true);
+        
+        IComponent comp = newComponent(spec);
+
+        replay();
+
+        new EventConnectionVisitor().visitComponent(comp);
+
+        verify();
+    }
+
+    public void test_Wire_Component_Event()
+    {
+        IComponentSpecification spec = new ComponentSpecification();
+        spec.addEventListener("comp1", new String[] {"onClick"}, "testFoo", 
null, false, false, false, false);
+
+        IComponent comp = newComponent(spec, "comp1", "path/");
+        IComponentEventInvoker invoker = newMock(IComponentEventInvoker.class);
+
+        invoker.addEventListener("path/comp1", spec);
+
+        replay();
+
+        EventConnectionVisitor v = new EventConnectionVisitor();
+        v.setEventInvoker(invoker);
+
+        v.visitComponent(comp);
+
+        verify();
+    }
+
+    @Test(expectedExceptions = ApplicationRuntimeException.class)
+    public void test_Component_Not_Found()
+    {
+        IComponentSpecification spec = new ComponentSpecification();
+        spec.addEventListener("comp1", new String[] {"onClick"}, "testFoo", 
null, false, false, false, false);
+
+        IComponent comp = newComponent(spec, "comp2");
+        Location l = newLocation();
+
+        expect(comp.getLocation()).andReturn(l);
+
+        replay();
+
+        new EventConnectionVisitor().visitComponent(comp);
+
+        verify();
+    }
+
+    public void test_Spec_Rewire_Id()
+    {
+        IComponentSpecification spec = newMock(IComponentSpecification.class);
+        IComponentEventInvoker invoker = newMock(IComponentEventInvoker.class);
+        IComponent comp = newComponent(spec, "comp1", "path/");
+
+        ComponentEventProperty p = new ComponentEventProperty("comp1");
+        p.addListener(new String[] {"onClick"}, "testFoo", null, false, false, 
false, false);
+
+        Map compEvents = new HashMap();
+        compEvents.put("comp1", p);
+
+        expect(spec.getTargetsResolved()).andReturn(false);
+        expect(spec.getComponentEvents()).andReturn(compEvents);
+        expect(spec.getElementEvents()).andReturn(Collections.EMPTY_MAP);
+
+        invoker.addEventListener("path/comp1", spec);
+
+        spec.rewireComponentId("comp1", "path/comp1");
+        spec.setTargetsResolved(true);
+
+        replay();
+
+        EventConnectionVisitor v = new EventConnectionVisitor();
+        v.setEventInvoker(invoker);
+
+        v.visitComponent(comp);
+
+        verify();
+    }
+
+    
+
+    IComponent newComponent(IComponentSpecification spec, String findCompId, 
Object... args)
+    {
+        IComponent comp = newComponent(spec);
+        IPage page = newMock(IPage.class);
+
+        expect(comp.getPage()).andReturn(page);
+
+        Map comps = new HashMap();
+        comps.put(findCompId, comp);
+
+        expect(page.getComponents()).andReturn(comps).anyTimes();
+        expect(comp.getComponents()).andReturn(null).anyTimes();
+
+        if (args.length > 0) {
+        
+            expect(comp.getIdPath()).andReturn(args[0] + 
findCompId).anyTimes();
+        }
+
+        return comp;
+    }
+
+    IComponent newComponent(IComponentSpecification spec)
+    {
+        IComponent comp = newMock(IComponent.class);
+
+        checkOrder(comp, false);
+        expect(comp.getSpecification()).andReturn(spec).anyTimes();
+
+        return comp;
+    }
+}

Propchange: 
tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/pageload/TestEventConnectionVisitor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: 
tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/services/impl/ComponentEventConnectionWorkerTest.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/services/impl/ComponentEventConnectionWorkerTest.java?view=diff&rev=533285&r1=533284&r2=533285
==============================================================================
--- 
tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/services/impl/ComponentEventConnectionWorkerTest.java
 (original)
+++ 
tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/services/impl/ComponentEventConnectionWorkerTest.java
 Fri Apr 27 20:36:03 2007
@@ -122,28 +122,23 @@
         ////////////////////////////////////////////
         
         expect(cycle.isRewinding()).andReturn(false);
-        
         
expect(cycle.getAttribute(TapestryUtils.FIELD_PRERENDER)).andReturn(null);
         
-        expect(component.getId()).andReturn("comp1").anyTimes();
+        expect(component.getIdPath()).andReturn("comp1").anyTimes();
         expect(component.getClientId()).andReturn("comp1").anyTimes();
         
-        expect(cycle.getAttribute(TapestryUtils.PAGE_RENDER_SUPPORT_ATTRIBUTE))
-        .andReturn(prs).anyTimes();
-        
+        
expect(cycle.getAttribute(TapestryUtils.PAGE_RENDER_SUPPORT_ATTRIBUTE)).andReturn(prs).anyTimes();
         expect(component.getSpecification()).andReturn(spec);
         
         trainGetLinkCheckIgnoreParameter(engine, cycle, false, new Object(), 
link);
         trainGetURL(link, "/some/url");
         
         expect(scriptSource.getScript(compScriptResource)).andReturn(script);
-        
         script.execute(eq(component), eq(cycle), eq(prs), isA(Map.class));
         
         expect(component.getSpecification()).andReturn(spec);
         
         trainGetLinkCheckIgnoreParameter(engine, cycle, false, new Object(), 
link);
-        
         trainGetURL(link, "/some/url");
         
         expect(scriptSource.getScript(elemScriptResource)).andReturn(script);
@@ -165,15 +160,13 @@
         
         checkOrder(cycle, false);
         expect(cycle.isRewinding()).andReturn(false);
-        
-        expect(cycle.getAttribute(TapestryUtils.PAGE_RENDER_SUPPORT_ATTRIBUTE))
-        .andReturn(prs).anyTimes();
+        
expect(cycle.getAttribute(TapestryUtils.PAGE_RENDER_SUPPORT_ATTRIBUTE)).andReturn(prs).anyTimes();
         
         expect(widget.getSpecification()).andReturn(widgetSpec);
         
         
expect(cycle.getAttribute(TapestryUtils.FIELD_PRERENDER)).andReturn(null);
         
-        expect(widget.getId()).andReturn("wid1").anyTimes();
+        expect(widget.getIdPath()).andReturn("wid1").anyTimes();
         expect(widget.getClientId()).andReturn("wid1").anyTimes();
         
         assert widgetSpec.getComponentEvents("wid1") != null;
@@ -257,12 +250,10 @@
         // render of comp1
         
         expect(cycle.isRewinding()).andReturn(false);
-        
         
expect(cycle.getAttribute(TapestryUtils.PAGE_RENDER_SUPPORT_ATTRIBUTE)).andReturn(prs);
-        
         
expect(cycle.getAttribute(TapestryUtils.FIELD_PRERENDER)).andReturn(null);
         
-        expect(comp1.getId()).andReturn("comp1").anyTimes();
+        expect(comp1.getIdPath()).andReturn("comp1").anyTimes();
         expect(comp1.getClientId()).andReturn("comp1").anyTimes();
         
         
expect(cycle.getAttribute(ComponentEventConnectionWorker.FORM_NAME_LIST + 
"form1")).andReturn(null);
@@ -272,12 +263,10 @@
         // render of comp2
         
         expect(cycle.isRewinding()).andReturn(false);
-        
         
expect(cycle.getAttribute(TapestryUtils.PAGE_RENDER_SUPPORT_ATTRIBUTE)).andReturn(prs);
-        
         
expect(cycle.getAttribute(TapestryUtils.FIELD_PRERENDER)).andReturn(null);
         
-        expect(comp2.getId()).andReturn("comp2").anyTimes();
+        expect(comp2.getIdPath()).andReturn("comp2").anyTimes();
         expect(comp2.getClientId()).andReturn("comp2").anyTimes();
         
         
expect(cycle.getAttribute(ComponentEventConnectionWorker.FORM_NAME_LIST + 
"form1")).andReturn(null);
@@ -287,13 +276,10 @@
         // render of component
         
         expect(cycle.isRewinding()).andReturn(false);
-        
         
expect(cycle.getAttribute(TapestryUtils.PAGE_RENDER_SUPPORT_ATTRIBUTE)).andReturn(prs);
-        
         
expect(cycle.getAttribute(TapestryUtils.FIELD_PRERENDER)).andReturn(null);
         
-        expect(component.getId()).andReturn("comp").anyTimes();
-        
+        expect(component.getIdPath()).andReturn("comp").anyTimes();
         expect(component.getSpecification()).andReturn(spec);
         
         replay();
@@ -399,25 +385,20 @@
         invoker.addFormEventListener("form1", spec);
         
         expect(cycle.isRewinding()).andReturn(false);
-        
         
expect(cycle.getAttribute(TapestryUtils.PAGE_RENDER_SUPPORT_ATTRIBUTE)).andReturn(prs);
-        
         
expect(cycle.getAttribute(TapestryUtils.FIELD_PRERENDER)).andReturn(null);
         
-        expect(component.getId()).andReturn("compListener").anyTimes();
+        expect(component.getIdPath()).andReturn("compListener").anyTimes();
         expect(component.getClientId()).andReturn("compListener").anyTimes();
-        
         expect(component.getSpecification()).andReturn(spec);
         
         // comp1 render
         
         expect(cycle.isRewinding()).andReturn(false);
-        
         
expect(cycle.getAttribute(TapestryUtils.PAGE_RENDER_SUPPORT_ATTRIBUTE)).andReturn(prs);
-        
         
expect(cycle.getAttribute(TapestryUtils.FIELD_PRERENDER)).andReturn(null);
         
-        expect(comp1.getId()).andReturn("comp1").anyTimes();
+        expect(comp1.getIdPath()).andReturn("comp1").anyTimes();
         expect(comp1.getClientId()).andReturn("comp1").anyTimes();
         
         
expect(cycle.getAttribute(ComponentEventConnectionWorker.FORM_NAME_LIST + 
"form1")).andReturn(null);
@@ -427,12 +408,10 @@
         // comp2 render
         
         expect(cycle.isRewinding()).andReturn(false);
-        
         
expect(cycle.getAttribute(TapestryUtils.PAGE_RENDER_SUPPORT_ATTRIBUTE)).andReturn(prs);
-        
         
expect(cycle.getAttribute(TapestryUtils.FIELD_PRERENDER)).andReturn(null);
         
-        expect(comp2.getId()).andReturn("comp2").anyTimes();
+        expect(comp2.getIdPath()).andReturn("comp2").anyTimes();
         expect(comp2.getClientId()).andReturn("comp2").anyTimes();
         
         
expect(cycle.getAttribute(ComponentEventConnectionWorker.FORM_NAME_LIST + 
"form1")).andReturn(null);
@@ -456,42 +435,35 @@
         checkOrder(comp2, false);
         
         expect(cycle.isRewinding()).andReturn(false);
-        
         
expect(cycle.getAttribute(TapestryUtils.PAGE_RENDER_SUPPORT_ATTRIBUTE)).andReturn(prs);
         
         expect(form.getSpecification()).andReturn(formSpec);
         
         
expect(cycle.getAttribute(TapestryUtils.FIELD_PRERENDER)).andReturn(null);
         
-        expect(form.getId()).andReturn("form1").anyTimes();
+        expect(form.getIdPath()).andReturn("form1").anyTimes();
         
         
expect(cycle.getAttribute(ComponentEventConnectionWorker.FORM_NAME_LIST + 
"form1")).andReturn(null);
-        
         cycle.setAttribute(eq(ComponentEventConnectionWorker.FORM_NAME_LIST + 
"form1"), isA(List.class));
         
         expect(form.getName()).andReturn("form1_0").anyTimes();
-        
+
         expect(comp1.getSpecification()).andReturn(comp1Spec);
-        
-        expect(comp1.getId()).andReturn("comp1").anyTimes();
+        expect(comp1.getIdPath()).andReturn("comp1").anyTimes();
         
         expect(comp2.getSpecification()).andReturn(comp2Spec);
-        
-        expect(comp2.getId()).andReturn("comp2").anyTimes();
+        expect(comp2.getIdPath()).andReturn("comp2").anyTimes();
         
         List formNames = new ArrayList();
         formNames.add("form1_0");
         
         
expect(cycle.getAttribute(ComponentEventConnectionWorker.FORM_NAME_LIST + 
"form1")).andReturn(formNames).anyTimes();
-        
         
expect(cycle.getAttribute(TapestryUtils.PAGE_RENDER_SUPPORT_ATTRIBUTE)).andReturn(prs).anyTimes();
         
         expect(scriptSource.getScript(compScriptResource)).andReturn(script);
-        
         script.execute(eq(form), eq(cycle), eq(prs), isA(Map.class));
         
         expect(scriptSource.getScript(compScriptResource)).andReturn(script);
-        
         script.execute(eq(form), eq(cycle), eq(prs), isA(Map.class));
         
         replay();
@@ -520,6 +492,7 @@
         
         IDirectEvent component = newMock(IDirectEvent.class);
         IWidget widget = newMock(IWidget.class);
+        
         MockControl bodyControl = MockClassControl.createControl(Body.class);
         Body body = (Body) bodyControl.getMock();
         


Reply via email to