/ * ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------- *
* Page initialization work: *
* JS_IO_SMARTINPUT_BUILDDIV (); // Building a layer when the [Display Layer page] is initialized *
* Document.onkeyDown = JS_IO_SMARTINPUT_RESPONSEUPDOWNENTERKEY; *
* // In the [Layer Embedded Page] Response "On, Determine" Event *
* ------------------------------------------------- ----------------------- * /
/ *** @Param OBJ: Cascum Into "Text Box Object" * @Param Urlname: Query page "SmartInput.jsp" relative to "page of this control" * @Param SmartInputsql: SQL statement * @Param BackcellsName: Returns the list of fields, requires: 1. The first is the "new" identification name (its value is 0: new, 1: Remove from the database) * Requires each field on the page requires unique, its order Companied with SQL) " ] Separate * @Param Viewcellsindex: The field you need to display in the "Query Field List" start from 0, each field is separated from [:].
* @Param isshowwidget [This value is obtained from > DEFAULT = 1]: The control is to be displayed, 0: Hide 1 and Other: Display * @Param isneWallow [This value is from Get, Default = 1]: Do you allow users to add parameter parameters, 0: Do not allow 1: Accessible If [0: Do not allow]: Use the [ESC] button, or [Tab] button, or click on the control. [X], the content input by the user to empty out * * / function js_io_smartInput_onfocus (obj, urlName, smartInputSQL, backCellsName, viewCellsName, viewCellsIndex) {var isShowWidget = obj.getAttribute ( "isShowWidget"); if (isShowWidget == null || isshowwidget == "" "{isshowwidget =" 1 ";} var isnewallow = obj.getattribute (" isnewallow "); if (isnewallow == null || isneWallow ==") {isneWallow = "1";} if (isShowWidget == "1") {// set parameters (into cookie) var smartInputName = obj.name; // contains smartInput control 'input with the name' js_io_smartInput_setParam (smartInputSQL, backCellsName, viewCellsName, viewCellsIndex, isNewAllow, isShowWidget , SmartInputName); JS_IO_SMARTINPUT_FILLFRAME ('SmartInputFrame', URLNAME); // Filled layer JS_IO _SmartInput_texttail (); // When the text box gets focus, the cursor is in the text last} else {js_io_smartinput_setcookie ("IssshowWidget", "0");}} / * @ Change Layer embedded page @Param Myframe: Frame name @Param URL: Page URL * / Function JS_IO_SMARTINPUT_FILLFRAME (MyFrame, URL) {var cal = url; // acquire the frame Cal.SRC = URL;}
// set the parameter (put cookie) function js_io_smartInput_setParam (smartInputSQL, backCellsName, viewCellsName, viewCellsIndex, isNewAllow, isShowWidget, smartInputName) {// clear the original value of Cookie / * js_io_smartInput_clearCookie ( "smartInputSQL"); js_io_smartInput_clearCookie ( "backCellsName"); js_io_smartInput_clearCookie ( "viewCellsName"); js_io_smartInput_clearCookie ( "viewCellsIndex"); js_io_smartInput_clearCookie ( "isNewAllow"); js_io_smartInput_clearCookie ( "smartInputName"); js_io_smartInput_clearCookie ( "isShowWidget"); * / // set the new Cookie js_io_smartInput_setCookie ( "smartInputSQL", smartInputSQL ); js_io_smartInput_setCookie ( "backCellsName", backCellsName); js_io_smartInput_setCookie ( "viewCellsName", viewCellsName); js_io_smartInput_setCookie ( "viewCellsIndex", viewCellsIndex); js_io_smartInput_setCookie ( "isNewAllow", isNewAllow); js_io_smartInput_setCookie ( "smartInputName", smartInputName); js_io_smartInput_setCookie ( " Isshowwidget ", ISSHOWIDGET);
/ ** * text box response user keyboard action * @Param Obj: text box object * @Param mycolor: highlight color * * / function js_io_smartinput_responseKey (Obj, mycolor) {var cal = document.getlementByid ("MartInputdiv") ; If (JS_IO_SMARTINPUT_GETCOOKIE ("IsshowWidget") == "1") {if (event.keycode == 27 || Event.keycode == 9) {// key [esc] [Tab] if (Cal.Style.Display ! = "none") {JS_IO_SMARTINPUT_CLOSEDIV ();}} else if (event.keycode == 40) {// Down arrow: Move the focus to SmartInput box // If the control is allowed, and the control is hidden, then it appear if (cal.style.display == "none") {js_io_smartInput_showDiv (obj); // display layer} else {js_io_smartInput_goDown ( 'smartInputBody', 'smartInputTable', myColor);}} else if (event.keyCode == 13 || Event.keycode == 20 || Event.keycode == 16 || Event.KeyCode == 17) {} else {if (JS_IO_SMARTINPUT_GETCOOKIE ("IsshowWidget") == "1" && ca.style. Display == "none") {js_io_smartinput_showdiv (obj); // Display Layer} JS_IO_SMARTINPUT_REF ( Obj); // Other keys: Execute SmartInput function}}} / * Clear input content * @ param backcellsname: Need to empty name string, each name is ":" Separate * / function js_io_smartInput_clearinput (CellsArray ) {For (var i = 1; i / * Click "Down Key", the function moves the focus to "layer", and highlights the first line of "Query Results" @Param SmartInputBody: Frame Inside the page Body ID such as: