You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Jeremy F. Kassis" <jk...@jkassis.com> on 2007/01/10 21:37:24 UTC

Q: Body Scripts in T4.1 DojoAjaxResponseBuilder

Hi everyone,

I'm just getting around to upgrading from T4.0.2 to T4.1.2-SNAPSHOT. I have
a widget that returns an html fragment that contains a script block... i.e.
<Script language="javascript"> blah foo </script>. 

My problem is that this script isn't gettiing run after the ajax response.
Does the core.js client-side javascript that handles this request actually
parse and run script in embedded script blocks anymore? If not, what's the
recommended way to handle this?

Many thanks!
Jeremy F. Kassis
BumpQ, Inc.


-- 
View this message in context: http://www.nabble.com/Q%3A-Body-Scripts-in-T4.1-DojoAjaxResponseBuilder-tf2954962.html#a8265731
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Q: Body Scripts in T4.1 DojoAjaxResponseBuilder

Posted by "Jeremy F. Kassis" <jk...@jkassis.com>.
O.K. Jessek, I'll file a bug.

F.Y.I. Here is the response that's coming back. The conspicuous alert('hi');
isn't coming up after the page load and none of the other script in that
block is executing.

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD
XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [
<!ENTITY nbsp '&#160;'>
]>
<ajax-response><response id="formhidden" type="element"><div
style="display:none;" id="formhidden"><input type="hidden" name="formids"
value="Hidden,LinkSubmit,LinkSubmit_0,title,url,If,tagAutoCompleter,description,tagEventLoop,tagEventKeywordLoop,tagEventKeywordLoop_0"
/>

<input type="hidden" name="component" value="form" />
<input type="hidden" name="page" value="bumpq:BumpletPage" />
<input type="hidden" name="service" value="direct" />
<input type="hidden" name="session" value="T" />
<input type="hidden" name="submitmode" value="" />
<input type="hidden" name="submitname" value="" />
<input type="hidden" name="Hidden" id="Hidden"
value="Z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dwAA"
/>
<input type="hidden" name="If" value="F" />
<input type="hidden" name="tagEventLoop" value="P1" />
<input type="hidden" name="tagEventLoop" value="P1" />
</div></response><response id="redirectDiv" type="element">


<div id="redirectDiv">
<div>
http://localhost:8080/app?page=ShellPage&amp;service=external&amp;sp=Sbump&amp;sp=Sjkassis&amp;sp=Soptions&amp;sp=Sb41de90d-f32a-1029-aa2e-6dd1cf998f03
redirect link 	
<script>
//<![CDATA[
		alert('hi');
		try {
			// If we can get read the host property of the location, it's our site!"
			var openerHost = self.opener.location.host;
			var redirectUrl = dojo.byId('redirectLink').href;
			var slashX1 = redirectUrl.indexOf('/');
			var slashX2 = redirectUrl.indexOf('/', slashX1 + 2);
			var redirectHost = redirectUrl.substring(slashX1 + 2, slashX2);
			if (openerHost == redirectHost) {
			  self.opener.location = dojo.byId('redirectLink').href;
			}
		}
		catch (e) {	}
		window.close();
//]]>
</script>
</div>
</div></response><response id="initializationscript" type="script"><script>
//<![CDATA[
dojo.require("tapestry.form");tapestry.form.focusField('title');
//]]>
</script></response><response id="statusDiv" type="element"><div
id="statusDiv">

1168564586250<label for="title">Title</label> <input type="text"
name="title" value="Quest for Zero Point Energy Engineering Principles for
Free Energy" id="title" tabindex="1" maxlength="100" size="50"
/></div></response></ajax-response>








Jessek wrote:
> 
> If it's not getting parsed out / executed it definitely sounds like a
> bug. Could've sworn I was handling this but maybe it got overlooked
> somehow. If you file a JIRA issue I'll be able to take a peak during
> my next round of changes.
> 
> On 1/10/07, Jeremy F. Kassis <jk...@jkassis.com> wrote:
>>
>> Hi everyone,
>>
>> I'm just getting around to upgrading from T4.0.2 to T4.1.2-SNAPSHOT. I
>> have
>> a widget that returns an html fragment that contains a script block...
>> i.e.
>> <Script language="javascript"> blah foo </script>.
>>
>> My problem is that this script isn't gettiing run after the ajax
>> response.
>> Does the core.js client-side javascript that handles this request
>> actually
>> parse and run script in embedded script blocks anymore? If not, what's
>> the
>> recommended way to handle this?
>>
>> Many thanks!
>> Jeremy F. Kassis
>> BumpQ, Inc.
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Q%3A-Body-Scripts-in-T4.1-DojoAjaxResponseBuilder-tf2954962.html#a8265731
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
> 
> 
> -- 
> Jesse Kuhnert
> Tapestry/Dojo team member/developer
> 
> Open source based consulting work centered around
> dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Q%3A-Body-Scripts-in-T4.1-DojoAjaxResponseBuilder-tf2954962.html#a8290247
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Q: Body Scripts in T4.1 DojoAjaxResponseBuilder

Posted by Jesse Kuhnert <jk...@gmail.com>.
If it's not getting parsed out / executed it definitely sounds like a
bug. Could've sworn I was handling this but maybe it got overlooked
somehow. If you file a JIRA issue I'll be able to take a peak during
my next round of changes.

On 1/10/07, Jeremy F. Kassis <jk...@jkassis.com> wrote:
>
> Hi everyone,
>
> I'm just getting around to upgrading from T4.0.2 to T4.1.2-SNAPSHOT. I have
> a widget that returns an html fragment that contains a script block... i.e.
> <Script language="javascript"> blah foo </script>.
>
> My problem is that this script isn't gettiing run after the ajax response.
> Does the core.js client-side javascript that handles this request actually
> parse and run script in embedded script blocks anymore? If not, what's the
> recommended way to handle this?
>
> Many thanks!
> Jeremy F. Kassis
> BumpQ, Inc.
>
>
> --
> View this message in context: http://www.nabble.com/Q%3A-Body-Scripts-in-T4.1-DojoAjaxResponseBuilder-tf2954962.html#a8265731
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Q: Body Scripts in T4.1 DojoAjaxResponseBuilder

Posted by Alexandru Dragomir <al...@gmail.com>.
I think you must put your javascript in the <initialization> part of the
YourComponent.script file and then , in the YourComponent.java file ,
execute the script.
There are good examples in the timetracker application.

Cheers ,
Alex



On 1/10/07, Jeremy F. Kassis <jk...@jkassis.com> wrote:
>
>
> Hi everyone,
>
> I'm just getting around to upgrading from T4.0.2 to T4.1.2-SNAPSHOT. I
> have
> a widget that returns an html fragment that contains a script block... i.e
> .
> <Script language="javascript"> blah foo </script>.
>
> My problem is that this script isn't gettiing run after the ajax response.
> Does the core.js client-side javascript that handles this request actually
> parse and run script in embedded script blocks anymore? If not, what's the
> recommended way to handle this?
>
> Many thanks!
> Jeremy F. Kassis
> BumpQ, Inc.
>
>
> --
> View this message in context:
> http://www.nabble.com/Q%3A-Body-Scripts-in-T4.1-DojoAjaxResponseBuilder-tf2954962.html#a8265731
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>