-
FEATURED COMPONENTS
First time here? Check out the FAQ!
How to use handMessage in calendar with MVVM mode? help me
You can turn the method into a global command.
@GlobalCommand
public void handleQueueMessage(@BindingParam("message")QueueMessage message) {
}
invoke a global command in another ViewModel in the same desktop.
paramMap.put("message", queueMessage);
BindUtils.postGlobalCommand(null, null, "handleQueueMessage", paramMap);
Do you mean ZK Calendar or calendar (input component)?
Both 2 components don't have an attribute handMessage
. Can you describe in more detail or a code example?
Generally, you can specify a data binding in all component attributes e.g. visible
, disable
.
//listen to queue message from other controller
@Subscribe(value = QueueUtil.QUEUE_CALENDAREVENT_NAME)
public void handleQueueMessage(Event event) {
if(!(event instanceof QueueMessage)) {
return;
}
QueueMessage message = (QueueMessage)event;
switch(message.getType()){
case OK:
if (calendarModel.indexOf((MyCalendarEvent)message.getData()) >= 0) {
calendarModel.update((MyCalendarEvent)message.getData());
} else {
calendarModel.add((MyCalendarEvent)message.getData());
}
}
}
How does this code change to MVVM?
Asked: 2018-09-07 13:25:30 +0800
Seen: 16 times
Last updated: Sep 12 '18
[Announcement] ZK 8.5.1 is now available!
Highlight new release changes/new features in demo app
How can I make a button change its image by clicking on the same button?
Problems calling function 'sec:isAnyGranted' with zkspring 3.2 and Spring Security 4
webapp folder of ZK spring boot?
Can I set in runtime a new value to library property: org.zkoss.zk.ui.processMask.enabled:
Package ZK Eclipse Tomcat Project For Deployment
AImage org.zkoss.zk.ui.UiException: java.io.FileNotFoundException