Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <xp:eventHandler event="onchange" submit="true"
- refreshMode="norefresh" disableValidators="true"
- onComplete="XSP.openDialog('#{id:dialog1}')">
- <xp:this.action><![CDATA[#{javascript:var bundleID = getComponent("inputBundleID").getValue();
- if (bundleID == "") {
- return;
- } else {
- var noteID = @DbLookup(@DbName(),"AllBundlesID",bundleID,"$12");
- if (@IsError(noteID)) {
- viewScope.put("noteId","NEW");
- } else {
- viewScope.put("noteId",noteID);
- }
- };
- document1.save();}]]></xp:this.action>
- <xp:this.script><![CDATA[var bundleFieldId = '#{javascript:getClientId("inputBundleID")}';
- var bundleId = document.getElementById(bundleFieldId).value;
- if (bundleId == "") {
- return false;
- }
- var trayFieldId = '#{javascript:getClientId("inputStorageTrayID")}';
- var trayId = document.getElementById(trayFieldId).value;
- if (trayId == "") {
- alert('Storage Tray ID cannot be blank');
- return false;
- } else {
- return true;
- }]]></xp:this.script>
- <xp:this.onComplete><![CDATA[[#{javascript:if (viewScope.get("noteId") != "NEW") {
- return XSP.openDialog('#{id:dialog1}');
- } else {
- alert('Create and save the document - TBD how to do it');
- }}]]></xp:this.onComplete>
- @If(@IsError(noteID)) {
- view.postScript("alert('Create and save new doc');");
- } else {
- view.postScript("XSP.openDialog('#{id:dialog1}');");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement