Author: jcompagner
Date: Wed Aug  1 03:30:47 2007
New Revision: 561756

URL: http://svn.apache.org/viewvc?view=rev&rev=561756
Log:
domready events should go in the same order as added

added test for domready

also ajax header contributions seems to go multiply times (still wrong in this 
test!)

Added:
    
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContribution.html
   (with props)
    
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContribution.java
   (with props)
    
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage.html
   (with props)
    
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage.java
   (with props)
    
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage_ajax_expected.html
   (with props)
    
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage_expected.html
   (with props)
    
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionTest.java
   (with props)
    
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/DomReadyOrderPage.html
   (with props)
    
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/DomReadyOrderPage.java
   (with props)
    
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/DomReadyOrderPage_ajax_expected.html
   (with props)
    
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/DomReadyOrderPage_expected.html
   (with props)
    
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/DomReadyOrderTest.java
   (with props)
Modified:
    
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/AjaxRequestTarget.java

Modified: 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/AjaxRequestTarget.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/AjaxRequestTarget.java?view=diff&rev=561756&r1=561755&r2=561756
==============================================================================
--- 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/AjaxRequestTarget.java
 (original)
+++ 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/AjaxRequestTarget.java
 Wed Aug  1 03:30:47 2007
@@ -232,6 +232,8 @@
 
        private final List/* <String> */appendJavascripts = new ArrayList();
 
+       private final List/* <String> */domReadyJavascripts = new ArrayList();
+
        /**
         * Create a response for component body and javascript that will escape
         * output to make it safe to use inside a CDATA block
@@ -521,6 +523,14 @@
 
                fireOnAfterRespondListeners(response);
 
+               // execute the dom ready javascripts as first javascripts
+               // after component replacement
+               it = domReadyJavascripts.iterator();
+               while (it.hasNext())
+               {
+                       String js = (String)it.next();
+                       respondInvocation(response, js);
+               }
                it = appendJavascripts.iterator();
                while (it.hasNext())
                {
@@ -864,9 +874,7 @@
                        List token = Arrays.asList(new Object[] { 
"javascript-event", "domready", javascript });
                        if (wasRendered(token) == false)
                        {
-                               // execute the javascript as first javascript 
after component
-                               // replacement
-                               appendJavascripts.add(0, javascript);
+                               domReadyJavascripts.add(javascript);
                                markRendered(token);
                        }
                }

Added: 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContribution.html
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContribution.html?view=auto&rev=561756
==============================================================================
--- 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContribution.html
 (added)
+++ 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContribution.html
 Wed Aug  1 03:30:47 2007
@@ -0,0 +1,12 @@
+<html>
+<head>
+<wicket:head>
+<link href="test"/>
+</wicket:head>
+</head>
+<body>
+<wicket:panel>
+test
+</wicket:panel>
+</body>
+</html>
\ No newline at end of file

Propchange: 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContribution.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContribution.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContribution.java?view=auto&rev=561756
==============================================================================
--- 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContribution.java
 (added)
+++ 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContribution.java
 Wed Aug  1 03:30:47 2007
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ */
+package org.apache.wicket.ajax;
+
+import org.apache.wicket.markup.html.internal.HtmlHeaderContainer;
+import org.apache.wicket.markup.html.panel.Panel;
+
+class AjaxHeaderContribution extends Panel
+{
+       private static final long serialVersionUID = 1L;
+
+       /**
+        * Construct.
+        * 
+        * @param id
+        */
+       public AjaxHeaderContribution(String id)
+       {
+               super(id);
+       }
+
+       public void renderHead(HtmlHeaderContainer container)
+       {
+               super.renderHead(container);
+
+               
container.getHeaderResponse().renderJavascriptReference("javascripturl");
+               
container.getHeaderResponse().renderOnDomReadyJavascript("domReady();");
+               
container.getHeaderResponse().renderOnLoadJavascript("onLoad();");
+       }
+}
\ No newline at end of file

Propchange: 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContribution.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage.html
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage.html?view=auto&rev=561756
==============================================================================
--- 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage.html
 (added)
+++ 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage.html
 Wed Aug  1 03:30:47 2007
