You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Musachy Barroso <mb...@wfscorp.com> on 2007/01/04 19:39:38 UTC
Re: Problem with Dojo in Struts 2
If you set "executeScripts" to "true", in the submit tag, you can put a
javascript section in the returned page, and it will be executed, like:
<script>
makeWidgets();
</script>
There is an example if this in showcase, in the remote div section.
regards
musachy
André Faria wrote:
> I have a problem with Dojo in Struts 2.
> When the page loads a method dojo named makeWidgets is called, that
> method searchs for the dojo widgets and attach the necessary events to
> dojo listeners.
> Example:
>
> <div id="div1">Div 1</div>
> <s:url id="ajaxTest" value="/AjaxTest.action" />
> <s:submit type="submit" theme="ajax" value="submit" targets="div1"
> href="%{ajaxTest}"/>
>
> the ftl adds some dojo notations dojoType, etc...
> The method onLoad (makeWidgets) is executed.
> if you click in the submit button a dojo listener would be called and
> the result of AjaxTest.action would be printed in 'div1'.
> Thats really works!!!
>
> but the problem is if you AjaxTest.action needs to do annother ajax
> request and print the response a in div... Dont Work...
> Because the listener is not added to the new submit button because the
> method makeWidgets didnt run, but
> If you call the method programmaticaly when you click in the first
> button two request will be triggered.
>
> If someone have a light about this... Please help-me.
>
> Thank's
> */André Faria/*
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Problem with Dojo in Struts 2
Posted by Musachy Barroso <mb...@wfscorp.com>.
I should have said this first, but why are you calling "makeWidgets"
directly? Dojo takes care of that, and if you are using S2 head svn, any
widget used on a page returned from an asynchronous call will be loaded
by S2 automatically.
musachy
André Faria wrote:
> Thank's...
>
> But if you call makeWidgets() again the input buttons out of the div
> that uses ajax tags will be added to the dojo lisneters again, and
> when you click in a button they will be execute the same number of
> post that you executed makeWidgets...
>
>
> Musachy Barroso escreveu:
>> If you set "executeScripts" to "true", in the submit tag, you can put
>> a javascript section in the returned page, and it will be executed,
>> like:
>>
>> <script>
>> makeWidgets();
>> </script>
>>
>> There is an example if this in showcase, in the remote div section.
>>
>> regards
>> musachy
>>
>> André Faria wrote:
>>> I have a problem with Dojo in Struts 2.
>>> When the page loads a method dojo named makeWidgets is called, that
>>> method searchs for the dojo widgets and attach the necessary events to
>>> dojo listeners.
>>> Example:
>>>
>>> <div id="div1">Div 1</div>
>>> <s:url id="ajaxTest" value="/AjaxTest.action" />
>>> <s:submit type="submit" theme="ajax" value="submit" targets="div1"
>>> href="%{ajaxTest}"/>
>>>
>>> the ftl adds some dojo notations dojoType, etc...
>>> The method onLoad (makeWidgets) is executed.
>>> if you click in the submit button a dojo listener would be called and
>>> the result of AjaxTest.action would be printed in 'div1'.
>>> Thats really works!!!
>>>
>>> but the problem is if you AjaxTest.action needs to do annother ajax
>>> request and print the response a in div... Dont Work...
>>> Because the listener is not added to the new submit button because the
>>> method makeWidgets didnt run, but
>>> If you call the method programmaticaly when you click in the first
>>> button two request will be triggered.
>>>
>>> If someone have a light about this... Please help-me.
>>>
>>> Thank's
>>> */André Faria/*
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Problem with Dojo in Struts 2
Posted by André Faria <an...@mandic.com.br>.
Thank's...
But if you call makeWidgets() again the input buttons out of the div
that uses ajax tags will be added to the dojo lisneters again, and when
you click in a button they will be execute the same number of post that
you executed makeWidgets...
Musachy Barroso escreveu:
> If you set "executeScripts" to "true", in the submit tag, you can put
> a javascript section in the returned page, and it will be executed, like:
>
> <script>
> makeWidgets();
> </script>
>
> There is an example if this in showcase, in the remote div section.
>
> regards
> musachy
>
> André Faria wrote:
>> I have a problem with Dojo in Struts 2.
>> When the page loads a method dojo named makeWidgets is called, that
>> method searchs for the dojo widgets and attach the necessary events to
>> dojo listeners.
>> Example:
>>
>> <div id="div1">Div 1</div>
>> <s:url id="ajaxTest" value="/AjaxTest.action" />
>> <s:submit type="submit" theme="ajax" value="submit" targets="div1"
>> href="%{ajaxTest}"/>
>>
>> the ftl adds some dojo notations dojoType, etc...
>> The method onLoad (makeWidgets) is executed.
>> if you click in the submit button a dojo listener would be called and
>> the result of AjaxTest.action would be printed in 'div1'.
>> Thats really works!!!
>>
>> but the problem is if you AjaxTest.action needs to do annother ajax
>> request and print the response a in div... Dont Work...
>> Because the listener is not added to the new submit button because the
>> method makeWidgets didnt run, but
>> If you call the method programmaticaly when you click in the first
>> button two request will be triggered.
>>
>> If someone have a light about this... Please help-me.
>>
>> Thank's
>> */André Faria/*
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
--
Atenciosamente,
*/André Faria/*
/BlueSoft Consultoria em Informática/
/Fone: [55 11] 5543-5406/
/Web: www.bluesoft.com.br/
//////
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org