You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Chris Norris <th...@gmail.com> on 2006/01/09 17:19:35 UTC

using the in a .script

I'm having trouble understanding how to use this.  When I use it, it just
renders the xml right into the javascript.  Here's my .script:

<?xml version="1.0" encoding="UTF-8"?>
<!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="changeMap" class="java.util.HashMap" required="yes"/>
    <body>
<![CDATA[

function deliverySelected()
{
    <foreach expression="changeMap.keySet()">
        alert("something");
    </foreach>
}

]]>
    </body>
    <initialization>
    </initialization>
</script>


The rendered javascript looks like this:

function deliverySelected()
{
	<foreach expression="changeMap.keySet()">
		alert("something");
	</foreach>
}


What am I doing wrong here?  I couldn't find any examples of this being
used.

Re: using the in a .script

Posted by Chris Norris <th...@gmail.com>.
Duh, it's in a CDATA block and the parser is ignoring it.  <slaps forehead>

err...

&lt;slaps forehead&gt;

On 1/9/06, Chris Norris <th...@gmail.com> wrote:
>
> I'm having trouble understanding how to use this.  When I use it, it just
> renders the xml right into the javascript.  Here's my .script:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!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="changeMap" class="java.util.HashMap"
> required="yes"/>
>     <body>
> <![CDATA[
>
> function deliverySelected()
> {
>     <foreach expression=" changeMap.keySet()">
>         alert("something");
>     </foreach>
> }
>
> ]]>
>     </body>
>     <initialization>
>     </initialization>
> </script>
>
>
> The rendered javascript looks like this:
>
> function deliverySelected()
> {
> 	<foreach expression="changeMap.keySet()">
> 		alert("something");
> 	</foreach>
>
> }
>
>
> What am I doing wrong here?  I couldn't find any examples of this being
> used.
>
>

Re: using the in a .script

Posted by Andreas Idl <an...@ev-i.at>.
 I think you should move the foreach outside of the <![CDATA[

Andreas

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