@@ -0,0 +1,8 @@
+<html>
+<body>
+<span wicket:id="test1"></span>
+<span wicket:id="test2"></span>
+<span wicket:id="test3"></span>
+<a href="#" wicket:id="link">Test</a>
+</body>
+</html>
\ No newline at end of file

Propchange: 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage.java?view=auto&rev=561756
==============================================================================
--- 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage.java
 (added)
+++ 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage.java
 Wed Aug  1 03:30:47 2007
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ */
+package org.apache.wicket.ajax;
+
+import org.apache.wicket.Component;
+import org.apache.wicket.ajax.markup.html.AjaxFallbackLink;
+import org.apache.wicket.markup.html.WebPage;
+
+/**
+ * @author jcompagner
+ */
+public class AjaxHeaderContributionPage extends WebPage
+{
+       private static final long serialVersionUID = 1L;
+
+       /**
+        * Construct.
+        */
+       public AjaxHeaderContributionPage()
+       {
+               final Component test1 = new 
AjaxHeaderContribution("test1").setOutputMarkupId(true);
+               add(test1);
+               final Component test2 = new 
AjaxHeaderContribution("test2").setOutputMarkupId(true);
+               add(test2);
+               final Component test3 = new 
AjaxHeaderContribution("test3").setOutputMarkupId(true);
+               add(test3);
+               add(new AjaxFallbackLink("link")
+               {
+                       private static final long serialVersionUID = 1L;
+
+                       public void onClick(AjaxRequestTarget target)
+                       {
+                               target.prependJavascript("prepend();");
+                               target.addComponent(test1);
+                               target.addComponent(test2);
+                               target.addComponent(test3);
+                               target.appendJavascript("append();");
+                       }
+               });
+       }
+}

Propchange: 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage_ajax_expected.html
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage_ajax_expected.html?view=auto&rev=561756
==============================================================================
--- 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage_ajax_expected.html
 (added)
+++ 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage_ajax_expected.html
 Wed Aug  1 03:30:47 2007
@@ -0,0 +1,14 @@
+<?xml version="1.0" 
encoding="UTF-8"?><ajax-response><evaluate><![CDATA[prepend();]]></evaluate><header-contribution><![CDATA[<head
 xmlns:wicket="http://wicket.apache.org";>
+<link href="../test"/>
+<script type="text/javascript" src="javascripturl"></script>
+</head>]]></header-contribution><component id="test13" ><![CDATA[<span 
wicket:id="test1" id="test13"><wicket:panel>
+test
+</wicket:panel></span>]]></component><header-contribution><![CDATA[<head 
xmlns:wicket="http://wicket.apache.org";>
+<link href="../test"/>
+</head>]]></header-contribution><component id="test24" ><![CDATA[<span 
wicket:id="test2" id="test24"><wicket:panel>
+test
+</wicket:panel></span>]]></component><header-contribution><![CDATA[<head 
xmlns:wicket="http://wicket.apache.org";>
+<link href="../test"/>
+</head>]]></header-contribution><component id="test35" ><![CDATA[<span 
wicket:id="test3" id="test35"><wicket:panel>
+test
+</wicket:panel></span>]]></component><evaluate><![CDATA[domReady();]]></evaluate><evaluate><![CDATA[append();]]></evaluate><evaluate><![CDATA[onLoad();]]></evaluate></ajax-response>
\ No newline at end of file

Propchange: 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage_ajax_expected.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage_expected.html
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage_expected.html?view=auto&rev=561756
==============================================================================
--- 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage_expected.html
 (added)
+++ 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage_expected.html
 Wed Aug  1 03:30:47 2007
