-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I have this code:
@GlobalCommand
@NotifyChange({ "showAddParticipantsSiteModal", "showAddSiteModal", "activitySession", "newParticipant"})
public void addSite(@BindingParam("type") String type, @BindingParam("site") ActivitySite site){
if (type.equals("participant")){
setShowAddParticipantsSiteModal(false);
getNewParticipant().setSite(site);
} else if (type.equals("activitySite")){
setShowAddSiteModal(false);
getActivitySession().setSite(site);
}
}
And it works, BUT, changing the order in the notifyChange variables to:
@GlobalCommand
@NotifyChange({ "activitySession", "newParticipant", "showAddParticipantsSiteModal", "showAddSiteModal"})
public void addSite(@BindingParam("type") String type, @BindingParam("site") ActivitySite site){
if (type.equals("participant")){
setShowAddParticipantsSiteModal(false);
getNewParticipant().setSite(site);
} else if (type.equals("activitySite")){
setShowAddSiteModal(false);
getActivitySession().setSite(site);
}
}
The values of the sites are not updated, the setSite 'does not do its job'. What's the reason for that? Note that the modals are the ones sending the new site to the global command.
Thanks in advance.
Asked: 2017-10-12 16:52:30 +0800
Seen: 6 times
Last updated: Oct 12 '17
How to Call Child ViewModel Method from Parent Window? [closed]
how can i get data from another page
MVVM Notifychange works only along with @Command ?
Notify Form of property change
@global-command, how to set queueName when invoke globalCommand?
Form validation before global command
are all your getters normal getters or do they have logic behind?
chillworld ( 2017-10-12 17:49:43 +0800 )editYes, they have no logic inside. In fact I also tried to set the whole object with setActivitySession() and it doesn't work either.
ajamardo ( 2017-10-12 18:11:52 +0800 )editIf it was me, I should check if there was no error thrown (but maybe catched an not logged) so the chain is broken. Normally the order doesn't have any impact because it's triggered after your method. But be aware for @DependsOn, that could trigger also.
chillworld ( 2017-10-12 18:34:03 +0800 )edit