Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. <xp:eventHandler event="onchange" submit="true"
  2. refreshMode="norefresh" disableValidators="true"
  3. onComplete="XSP.openDialog('#{id:dialog1}')">
  4. <xp:this.action><![CDATA[#{javascript:var bundleID = getComponent("inputBundleID").getValue();
  5. if (bundleID == "") {
  6. return;
  7. } else {
  8. var noteID = @DbLookup(@DbName(),"AllBundlesID",bundleID,"$12");
  9. if (@IsError(noteID)) {
  10. viewScope.put("noteId","NEW");
  11. } else {
  12. viewScope.put("noteId",noteID);
  13. }
  14. };
  15. document1.save();}]]></xp:this.action>
  16.  
  17. <xp:this.script><![CDATA[var bundleFieldId = '#{javascript:getClientId("inputBundleID")}';
  18. var bundleId = document.getElementById(bundleFieldId).value;
  19. if (bundleId == "") {
  20. return false;
  21. }
  22. var trayFieldId = '#{javascript:getClientId("inputStorageTrayID")}';
  23. var trayId = document.getElementById(trayFieldId).value;
  24. if (trayId == "") {
  25. alert('Storage Tray ID cannot be blank');
  26. return false;
  27. } else {
  28. return true;
  29. }]]></xp:this.script>
  30.  
  31. <xp:this.onComplete><![CDATA[[#{javascript:if (viewScope.get("noteId") != "NEW") {
  32. return XSP.openDialog('#{id:dialog1}');
  33. } else {
  34. alert('Create and save the document - TBD how to do it');
  35. }}]]></xp:this.onComplete>
  36.  
  37. @If(@IsError(noteID)) {
  38. view.postScript("alert('Create and save new doc');");
  39. } else {
  40. view.postScript("XSP.openDialog('#{id:dialog1}');");
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement