return
日本語
中文
English
web/myPage.jsp
--------------------------------------------------------------------------------
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="efw" uri="efw" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<efw:Core/>
<efw:JQueryUI/>
<efw:InputBehavior/>
<script>
var param1="<%=request.getParameter("param1")%>";
function bodyLoad(){
efw.client.fire({
eventId:"form1_event1",
...
success:function(data){
window.location="next.jsp?param1="+param1;
},
});
...
}
</script>
</head>
<body onload="bodyLoad()">
<input id="txt_testnumber" type="text" data-format="#,##0.00">
<input id="txt_testdate" type="text" data-format="yyyy-MM-dd">
...
</body>
</html>
- The jsp file.
<efw:Core/>
<efw:JQueryUI/>
<efw:InputBehavior/>
-
If you declare the tag library of efw and add the efw tag, you can use the function of efw.client.
Tag |
Description |
<efw:Core/> |
To include the function of efw core. Required. |
<efw:JQueryUI/> |
To include the function of JQueryUI. Optional. |
<efw:InputBehavior/> |
To include the function of input support. Optional. You can change the style sheet for input support by customizing efw.css . |
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
-
All files of Efw are UTF-8 encode. But you can change the encode and charset of jsp by you self.
File |
Encode & Charset |
Description |
efw/efw.client.messages.js |
UTF-8 |
The encode of the client message file is fixed to UTF-8. |
efw/efw.server.messages.js |
UTF-8 |
The encode of the server message file is fixed to UTF-8. |
jsp pageEncoding |
UTF-8 is recommended |
The encode and charset of jsp page is set to UTF-8. It can be changed as you like. |
jsp charset |
UTF-8 recommended |
The encode and charset of jsp page is set to UTF-8. It can be changed as you like. |
jsp meta charset |
same to jsp charset |
- |
event js |
UTF-8 |
The encode of the server js file is fixed to UTF-8. |
sql xml |
UTF-8 is recommended |
The encode and charset of server xml is set to UTF-8. It can be changed as you like. |
var param1="<%=request.getParameter("param1")%>";
window.location="next.jsp?param1="+param1;
-
The data receiving from another page is recommented to use request.getParameter. And the data sending is recommended to use URL paramter as usual.
And the page transition is recommended to use URL calling as usual. Form post, session, cookie can be used if it is necessary.
efw.client.fire({
eventId:"form1_event1",
...
success:function(eventResult){
...
},
});
-
The data Receipt and delivery of events is written in the server side js files, not the client js files.
But if the success function is necessary to do with the Received data, you must know the eventResult. See the detail by API efw.client.fire .
<input id="txt_testnumber" type="text" data-format="#,##0.00">
<input id="txt_testdate" type="text" data-format="yyyy-MM-dd">
-
Input support will work if you import efw:InputBehavior tag and set the data-format attribute of the input element.
data-format |
Dvent |
Description |
#,##0.00 |
focus |
To change the value of text box to number without format. 1,234.00 ⇒ 1234 |
#,##0.00 |
blur |
To change the value of text box to number with format. The value will be blank iff it can not be formatted. 1234 ⇒ 1,234.00, ABCD ⇒ [] |
yyyy-MM-dd |
focus |
To change the value of text box to number without format. 2015-12-31 ⇒ 20151231 |
yyyy-MM-dd |
blur |
To change the value of text box to number with format. The value will be blank iff it can not be formatted. 20151231 ⇒ 2015-12-31, ABCD ⇒ [] |
フォーマットの書き方の詳細はAPIの formatter を参照。
<input id="btn_save" type="button" data-shortcut="CTRL+S">
<input id="btn_cancel" type="button" data-shortcut="F6">
-
efw:InputBehavior をインクルードして、ボタンに data-shortcut を定義する場合、ショットカットの動きを行う。
data-shortcut |
説明 |
F1~F12 |
フォクションキー。 |
CTRL+A~CTRL+Z |
コントロールキー。 |
ALT+A~ALT+Z |
オルトキー。 |