You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Todd Miller <To...@sirsidynix.com> on 2008/11/06 20:36:21 UTC

Dynamic JavaScript

I am currently involved in porting a Tapestry 4 project to Tapestry 5.
I came across some html with the following:

<span jwcid="@Script" script="MultiLanguageTextField.script"
          inputFieldID="languageTextField"
          hiddenFieldID="encodedValues"
          languageSelectID="languageSelect"/>

I've been told that this is for dynamic JavaScript.  I haven't been able
to find documentation for how this is done in Tapestry 5.  Could someone
point me to a good Url that explains this.

Thank you.


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


Re: Dynamic JavaScript

Posted by Howard Lewis Ship <hl...@gmail.com>.
No, the strategy has changed.  You generally want to

a) Include a static JavaScript file with the logic (event handlers, etc.)
b) Generate a *small* amount of initialization JavaScript dynamically

Because statics are only included once, you no longer need the
<unique> element from the T4 script DTD.

Initialization code is generated in code, using the RenderSupport environmental.

T4 tried to merge both these concepts into the script DTD.

On Thu, Nov 6, 2008 at 12:37 PM, Todd Miller <To...@sirsidynix.com> wrote:
>
> Does Tapestry 5 still use the following type of script file or has this
> changed?  I couldn't tell from browsing through the Url you gave.
>
> <!DOCTYPE script PUBLIC
>  "-//Apache Software Foundation//Tapestry Script Specification 3.0//EN"
>  "http://jakarta.apache.org/tapestry/dtd/Script_3_0.dtd">
>
> <script>
>    <input-symbol key="inputFieldID" class="java.lang.String"
> required="yes"/>
>
> <let key="inputFieldPath">
>    document.getElementById("${inputFieldID}")
> </let>
> <body>
>
> <unique>
> <![CDATA[
> function updateInputField()
> {
>    var inputField = ${inputFieldPath};
>
> .
> .
> .
>
> -----Original Message-----
> From: Howard Lewis Ship [mailto:hlship@gmail.com]
> Sent: Thursday, November 06, 2008 1:14 PM
> To: Tapestry users
> Subject: Re: Dynamic JavaScript
>
>
> http://tapestry.formos.com/nightly/tapestry5/guide/ajax.html
>
> On Thu, Nov 6, 2008 at 11:36 AM, Todd Miller
> <To...@sirsidynix.com> wrote:
>>
>> I am currently involved in porting a Tapestry 4 project to Tapestry 5.
>> I came across some html with the following:
>>
>> <span jwcid="@Script" script="MultiLanguageTextField.script"
>>          inputFieldID="languageTextField"
>>          hiddenFieldID="encodedValues"
>>          languageSelectID="languageSelect"/>
>>
>> I've been told that this is for dynamic JavaScript.  I haven't been
> able
>> to find documentation for how this is done in Tapestry 5.  Could
> someone
>> point me to a good Url that explains this.
>>
>> Thank you.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>
>
> --
> Howard M. Lewis Ship
>
> Creator Apache Tapestry and Apache HiveMind
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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


RE: Dynamic JavaScript

Posted by Todd Miller <To...@sirsidynix.com>.
Does Tapestry 5 still use the following type of script file or has this
changed?  I couldn't tell from browsing through the Url you gave.

<!DOCTYPE script PUBLIC
  "-//Apache Software Foundation//Tapestry Script Specification 3.0//EN"
  "http://jakarta.apache.org/tapestry/dtd/Script_3_0.dtd">

<script>
    <input-symbol key="inputFieldID" class="java.lang.String"
required="yes"/>

<let key="inputFieldPath">
    document.getElementById("${inputFieldID}")
</let>
<body>

<unique>
<![CDATA[
function updateInputField()
{
    var inputField = ${inputFieldPath};

.
.
.

-----Original Message-----
From: Howard Lewis Ship [mailto:hlship@gmail.com] 
Sent: Thursday, November 06, 2008 1:14 PM
To: Tapestry users
Subject: Re: Dynamic JavaScript


http://tapestry.formos.com/nightly/tapestry5/guide/ajax.html

On Thu, Nov 6, 2008 at 11:36 AM, Todd Miller
<To...@sirsidynix.com> wrote:
>
> I am currently involved in porting a Tapestry 4 project to Tapestry 5.
> I came across some html with the following:
>
> <span jwcid="@Script" script="MultiLanguageTextField.script"
>          inputFieldID="languageTextField"
>          hiddenFieldID="encodedValues"
>          languageSelectID="languageSelect"/>
>
> I've been told that this is for dynamic JavaScript.  I haven't been
able
> to find documentation for how this is done in Tapestry 5.  Could
someone
> point me to a good Url that explains this.
>
> Thank you.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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


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


Re: Dynamic JavaScript

Posted by Howard Lewis Ship <hl...@gmail.com>.
http://tapestry.formos.com/nightly/tapestry5/guide/ajax.html

On Thu, Nov 6, 2008 at 11:36 AM, Todd Miller <To...@sirsidynix.com> wrote:
>
> I am currently involved in porting a Tapestry 4 project to Tapestry 5.
> I came across some html with the following:
>
> <span jwcid="@Script" script="MultiLanguageTextField.script"
>          inputFieldID="languageTextField"
>          hiddenFieldID="encodedValues"
>          languageSelectID="languageSelect"/>
>
> I've been told that this is for dynamic JavaScript.  I haven't been able
> to find documentation for how this is done in Tapestry 5.  Could someone
> point me to a good Url that explains this.
>
> Thank you.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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