Hamoe

Untitled

Jul 8th, 2014
415
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var dialog = {
  2.  
  3.                 //Creates checkboxes and text entry field variables and initalizes them. Add new variables and initialize them here.
  4.        
  5.         cBox01:false,
  6.         cBox02:false,
  7.         cBox03:false,
  8.         cBox04:false,
  9.                 cBox05:false,
  10.         UserName: "",
  11.         Date: "",
  12.  
  13.         commit:function (dialog) { // called when OK pressed
  14.                 var results = dialog.store();
  15.                 //Stores values of what users entered into each checkbox or text entry field. These use the "item_id" of the associated element (See next section).
  16.                 this.cBox01 = results["Chk1"]
  17.                 this.cBox02 = results["Chk2"]
  18.                 this.cBox03 = results["Chk3"]
  19.                 this.cBox04 = results["Chk4"]
  20.                                 this.cBox05 = results["Chk5"]
  21.                 this.UserName = results["txt2"]
  22.                 this.Date = results["txt1"]
  23.         },      
  24.  
  25.         description:
  26.         {      
  27.                 name: "Custom Stamp Dialog Box",    // Dialog box title
  28.                 elements:
  29.                 [      
  30.                         {      
  31.                                 type: "view",
  32.                                 elements:
  33.                                 [
  34.  
  35.      
  36. // Note: 'static_text" and "edit_text" are used together
  37. // Note: "static_text" is the label for the "edit_text"
  38. // Note: "static_text" is a static text label
  39. // Note: "edit_text" is a edit text field to enter in text                 
  40.  
  41. // Next elements are check boxes. Copy the below bracketed block to make a new checkbox.                   
  42.                                         {      
  43.                                                 type: "check_box",
  44.                                                 item_id: "Chk1",
  45.                                                 name: "Approved"
  46.                                         },
  47.                                        
  48.                                         {      
  49.                                                 type: "check_box",
  50.                                                 item_id: "Chk2",
  51.                                                 name: "Approved as Corrected"
  52.                                         },
  53.                                        
  54.                                         {      
  55.                                                 type: "check_box",
  56.                                                 item_id: "Chk3",
  57.                                                 name: "Revise and Resubmit"
  58.                                         },
  59.                                        
  60.                                         {      
  61.                                                 type: "check_box",
  62.                                                 item_id: "Chk4",
  63.                                                 name: "Rejected"
  64.                                         },
  65.                                         {      
  66.                                                 type: "check_box",
  67.                                                 item_id: "Chk5",
  68.                                                 name: "For Information Only"
  69.                                         },
  70.  
  71.                                        
  72. // Next elements are the Approved by and Date fields. You will need to copy both the static_text and edit_text bracketed sections to make a new text field.
  73.  
  74.                                         {      
  75.                                                 name: "Date:",
  76.                                                 type: "static_text",
  77.                                         },
  78.  
  79.                                         {
  80.                                                 item_id: "txt1",
  81.                                                 type: "edit_text",
  82.                                                 defaultValue: "this.getField("Date").value = util.printd("m/dd/yyyy", new Date());",
  83.                                                 multiline: false,
  84.                                                 width: 250,
  85.                                                 height: 30
  86.                                         },
  87.  
  88. //New text field
  89.  
  90.                                         {      
  91.                                                 name: "Approved By:",
  92.                                                 type: "static_text",
  93.                                         },      
  94.                                         {      
  95.                                                 item_id: "txt2",
  96.                                                 type: "edit_text",
  97.                                                 defaultValue:"this.getField("UserName").value = util.println(Collab.user);",
  98.                                                 multiline: false,
  99.                                                 width: 250,
  100.                                                 height: 30
  101.                                         },
  102.  
  103. // Next element is the Ok and Cancel buttons. DO NOT REMOVE THESE.                                     
  104.                                         {      
  105.                                                 type: "ok_cancel",
  106.                                                 ok_name: "Ok",
  107.                                                 cancel_name: "Cancel"
  108.                                         },      
  109.                                 ]      
  110.                         },      
  111.                 ]      
  112.         }      
  113. };
Advertisement
Add Comment
Please, Sign In to add comment