Helma Logo
main list history
previous version  overview  next version

Version 4 by zumbrunn on 07. December 2005, 11:43

This handler is invoked whenever the topiclist view is rendered. When the handler is invoked, "that" is the object which was passed as the second parameter of renderView(view,that) or an empty/default object otherwise. It is the object that will be used as the current and only accessible scope when rendering the view. Views would be E4X Javascript XML objects.

./Site/topiclist.view.handler

    if (this.topics.count()) {
        that.topics = {};
        for (var topic in this.topics) {
            that.topics.name = this.topics[topic].name;
            that.topics.count = this.topics[topic].comments.count();
        }
    }

This handler is invoked whenever the topiclist view is rendered. When the handler is invoked, "that" is the object which was passed as the second parameter of renderView(view,that) or an empty/default object otherwise. It is the object that will be used as the current and only accessible scope when rendering the view.

./Site/topiclist.view

    <table border="1">
        <tr if="topics">
            <th lookup="true">Topic Name</th>
            <th lookup="true">Comment Count</th>
        </tr>
        <tr for="topics">
            <td>$name$</td>
            <td if="!$count$" lookup="true">No comments yet</td>
            <td if="$count$ == 1" lookup="true">$count$ comment</td>
            <td if="$count$ > 1" lookup="true">$count$ comments</td>
        </tr>
        <tr if="!topics">
            <td colspan="2" align="center" lookup="true">This list is empty</td>
        </tr>
    </table>

./Site/list.control

    var content = {
        main : this.renderView('topiclist')
    };
    var page = this.renderView(Page.views.default, content);
    return page;


     removed
     added