struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From joey <realghost...@gmail.com>
Subject Re: S2: Better passing of fields by link
Date Fri, 06 Apr 2007 01:37:10 GMT
I think you want the a tag having the ajax function like the autocompleter
tag.
You can just use ajax lib javascript like dojo to achieve it.
There is the snippet:
            function dojoForm(form) {
                var kw = {
                    mimetype: "text/plain",
                    encoding: 'utf-8',
                    formNode: form,
                    load: function(type, data, evt) {//callback function

                    },
                    error: function(t, e) {
                        alert("Error!... " + e.message);
                    }
                };
                dojo.io.bind(kw);
                return false;
            }
<s:form action="youraction" id="dataForm"
                onsubmit="try{dojoForm(this)}catch(E){};return false;">
<s:a href="%{editUrl}"
onclick="this.form.submit()">Edit
Lineup</s:a>
For details,you can see the showcase app or dojo documentation.


On 4/6/07, Scott Nesbitt <scottnesbitt@yahoo.com> wrote:
>
>
> I have a link that calls an action and I would like
> the action class to have some field values from my
> page.  Currently I do this:
>
> <s:url id="editUrl" action="EditLineup"
> includeParams="all"/>
> <s:a href="%{editUrl}"
> onclick="this.href=rewriteLink(this.href)">Edit
> Lineup</s:a>
>
> In rewriteLink() I manually create a list of parameter
> key/values.  Is there a better way?  In my
> autocompleter tag I can just do formId="dataForm" and
> have a small form  with hidden fields that get
> automatically serialized and sent to the action class,
> but that does not seem to work with the a tag, despite
> what the documentation says about ajax.
>
> Any ideas?  Perhaps I am going about this wrong but do
> not see any good examples of how to do this.
>
> Thank you,
>
> Scott
>
>
>
>
> ____________________________________________________________________________________
> No need to miss a message. Get email on-the-go
> with Yahoo! Mail for Mobile. Get started.
> http://mobile.yahoo.com/mail
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message