0

How to use handMessage in calendar with MVVM mode? help me

asked 2018-09-07 13:25:30 +0800

JasonXu gravatar image JasonXu
105 1

How to use handMessage in calendar with MVVM mode? help me

delete flag offensive retag edit

4 Answers

Sort by ยป oldest newest most voted
0

answered 2018-09-12 11:56:38 +0800

hawk gravatar image hawk
3250 1 5
http://hawkphoenix.blogsp... ZK Team

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);
link publish delete flag offensive edit
0

answered 2018-09-11 10:47:26 +0800

hawk gravatar image hawk
3250 1 5
http://hawkphoenix.blogsp... ZK Team

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.

link publish delete flag offensive edit
0

answered 2018-09-11 14:42:41 +0800

JasonXu gravatar image JasonXu
105 1
//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?

link publish delete flag offensive edit
0

answered 2018-09-12 12:17:12 +0800

JasonXu gravatar image JasonXu
105 1

@hawk Thank you

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: 2018-09-07 13:25:30 +0800

Seen: 16 times

Last updated: Sep 12 '18

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