0

How to resolve "please use jsp template instead"?

asked 2014-06-27 09:52:22 +0800

kissa gravatar image kissa
3 2

I don't know what's happening but I just converted sample ZUL file to JSP. I kept on having "please use jsp template instead". What seems to be the problem? Can you please help me?

I am using native JSP and Spring framework.

[ZUL - ORIGINAL]

<zk>
    <style src="/widgets/grid/iterative_renderer/style.css" />
    <div apply="zk.IterativeRendererController">
        <grid id="demoGrid" model="${$composer.languageContributors}">
            <auxhead>
                <auxheader
                    label="Contributor of ZK International Message(Part)" colspan="4" />
            </auxhead>
            <columns>
                <column hflex="4">Language</column>
                <column hflex="5">Contributor</column>
                <column hflex="2">Charset</column>
                <column hflex="3">Like</column>
            </columns>
            <rows sclass="narrow"/>
            <template name="model">
                <row>
                    <label value="${each.language}" />
                    <label value="${each.name}" />
                    <label value="${each.charset}" />
                    <div>
                        <button image="/images/thumb-up.png"/>
                    </div>
                </row>
            </template>
        </grid>
    </div>
</zk>

[JSP - CONVERTED]

<z:div apply="zk.controller.IterativeRendererController">
    <z:grid id="demoGrid" model="${$composer.languageContributors}">
        <z:auxhead>
            <z:auxheader
                label="Contributor of ZK International Message(Part)" colspan="4" />
        </z:auxhead>
        <z:columns>
            <z:column hflex="4">Language</z:column>
            <z:column hflex="5">Contributor</z:column>
            <z:column hflex="2">Charset</z:column>
            <z:column hflex="3">Like</z:column>
        </z:columns>
        <z:rows class="narrow">
            <z:template name="model">
                <z:row>
                    <z:label value="${each.language}" />
                    <z:label value="${each.name}" />
                    <z:label value="${each.charset}" />
                    <z:div>
                        <z:button image="/images/thumb-up.png"/>
                    </z:div>
                </z:row>
            </z:template>
        </z:rows>
    </z:grid>
</z:div>

[Controller]

public class IterativeRendererController extends SelectorComposer<Component> {
    private static final long serialVersionUID = 1L;

    @Wire
    ListModel<LanguageContribution> languageContributors;

    public ListModel<LanguageContribution> getLanguageContributors() {
        return languageContributors;
    }

    @Listen("onClick = button")
    public void doThumbUp(Event event){
        Button btn = (Button)event.getTarget();
        btn.getParent().appendChild(new Label("Thumbs Up!!!"));
        btn.setDisabled(true);
    }

    @Override
    public void doAfterCompose(Component comp) throws Exception {
        super.doAfterCompose(comp);
        languageContributors = new ListModelList<LanguageContribution>(new ContributorData().getLanguageContributors());
        for(int i = 0, size = languageContributors.getSize(); i < size; i++){
            LanguageContribution temp = languageContributors.getElementAt(i);
            System.out.println("Name : " + temp.getName());
            System.out.println("Language : " + temp.getLanguage());
            System.out.println("Charset : " + temp.getCharset());
            System.out.println("========================================");
        }
    }
}
delete flag offensive retag edit
Be the first one to answer this question!
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2014-06-27 09:52:22 +0800

Seen: 14 times

Last updated: Jun 27 '14

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More