-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#2824 Fixed event handlers new xid not displaying after saving edit form #2959
Changes from 3 commits
c4b3c6a
fa04fe7
dad45e3
302c17e
25ccc99
e9247d2
2551734
8052cb6
dbd759d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -456,36 +456,43 @@ | |
var xid = $get("xid"); | ||
var alias = $get("alias"); | ||
var disabled = $get("disabled"); | ||
if (handlerType == <c:out value="<%= EventHandlerVO.TYPE_EMAIL %>"/>) { | ||
var messages = []; | ||
if (!(isNotEmpty(xid)) && handlerId !== ${NEW_ID}){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
validateValue("xid", "<fmt:message key='validate.valueRestored'/>", isNotEmpty, xid, messages) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove use validateValue: |
||
$set("xid", selectedHandlerNode.object.xid); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added lines:
|
||
} | ||
if(messages.length > 0){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if to delete |
||
stopImageFader("saveImg"); | ||
showDwrMessages(messages); | ||
} | ||
else { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What comes after ifa needs to be restored. |
||
if (handlerType == <c:out value="<%= EventHandlerVO.TYPE_EMAIL %>"/>) { | ||
var emailList = emailRecipients.createRecipientArray(); | ||
var escalList = escalRecipients.createRecipientArray(); | ||
var inactiveList = inactiveRecipients.createRecipientArray(); | ||
EventHandlersDwr.saveEmailEventHandler(selectedEventTypeNode.object.typeId, | ||
selectedEventTypeNode.object.typeRef1, selectedEventTypeNode.object.typeRef2, handlerId, xid, alias, | ||
disabled, emailList, $get("sendEscalation"), $get("escalationDelayType"), $get("escalationDelay"), | ||
escalList, $get("sendInactive"), $get("inactiveOverride"), inactiveList, saveEventHandlerCB); | ||
} | ||
else if (handlerType == <c:out value="<%= EventHandlerVO.TYPE_SMS %>"/>) { | ||
} else if (handlerType == <c:out value="<%= EventHandlerVO.TYPE_SMS %>"/>) { | ||
var smsList = smsRecipients.createRecipientArray(); | ||
EventHandlersDwr.saveSmsEventHandler(selectedEventTypeNode.object.typeId, | ||
selectedEventTypeNode.object.typeRef1, selectedEventTypeNode.object.typeRef2, handlerId, xid, alias, disabled, smsList, saveEventHandlerCB); | ||
} | ||
else if (handlerType == <c:out value="<%= EventHandlerVO.TYPE_SET_POINT %>"/>) { | ||
} else if (handlerType == <c:out value="<%= EventHandlerVO.TYPE_SET_POINT %>"/>) { | ||
EventHandlersDwr.saveSetPointEventHandler(selectedEventTypeNode.object.typeId, | ||
selectedEventTypeNode.object.typeRef1, selectedEventTypeNode.object.typeRef2, handlerId, xid, alias, | ||
disabled, $get("targetPointSelect"), $get("activeAction"), $get("setPointValueActive"), | ||
$get("activePointId"), $get("inactiveAction"), $get("setPointValueInactive"), | ||
$get("inactivePointId"), saveEventHandlerCB); | ||
} | ||
else if (handlerType == <c:out value="<%= EventHandlerVO.TYPE_PROCESS %>"/>) { | ||
} else if (handlerType == <c:out value="<%= EventHandlerVO.TYPE_PROCESS %>"/>) { | ||
EventHandlersDwr.saveProcessEventHandler(selectedEventTypeNode.object.typeId, | ||
selectedEventTypeNode.object.typeRef1, selectedEventTypeNode.object.typeRef2, handlerId, xid, | ||
alias, disabled, $get("activeProcessCommand"), $get("inactiveProcessCommand"), saveEventHandlerCB); | ||
} | ||
else if (handlerType == <c:out value="<%= EventHandlerVO.TYPE_SCRIPT %>"/>) { | ||
} else if (handlerType == <c:out value="<%= EventHandlerVO.TYPE_SCRIPT %>"/>) { | ||
EventHandlersDwr.saveScriptEventHandler(selectedEventTypeNode.object.typeId, | ||
selectedEventTypeNode.object.typeRef1, selectedEventTypeNode.object.typeRef2, handlerId, xid, | ||
alias, disabled, $get("activeScriptCommand"), $get("inactiveScriptCommand"), saveEventHandlerCB); | ||
} | ||
} | ||
} | ||
|
||
|
@@ -508,7 +515,6 @@ | |
|
||
selectedHandlerNode.object = handler; | ||
} | ||
$set("xid", handler.xid); | ||
} | ||
|
||
function deleteHandler() { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -325,7 +325,12 @@ private DwrResponseI18n save(int eventSourceId, int eventTypeRef1, | |
EventService eventService = new EventService(); | ||
|
||
vo.setId(handlerId); | ||
vo.setXid(StringUtils.isEmpty(xid) ? eventService.generateUniqueXid() : xid); | ||
if (StringUtils.isEmpty(xid) && handlerId == Common.NEW_ID) { | ||
vo.setXid(StringUtils.isEmpty(xid) ? eventService.generateUniqueXid() : xid); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. vo.setXid(eventService.generateUniqueXid()); |
||
} | ||
else { | ||
vo.setXid(xid); | ||
} | ||
vo.setAlias(alias); | ||
vo.setDisabled(disabled); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2989,6 +2989,7 @@ validate.required=Required value | |
validate.text.incompatible=Text renderer is incompatible with data type | ||
validate.event.incompatible=Event text renderer is incompatible with data type | ||
validate.xidUsed=This XID is already in use | ||
validate.valueRestored=Previous value restored | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok. |
||
viewEdit.addViewComponent=Add component to view | ||
viewEdit.anonymous=Anonymous access | ||
viewEdit.background=Background image | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
messages to delete