@@ -0,0 +1,32 @@
+<html>
+<head>
+<link href="../test"/>
+<script type="text/javascript" src="javascripturl"></script>
+<script type="text/javascript" 
src="resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js"></script>
+<script type="text/javascript" ><!--/*--><![CDATA[/*><!--*/
+Wicket.Event.add(window, "domready", function() { domReady();;});
+/*-->]]>*/</script>
+
+<script type="text/javascript" ><!--/*--><![CDATA[/*><!--*/
+Wicket.Event.add(window, "load", function() { onLoad();;});
+/*-->]]>*/</script>
+
+<script type="text/javascript" 
src="resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax.js"></script>
+<script type="text/javascript" 
id="wicket-ajax-debug-enable"><!--/*--><![CDATA[/*><!--*/
+wicketAjaxDebugEnable=true;
+/*-->]]>*/</script>
+
+<script type="text/javascript" 
src="resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax-debug.js"></script>
+</head><body>
+<span wicket:id="test1" id="test13"><wicket:panel>
+test
+</wicket:panel></span>
+<span wicket:id="test2" id="test24"><wicket:panel>
+test
+</wicket:panel></span>
+<span wicket:id="test3" id="test35"><wicket:panel>
+test
+</wicket:panel></span>
+<a href="?wicket:interface=:0:link::ILinkListener::" wicket:id="link" 
onclick="var 
wcall=wicketAjaxGet('?wicket:interface=:0:link::IBehaviorListener:0:', 
function() { }.bind(this), function() { }.bind(this));return !wcall;" 
id="link6">Test</a>
+</body>
+</html>
\ No newline at end of file

Propchange: 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage_expected.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionTest.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionTest.java?view=auto&rev=561756
==============================================================================
--- 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionTest.java
 (added)
+++ 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionTest.java
 Wed Aug  1 03:30:47 2007
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ */
+package org.apache.wicket.ajax;
+
+import org.apache.wicket.WicketTestCase;
+
+/**
+ * @author jcompagner
+ */
+public class AjaxHeaderContributionTest extends WicketTestCase
+{
+       /**
+        * @throws Exception
+        */
+       public void testAjaxHeaderContribution() throws Exception
+       {
+               tester.processRequestCycle(AjaxHeaderContributionPage.class);
+               tester.assertResultPage(AjaxHeaderContributionPage.class,
+                               "AjaxHeaderContributionPage_expected.html");
+
+               tester.executeAjaxEvent("link", "onclick");
+               tester.assertResultPage(AjaxHeaderContributionPage.class,
+                               
"AjaxHeaderContributionPage_ajax_expected.html");
+
+       }
+}

Propchange: 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/DomReadyOrderPage.html
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/DomReadyOrderPage.html?view=auto&rev=561756
==============================================================================
--- 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/DomReadyOrderPage.html
 (added)
+++ 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/DomReadyOrderPage.html
 Wed Aug  1 03:30:47 2007
@@ -0,0 +1,5 @@
+<html>
+<body>
+<a href="#" wicket:id="test">Test</a>
+</body>
+</html>
\ No newline at end of file

Propchange: 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/DomReadyOrderPage.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/DomReadyOrderPage.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/DomReadyOrderPage.java?view=auto&rev=561756
==============================================================================
--- 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/DomReadyOrderPage.java
 (added)
+++ 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/DomReadyOrderPage.java
 Wed Aug  1 03:30:47 2007
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ */
+package org.apache.wicket.ajax;
+
+import org.apache.wicket.ajax.markup.html.AjaxFallbackLink;
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.internal.HtmlHeaderContainer;
+
+/**
+ * @author jcompagner
+ */
+public class DomReadyOrderPage extends WebPage
+{
+       private static final long serialVersionUID = 1L;
+
+       /**
+        * Construct.
+        */
+       public DomReadyOrderPage()
+       {
+               add(new Link("test"));
+       }
+
+       private static class Link extends AjaxFallbackLink
+       {
+               private static final long serialVersionUID = 1L;
+
+               /**
+                * Construct.
+                * 
+                * @param id
+                */
+               public Link(String id)
+               {
+                       super(id);
+               }
+
+               public void renderHead(HtmlHeaderContainer container)
+               {
+                       super.renderHead(container);
+
+                       
container.getHeaderResponse().renderOnDomReadyJavascript("test1();");
+                       
container.getHeaderResponse().renderOnDomReadyJavascript("test2();");
+               }
+
+               public void onClick(AjaxRequestTarget target)
+               {
+                       target.addComponent(this);
+               }
+       }
+}

