devTellerMap_create.jsp 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. <%@ include file="../common/header.jsp" %>
  2. <script type="text/javascript" src="./js/autocomplete/jquery.js"></script>
  3. <script type='text/javascript' src='./js/autocomplete/jquery.bgiframe.min.js'></script>
  4. <script type='text/javascript' src='./js/autocomplete/jquery.ajaxQueue.js'></script>
  5. <script type='text/javascript' src='./js/autocomplete/thickbox-compressed.js'></script>
  6. <script type='text/javascript' src='./js/autocomplete/jquery.autocomplete.js'></script>
  7. <script type='text/javascript' src='./js/autocomplete/localdata.js'></script>
  8. <script type="text/javascript" language="javascript">
  9. <!--
  10. function doCreateOk() {
  11. var form = document.forms.devTellerMap;
  12. var message = "";
  13. var focus = false;
  14. if (trim(form.group.value).length == 0) {
  15. message = message + ("<bean:message key="error.devTellerMap.group" />\n");
  16. if (!focus) form.group.focus(); focus = true;
  17. }
  18. if (trim(form.deviceId.value).length == 0) {
  19. message = message + ("<bean:message key="error.devTellerMap.deviceId" />\n");
  20. if (!focus) form.deviceId.focus(); focus = true;
  21. }
  22. if (trim(form.deviceName.value).length == 0) {
  23. message = message + ("<bean:message key="error.devTellerMap.deviceName" />\n");
  24. if (!focus) form.deviceName.focus(); focus = true;
  25. }
  26. if (trim(form.terminalId.value).length == 0) {
  27. message = message + ("<bean:message key="error.devTellerMap.terminalId" />\n");
  28. if (!focus) form.terminalId.focus(); focus = true;
  29. }
  30. if (trim(form.terminalIp.value).length == 0) {
  31. message = message + ("<bean:message key="error.devTellerMap.terminalIp" />\n");
  32. if (!focus) form.terminalIp.focus(); focus = true;
  33. }
  34. if (trim(form.tellerId.value).length == 0) {
  35. message = message + ("<bean:message key="error.devTellerMap.tellerId" />\n");
  36. if (!focus) form.tellerId_id.focus(); focus = true;
  37. } else if (trim(form.tellerId_id.value).length == 0) {
  38. message = message + ("<bean:message key="error.devTellerMap.tellerId" />\n");
  39. if (!focus) form.tellerId_id.focus(); focus = true;
  40. }
  41. if (message == "") {
  42. var x = window.confirm("<bean:message key="confirm.create" />")
  43. if (x) {
  44. form.action.value="create_ok";
  45. form.submit();
  46. doDisable(form, "button");
  47. }
  48. } else {
  49. alert(message);
  50. }
  51. }
  52. function doChangeGroup() {
  53. var form = document.forms.devTellerMap;
  54. form.tellerId_id.value = "";
  55. }
  56. $(function() {
  57. function format(jsonmap) {
  58. return jsonmap.tellerId+ " - " +jsonmap.tellerName+ " - " +jsonmap.ctrlUnitId;
  59. }
  60. $("#tellerId_id").autocomplete('devTellerMap.do?action=loadTeller', {
  61. dataType: "json",
  62. parse: function(data) {
  63. return $.map(data, function(row) {
  64. return {
  65. data: row,
  66. value: row.tellerName,
  67. result: row.tellerName
  68. }
  69. });
  70. },
  71. formatItem: function(jsonmap) {
  72. return format(jsonmap);
  73. },
  74. extraParams:{ group:function(){ return $("#group_id").val();} }
  75. }).result(function(e, jsonmap) {
  76. //after select
  77. $("#tellerId_id").val(format(jsonmap));
  78. $("#tellerId").val(jsonmap.tellerId);
  79. $("#tellerName").val(jsonmap.tellerName);
  80. $("#ctrlUnitId").val(jsonmap.ctrlUnitId);
  81. });
  82. });
  83. function doReloadTeller() {
  84. var form = document.forms.devTellerMap;
  85. var message = "";
  86. var group = form.group.value;
  87. if (trim(group).length == 0) {
  88. message = message + ("<bean:message key="error.devTellerMap.group" />\n");
  89. if (!focus) form.group.focus(); focus = true;
  90. }
  91. if (message == "") {
  92. var req = createXMLHttpRequest();
  93. try {
  94. var url = "devTellerMap.do?action=reloadTeller&group=" +group+ "&ts=" +new Date().getTime();
  95. req.open("GET", url);
  96. req.onreadystatechange = function(){
  97. if (req.readyState < 4){
  98. document.getElementById('tellerId_div').innerHTML = "<img src='./images/wait.gif' border=0 >&nbsp;<b>Please Wait...<\/b>";
  99. }
  100. if (req.readyState == 4){
  101. document.getElementById('tellerId_div').innerHTML = "";
  102. }
  103. }
  104. req.send(null);
  105. } catch(e) {
  106. alert(e);
  107. }
  108. } else {
  109. alert(message);
  110. }
  111. }
  112. -->
  113. </script>
  114. <!-- CONTENT -->
  115. <form name="devTellerMap" method="post" action="devTellerMap.do">
  116. <input type="hidden" name="action">
  117. <input type="hidden" name="clear">
  118. <input type="hidden" name="ctrlUnitId" id="ctrlUnitId" value="<logic:notEmpty name="devTellerMap"><bean:write name="devTellerMap" property="ctrlUnitId" /></logic:notEmpty>">
  119. <input type="hidden" name="itemFocus" value="group">
  120. <input type="hidden" name="redirect" value="create">
  121. <input type="hidden" name="sequence">
  122. <input type="hidden" name="tellerName" id="tellerName" value="<logic:notEmpty name="tellerName"><bean:write name="tellerName" /></logic:notEmpty>">
  123. <input type="hidden" name="tellerId" id="tellerId" value="<logic:notEmpty name="devTellerMap"><bean:write name="devTellerMap" property="tellerId" /></logic:notEmpty>">
  124. <table width="100%" border="0" align="center" cellpadding="2" cellspacing="4">
  125. <tr>
  126. <td class="titleHeader" align="left"><bean:message key="project.devTellerMap.key" /> CREATE</td>
  127. </tr>
  128. </table>
  129. <table width="100%" border="0" align="center" cellpadding="2" cellspacing="4">
  130. <tr>
  131. <td align="center">
  132. <table width="100%" border="0" cellspacing="1" cellpadding="2">
  133. <tr><td colspan="6"><html:errors/></td></tr>
  134. <tr>
  135. <td width="15%"><b><bean:message key="devTellerMap.group.key"/> <font color="#FF0000">*</font></b></td>
  136. <td width="10">:</td>
  137. <td width="30%">
  138. <select name="group" style="width:200" id="group_id" onchange="doChangeGroup();">
  139. <option value="">-- Select Group --</option>
  140. <logic:notEmpty name="groupList">
  141. <logic:iterate id="element_group" name="groupList" >
  142. <option value="<bean:write name="element_group" property="name" />"
  143. <logic:notEmpty name="devTellerMap" property="group">
  144. <logic:equal name="devTellerMap" property="group" value="${element_group.name}">
  145. selected
  146. </logic:equal>
  147. </logic:notEmpty>
  148. ><bean:write name="element_group" property="name" /></option>
  149. </logic:iterate>
  150. </logic:notEmpty>
  151. </select>
  152. </td>
  153. <td width="5%">&nbsp;</td>
  154. <td width="15%">&nbsp;</td>
  155. <td width="10">&nbsp;</td>
  156. <td width="30%">&nbsp;</td>
  157. </tr>
  158. <tr>
  159. <td width="15%"><b><bean:message key="devTellerMap.deviceId.key"/> <font color="#FF0000">*</font></b></td>
  160. <td width="10">:</td>
  161. <td width="30%">
  162. <html:text name="devTellerMap" property="deviceId" size="30"/>
  163. </td>
  164. <td width="5%">&nbsp;</td>
  165. <td width="15%">&nbsp;</td>
  166. <td width="10">&nbsp;</td>
  167. <td width="30%">&nbsp;</td>
  168. </tr>
  169. <tr>
  170. <td width="15%"><b><bean:message key="devTellerMap.deviceName.key"/> <font color="#FF0000">*</font></b></td>
  171. <td width="10">:</td>
  172. <td width="30%">
  173. <html:text name="devTellerMap" property="deviceName" size="30"/>
  174. </td>
  175. <td width="5%">&nbsp;</td>
  176. <td width="15%">&nbsp;</td>
  177. <td width="10">&nbsp;</td>
  178. <td width="30%">&nbsp;</td>
  179. </tr>
  180. <tr>
  181. <td width="15%"><b><bean:message key="devTellerMap.terminalId.key"/> <font color="#FF0000">*</font></b></td>
  182. <td width="10">:</td>
  183. <td width="30%">
  184. <html:text name="devTellerMap" property="terminalId" size="30"/>
  185. </td>
  186. <td width="5%">&nbsp;</td>
  187. <td width="15%">&nbsp;</td>
  188. <td width="10">&nbsp;</td>
  189. <td width="30%">&nbsp;</td>
  190. </tr>
  191. <tr>
  192. <td width="15%"><b><bean:message key="devTellerMap.terminalIp.key"/> <font color="#FF0000">*</font></b></td>
  193. <td width="10">:</td>
  194. <td width="30%">
  195. <html:text name="devTellerMap" property="terminalIp" size="30"/>
  196. </td>
  197. <td width="5%">&nbsp;</td>
  198. <td width="15%">&nbsp;</td>
  199. <td width="10">&nbsp;</td>
  200. <td width="30%">&nbsp;</td>
  201. </tr>
  202. <tr>
  203. <td width="15%"><b><bean:message key="devTellerMap.tellerId.key"/> <font color="#FF0000">*</font></b></td>
  204. <td width="10">:</td>
  205. <td width="30%">
  206. <input type="text" name="tellerId_id" size="50" id="tellerId_id" value="<logic:notEmpty name="combine"><bean:write name="combine" /></logic:notEmpty>">
  207. <input type="button" value="<bean:message key="button.reload"/>" onclick="javascript:doReloadTeller();">
  208. <div id="tellerId_div" align="left">&nbsp;</div>
  209. </td>
  210. <td width="5%">&nbsp;</td>
  211. <td width="15%">&nbsp;</td>
  212. <td width="10">&nbsp;</td>
  213. <td width="30%">&nbsp;</td>
  214. </tr>
  215. <tr>
  216. <td width="15%"></td>
  217. <td width="10"></td>
  218. <td width="30%">
  219. <input type="button" value="<bean:message key="button.submit"/>" onclick="javascript:doCreateOk();">
  220. </td>
  221. <td colspan="4">&nbsp;</td>
  222. </tr>
  223. </table>
  224. </td>
  225. </tr>
  226. <tr>
  227. <td>&nbsp;</td>
  228. </tr>
  229. </table>
  230. </form>
  231. <!-- END CONTENT -->
  232. <logic:notEmpty name="focus"><bean:write name="focus" filter="false" /></logic:notEmpty>
  233. <%@ include file="../common/footer.jsp"%>