0

apache tiles + spring + zk ? how to load the page when menu Item is clicked ?

asked 2015-09-19 13:21:33 +0800

PRATIKKAR gravatar image PRATIKKAR
3 2

I am trying to load a page on click of menu . The page loading takes place through apache tiles + Spring MVC . My Menu.zul looks something likes this .


<window id="mainmenubar" apply="org.zkoss.bind.BindComposer"
        border="none"
        viewModel="@id('vm') @init('com.test.CustomWeb.VO.MenuBarVM')">
        <menubar id="mbar"
            autodrop="true"
            children="@bind(vm.nodes) @template(empty each.children?'menuitem':'menu')">
            <template name="menu" var="menu">
                <menu label="@bind(menu.name)">
                    <menupopup sclass="mymenupopup"
                        children="@bind(menu.children) @template(empty each.children?'menuitem':'menu')" />
                </menu>
            </template>
            <template name="menuitem" var="item">
                <menuitem label="@bind(item.name)"
                    onClick="@command('menuClicked',menuitem=item)" />
            </template>
        </menubar>
    </window>

and the server side handling for this is

@Command
        public void menuClicked(@BindingParam("menuitem") MenuItem ms){
           // showNotify("Clicked on "+ms.getName());
            //Executions.forward("contact.html");
            Executions.sendRedirect("contact.html");
            // TODO Auto-generated catch block
        }

But I think this is not the correct approach to do this. can some body say me a better approach

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-09-20 06:08:22 +0800

Darksu gravatar image Darksu
1991 1 4

Hello PRATIKKAR,

You could also use href directly since you are using the same url.

For more information please refer to the following url:

http://books.zkoss.org/wiki/ZKComponentReference/Essential_Components/Menu/Menuitem

Best Regards,

Darksu

link publish delete flag offensive edit
Your answer
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: 2015-09-19 13:21:33 +0800

Seen: 27 times

Last updated: Sep 20 '15

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