You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Bertrand Delacretaz (JIRA)" <ji...@apache.org> on 2007/12/03 11:41:43 UTC

[jira] Commented: (SLING-114) ECT - Ecmascript Client Templates

    [ https://issues.apache.org/jira/browse/SLING-114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12547788 ] 

Bertrand Delacretaz commented on SLING-114:
-------------------------------------------

Here's a simple example template that works with the revised patch that I just uploaded:

<p>
  currentNode.title = <b> <%= currentNode.title %> </b>
</p>
<p>
  currentNode.text = <em> <%= currentNode.text %> </em> (changed)
</p>

<%
  // if present, this function is called by body.onLoad
  function onLoad() {
    document.title = currentNode.title;
  }
%>


> ECT - Ecmascript Client Templates
> ---------------------------------
>
>                 Key: SLING-114
>                 URL: https://issues.apache.org/jira/browse/SLING-114
>             Project: Sling
>          Issue Type: Improvement
>          Components: microsling
>            Reporter: Bertrand Delacretaz
>         Attachments: SLING-114.patch, SLING-114.patch
>
>
> To complete the javascript scripting features for microsling, I'd like to implement a client-side version of the ESP templates.
> A template such as
>   <p class="<%= item.color %>"><%= item.text %></p>
> Will be processed server-side to generate javascript client code such as
>   document.write("<p class=");
>   document.write(item.color);
>   document.write("\">");
>   document.write(item.text);
>   document.write("</p>\n");
> which executes on the client to render the content.
> Combined with a richer XHTML default rendering of data than what we have now, this creates interesting possibilities for ajaxish apps based on microsling/microjax (SLING-92).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.