You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Yayo <ed...@gmail.com> on 2008/05/11 19:05:40 UTC

Struts2 cancel button with ajax theme does not execute method (bug?)

Hi,

i'd like to discuss with you for in case you've found it before.

I've got a div <div id="result">...</div> that I fill with my ajax results
so I present a list inside of the result div, then user clicks on an element
and the response goes inside for editing.

Then in the edition details I've added two buttons, a submit and a cancel
like this:

                    <s:submit id="submit" name="submit" targets="result"
key="accept" theme="ajax" action="save-blog"/>
                    <s:submit id="cancel" name="cancel"
action="edit-blog-cancel" theme="ajax" onclick="form.onsubmit=null"
key="cancel" targets="result"/>

And I've found that the one I've marked with cancel button never executes
the cancel method in my action unless I delete the theme="ajax" attribute...

¿May this be a bug?


-- 
"Sit tibi terra levis"

http://yayocaturas.blogspot.com/

Re: Struts2 cancel button with ajax theme does not execute method (bug?)

Posted by Jeromy Evans <je...@blueskyminds.com.au>.

Yayo wrote:
> I don't have scripts in my results but that don't changes the fact that the
> action configured in the cancel button never gets executed...
>
>   

I thought you meant you had an <s:submit theme="ajax"> button in your 
result, which implies the result needs to be parsed by dojo so it can 
attach listeners to the element.
If it only doesn't work in IE, then it may be another common problem 
where showLoadingText needs to be set to false.  Please see other 
threads for that description.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts2 cancel button with ajax theme does not execute method (bug?)

Posted by Yayo <ed...@gmail.com>.
I don't have scripts in my results but that don't changes the fact that the
action configured in the cancel button never gets executed...

On Mon, May 12, 2008 at 4:57 AM, Jeromy Evans <
jeromy.evans@blueskyminds.com.au> wrote:

> Yayo wrote:
>
>> Hi,
>>
>> i'd like to discuss with you for in case you've found it before.
>>
>> I've got a div <div id="result">...</div> that I fill with my ajax results
>> so I present a list inside of the result div, then user clicks on an
>> element
>> and the response goes inside for editing.
>>
>> Then in the edition details I've added two buttons, a submit and a cancel
>> like this:
>>
>>                    <s:submit id="submit" name="submit" targets="result"
>> key="accept" theme="ajax" action="save-blog"/>
>>                    <s:submit id="cancel" name="cancel"
>> action="edit-blog-cancel" theme="ajax" onclick="form.onsubmit=null"
>> key="cancel" targets="result"/>
>>
>> And I've found that the one I've marked with cancel button never executes
>> the cancel method in my action unless I delete the theme="ajax"
>> attribute...
>>
>> ¿May this be a bug?
>>
>>
>>
>
> If your ajax result itself includes javascript (such an an ajax submit),
> then you need to use the separateSripts and executeScripts attributes of the
> div/submit that loads it.
> Dojo is responsible for parsing your ajax result, looking for scripts,
> inserting the html into the dom and then executing those scripts.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
"Sit tibi terra levis"

http://yayocaturas.blogspot.com/

Re: Struts2 cancel button with ajax theme does not execute method (bug?)

Posted by Jeromy Evans <je...@blueskyminds.com.au>.
Yayo wrote:
> Hi,
>
> i'd like to discuss with you for in case you've found it before.
>
> I've got a div <div id="result">...</div> that I fill with my ajax results
> so I present a list inside of the result div, then user clicks on an element
> and the response goes inside for editing.
>
> Then in the edition details I've added two buttons, a submit and a cancel
> like this:
>
>                     <s:submit id="submit" name="submit" targets="result"
> key="accept" theme="ajax" action="save-blog"/>
>                     <s:submit id="cancel" name="cancel"
> action="edit-blog-cancel" theme="ajax" onclick="form.onsubmit=null"
> key="cancel" targets="result"/>
>
> And I've found that the one I've marked with cancel button never executes
> the cancel method in my action unless I delete the theme="ajax" attribute...
>
> ¿May this be a bug?
>
>   

If your ajax result itself includes javascript (such an an ajax submit), 
then you need to use the separateSripts and executeScripts attributes of 
the div/submit that loads it.
Dojo is responsible for parsing your ajax result, looking for scripts, 
inserting the html into the dom and then executing those scripts.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org