Propchange: 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/DomReadyOrderPage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/DomReadyOrderPage_ajax_expected.html
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/DomReadyOrderPage_ajax_expected.html?view=auto&rev=561756
==============================================================================
--- 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/DomReadyOrderPage_ajax_expected.html
 (added)
+++ 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/DomReadyOrderPage_ajax_expected.html
 Wed Aug  1 03:30:47 2007
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?><ajax-response><header-contribution 
encoding="wicket1" ><![CDATA[<head 
xmlns:wicket="http://wicket.apache.org";><script type="text/javascript" 
src="resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js"></script>
+<script type="text/javascript" 
src="resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax.js"></script>
+<script type="text/javascript" 
id="wicket-ajax-debug-enable"><!--/*--><![CDATA[/*><!--*/
+wicketAjaxDebugEnable=true;
+/*-->]^]^>*/</script>
+
+<script type="text/javascript" 
src="resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax-debug.js"></script>
+</head>]]></header-contribution><component id="test0" ><![CDATA[<a 
href="?wicket:interface=:0:test::ILinkListener::" wicket:id="test" onclick="var 
wcall=wicketAjaxGet('?wicket:interface=:0:test::IBehaviorListener:0:', 
function() { }.bind(this), function() { }.bind(this));return !wcall;" 
id="test0">Test</a>]]></component><evaluate><![CDATA[test1();]]></evaluate><evaluate><![CDATA[test2();]]></evaluate></ajax-response>
\ No newline at end of file

Propchange: 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/DomReadyOrderPage_ajax_expected.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/DomReadyOrderPage_expected.html
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/DomReadyOrderPage_expected.html?view=auto&rev=561756
==============================================================================
--- 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/DomReadyOrderPage_expected.html
 (added)
+++ 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/DomReadyOrderPage_expected.html
 Wed Aug  1 03:30:47 2007
@@ -0,0 +1,20 @@
+<html>
+<head><script type="text/javascript" 
src="resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js"></script>
+<script type="text/javascript" 
src="resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax.js"></script>
+<script type="text/javascript" 
id="wicket-ajax-debug-enable"><!--/*--><![CDATA[/*><!--*/
+wicketAjaxDebugEnable=true;
+/*-->]]>*/</script>
+
+<script type="text/javascript" 
src="resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax-debug.js"></script>
+<script type="text/javascript" ><!--/*--><![CDATA[/*><!--*/
+Wicket.Event.add(window, "domready", function() { test1();;});
+/*-->]]>*/</script>
+
+<script type="text/javascript" ><!--/*--><![CDATA[/*><!--*/
+Wicket.Event.add(window, "domready", function() { test2();;});
+/*-->]]>*/</script>
+
+</head><body>
+<a href="?wicket:interface=:0:test::ILinkListener::" wicket:id="test" 
onclick="var 
wcall=wicketAjaxGet('?wicket:interface=:0:test::IBehaviorListener:0:', 
function() { }.bind(this), function() { }.bind(this));return !wcall;" 
id="test0">Test</a>
+</body>
+</html>
\ No newline at end of file

Propchange: 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/DomReadyOrderPage_expected.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/DomReadyOrderTest.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/DomReadyOrderTest.java?view=auto&rev=561756
==============================================================================
--- 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/DomReadyOrderTest.java
 (added)
+++ 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/DomReadyOrderTest.java
 Wed Aug  1 03:30:47 2007
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ */
+package org.apache.wicket.ajax;
+
+import org.apache.wicket.WicketTestCase;
+
+/**
+ * @author jcompagner
+ */
+public class DomReadyOrderTest extends WicketTestCase
+{
+       /**
+        * @throws Exception
+        */
+       public void testDomReadyOrder() throws Exception
+       {
+               tester.processRequestCycle(DomReadyOrderPage.class);
+               tester.assertResultPage(DomReadyOrderPage.class, 
"DomReadyOrderPage_expected.html");
+
+               tester.executeAjaxEvent("test", "onclick");
+               tester.assertResultPage(DomReadyOrderPage.class, 
"DomReadyOrderPage_ajax_expected.html");
+       }
+}

Propchange: 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/DomReadyOrderTest.java
------------------------------------------------------------------------------
    svn:eol-style = native


Reply via email to