-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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
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
Asked: 2015-09-19 13:21:33 +0800
Seen: 27 times
Last updated: Sep 20 '15
ZK Calendar Wire Spring-managed Beans Failed [closed]
Spring security doesn't return user inside event listener
where to put @Transactional (Hibernate Spring)
Clustered Session Terracotta not working
Can't inject using @Value in ViewModel if not declaring as @Component.. so what do we use?
Not able to bind Spring beans after zk upgrade
retriving Spring authentication provider Name dynamically in multiple authentication providers