Я определил пользовательскую команду в ZK и хочу называть ее, нажав на пункт меню.ZK Fire Event от Java API
Я вижу, что мы можем определить объект AuRequest, но не можем найти способ отправить это AuRequest, как в JavaScript, используя функцию zkau.send.
что-то вообще возможно? Если нет, можно ли определить zkau.send в функции JavaScript и вызвать его в MeunItem Click Event?
public class MyCustomCommand extends Command
{
protected MyCustomCommand(final String id, final int flags)
{
super(id, flags);
}
@Override
protected void process(final AuRequest request)
{
System.out.println("Menu Item Click");
}
}
зарегистрировать команду:
<bean id="myCustomCommand" class="com.test.commands.MyCustomCommand">
<constructor-arg value="onMenuEdit" />
<constructor-arg><util:constant static-field="org.zkoss.zk.au.Command.IGNORE_OLD_EQUIV"/></constructor-arg>
</bean>
и MenuItem событие
menuItem.addEventListener(Events.ON_CLICK, new EventListener()
{
@Override
public void onEvent(final Event event) throws Exception
{
final Tree tree = (Tree) parent;
final Treeitem treeitem = tree.getSelectedItem();
final AuRequest auRequest = new AuRequest(treeitem.getDesktop(), treeitem.getUuid(), "onMenuEdit", new String[]{});
//how to send the auRequest??
}
});