You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@shindig.apache.org by "Henry Saputra (JIRA)" <ji...@apache.org> on 2012/06/04 22:44:22 UTC
[jira] [Commented] (SHINDIG-1788) Non-inline templates are not
accessible from os.getTemplate JavaScript
[ https://issues.apache.org/jira/browse/SHINDIG-1788?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13288891#comment-13288891 ]
Henry Saputra commented on SHINDIG-1788:
----------------------------------------
Could you also include the sample gadget that try to use this template to help debug the issue?
> Non-inline templates are not accessible from os.getTemplate JavaScript
> ----------------------------------------------------------------------
>
> Key: SHINDIG-1788
> URL: https://issues.apache.org/jira/browse/SHINDIG-1788
> Project: Shindig
> Issue Type: Bug
> Components: Javascript
> Affects Versions: 2.5.0-beta1
> Reporter: Chris Geer
>
> Templates that are defined inline are accessible from the os.getTemplate method call. Templates that are defined in a Template Library or in the Module header are not accessible. Inline templates process through and eventually get sent to os.registerTemplate, non-inline templates make it to os.Loader.processTemplateNode where they don't go any further (if the template has a tag, which follows the opensocial doc examples). If the template doesn't have a tag and only a name, it looks like it might work. I didn't see a name attribute included in the Open Social template spec anywhere though. Is that valid instead of "tag"?
> Non-inline templates seem to work declaratively but not through the API.
> Example TemplateLibrary file
> <?xml version="1.0" encoding="UTF-8"?>
> <Templates xmlns:acct="http://www.foo.com/templates/accounts">
> <Namespace prefix="acct" url="http://www.foo.com/templates/accounts"/>
> <Template tag="acct:AccountList">
> <table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="tblAccounts">
> <thead>
> <tr>
> <th width="10">ID</th>
> <th width="200">Name</th>
> <th class="edit"></th>
> </tr>
> </thead>
> <tbody>
> <tr repeat="${Top.Account}">
> <td>${Cur.Key}</td>
> <td>${Cur.Name}</td>
> <td>
> <input type="hidden" value="${Cur.id}"/>
> <button onclick="editAccount('${Cur.id}');" class="btn editAccount">edit</button>
> </td>
> </tr>
> </tbody>
> </table>
> </Template>
> </Templates>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira