Advertisement
Guest User

register.zul

a guest
Aug 20th, 2014
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.13 KB | None | 0 0
  1. <?page id="register" title="Form Register" contentType="text/html;charset=UTF-8"?>
  2. <zk>
  3. <window id="wndRegister" title="Form Register Karyawan" border="normal" width="500px" height="400px">
  4. <grid>
  5. <columns>
  6. <column width="30%"/>
  7. <column width="70%"/>
  8. </columns>
  9. <rows>
  10. <row>
  11. <label value="NAMA"/>
  12. <textbox id="nama" width="90%" focus="true" onOK="gender.focus()"/>
  13.  
  14. </row>
  15. <row>
  16. <label value="GENDER"/>
  17. <listbox id="gender" mold="select" width="100px">
  18. <listitem label="PRIA" value="P" selected="true"/>
  19. <listitem label="WANITA" value="W"/>
  20. </listbox>
  21. </row>
  22. <row>
  23. <label value="TEMPAT/TGL. LAHIR"/>
  24. <hbox>
  25. <textbox id="tempat" width="100px" onOK="tgllahir.focus()"/>
  26. <button label="?" width="30px" onClick="panggilKota()"/>
  27. <datebox id="tgllahir" width="100px" format="dd/MM/yyyy" onCreate="self.value = new Date()"/>
  28. </hbox>
  29. </row>
  30. <row>
  31. <label value="GAJI"/>
  32. <decimalbox id="gaji" format="##,###.##"/>
  33. </row>
  34. <row>
  35. <label value=""/>
  36. <button id="btn" label="SIMPAN" onClick="simpan1()"/>
  37. </row>
  38. </rows>
  39. </grid>
  40. <listbox id="lstData" width="100%" rows="3" mold="paging" pageSize="3" pagingPosition="top">
  41. <listhead>
  42. <listheader label="NAMA" sort="auto" width="30%"/>
  43. <listheader label="P/W" sort="auto" width="10%"/>
  44. <listheader label="TEMPAT" sort="auto" width="20%"/>
  45. <listheader label="TGL.LAHIR" sort="auto" width="20%"/>
  46. <listheader label="GAJI" sort="auto" width="20%"/>
  47. </listhead>
  48.  
  49. </listbox>
  50.  
  51. <zscript>
  52. void panggilKota(){
  53. Window w = (Window)Executions.getCurrent().createComponents("kota.zul", null, null);
  54. w.doModal();
  55. }
  56.  
  57. void simpan1(){
  58. Listitem li = new Listitem();
  59. li.appendChild(new Listcell(nama.getValue()));
  60. li.appendChild(new Listcell(gender.getSelectedItem().getValue()));
  61. li.appendChild(new Listcell(tempat.getValue()));
  62. li.appendChild(new Listcell(tgllahir.getText()));
  63. li.appendChild(new Listcell(gaji.getText()));
  64.  
  65. lstData.appendChild(li);
  66.  
  67. nama.setValue("");
  68. gender.setSelectedIndex(0);
  69. tempat.setValue("");
  70. tgllahir.setText("");
  71. gaji.setText("");
  72. nama.setFocus(true);
  73. }
  74.  
  75. void simpan(){
  76. Messagebox.show("Nama: " + nama.getValue() +
  77. "\nGender: " + gender.getSelectedItem().getValue() +
  78. "\nTempat: " + tempat.getValue() +
  79. "\nTgl. Lahir: " + tgllahir.getText() +
  80. "\nGaji: " + gaji.getValue() );
  81.  
  82. System.out.println("Gender: " + gender.getSelectedItem().getLabel());
  83.  
  84. Listitem li = new Listitem();
  85. li.appendChild(new Listcell(nama.getValue()));
  86. li.appendChild(new Listcell(gender.getSelectedItem().getValue()));
  87. li.appendChild(new Listcell(tempat.getValue()));
  88. li.appendChild(new Listcell(tgllahir.getText()));
  89. li.appendChild(new Listcell(gaji.getText()));
  90.  
  91. lstData.appendChild(li);
  92. }
  93. </zscript>
  94. </window>
  95. </zk>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement