I am able to reproduce this on both tacos4-beta2 and the latest nighty build of tacos4-beta3.

I have a case where I have one or more AjaxLinkSubmit components, that are generated in a div refreshed using Tacos. After these AjaxLinkSubmits, I also have a AjaxSubmit to submit the form.

When I click on the AjaxSubmit, I see one post request being sent for each AjaxLinkSubmit and then the post request for the AjaxSubmit itself is sent.

But when I change the AjaxSubmit to an AjaxLinkSubmit, and then click on it, only this AjaxLinkSubmit gets posted. 

P.S.: This happens only for AjaxLinkSubmits generated and refreshed using Tacos. For AjaxLinkSubmits that were initially part of the page, the AjaxSubmit sends only one post request for itself.

STEPS TO REPRODUCE

I have a simple example that reproduces the problem -

1. Zero-or-more AjaxLinkSubmit components are created based on a list of Strings, iterated by a "For" component.
2. This "For" component is wrapped in a "div" that can be refreshed using  Tacos
3. An AjaxSubmit button is included, that can be used to reproduce the problem
4. An AjaxLinkSubmit is included that can be used to add more AjaxLinkSubmit components to the list in step 1

Just deploy, and then click on the "Submit" link to add some (say 2) tags (AjaxLinkSubmit components). Then click on the "Submit" button. You will see one post request for each AjaxLinkSubmit and one for the AjaxSubmit

Here is the HTML template of the page:

************************** AjaxLinkSubmitTest.html **************************

<html>
    <head>
        <script type="text/_javascript_" src=""
    </head>
    <body jwcid="@Body">
        <form jwcid="@tacos:AjaxForm">

            <div jwcid="@Any" id="forRefresh">
                <span jwcid="@For" source="ognl:tagList" value="ognl:temp" volatile="true">
                    <a jwcid="[EMAIL PROTECTED]:AjaxLinkSubmit" selected="ognl:testTag" tag="ognl:temp">
                        <span jwcid="@Insert" value="ognl:temp"/>
                    </a>
                </span>
            </div>

            <input type="submit" jwcid="@tacos:AjaxSubmit" listener="listener:myListener" value="Submit"
                updateComponents="ognl:{ 'forRefresh' }"></input><br/>
            <a jwcid="@tacos:AjaxLinkSubmit" listener="listener:myListener"
                updateComponents="ognl:{ 'forRefresh' }">Submit</a><br/>
        </form>
       
    </body>
</html>
   
************************** AjaxLinkSubmitTest.java **************************

package sample;

import java.util.ArrayList ;
import java.util.List;

import org.apache.tapestry.BaseComponent;
import org.apache.tapestry.annotations.Persist;
import org.apache.tapestry.html.BasePage;

public abstract class AjaxLinkSubmitTest extends BasePage {

    private String testTag;

    public String getTestTag() {
        return testTag;
    }

    public void setTestTag(String testTag) {
        System.out.println("Setting testTag to " + testTag);
        this.testTag = testTag;
    }

    @Persist("session")
    public abstract List<String> getTagList();
    public abstract void setTagList(List<String> l);
   
    public void myListener() {
        System.out.println("myListener() called");
       
        List<String> l = getTagList();
       
        if(l == null) {
            l = new ArrayList<String>();
            setTagList(l);
        }
       
        l.add("Tag" + l.size());
    }
}

************************** AjaxLinkSubmitTest.page *********************
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE page-specification PUBLIC
  "-//Apache Software Foundation//Tapestry Specification 4.0//EN"
  "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd ">

<page-specification class="sample.AjaxLinkSubmitTest">
    <property name="temp"/>
</page-specification>


--
Thanks, Karthik
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Tacos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tacos-devel

Reply via email to