InputJsonの使用
InputJsonパラメータを使用しデータをバインディングします。
inputjsonパラメータの使用
アプリケーションは、予約パラメーターのinputjsonを使用し、JSON形式の値をOZRまたはOZDのコンポーネントに渡すことができます。
OZRファイルにパラメーターを定義する必要はありません。OZビューアーは、JSON形式の値をフォーム内の対応するコンポーネントに自動的に渡します。
JSON文字列の項目名は、各コンポーネントのFormIDと一致する必要があります。
JSON文字列はエスケープ処理をする必要があります。
<script type="text/javascript" >
var serverUrl = "https://" + location.host;
var inputjson = "{\"memberNo\":\"1001\",\"photo\":\"\",\"firstName\":\"ICHIRO\",\"lastName\":\"NAKAMURA\",\"yyyy\":\"1989\",\"mm\":\"09\",\"dd\":\"05\",\"gender\":\"M\",\"contactNo\":\"333-5555-7778\",\"email\":\"[email protected]\",\"memberType\":\"Premium\",\"fromDate\":\"2019-12-24\",\"toDate\":\"2020-12-24\",\"cardType\":\"SCBANK\",\"cardNo\":\"1111-2222-3333-4444\",\"cardExpMM\":\"12\",\"cardExpYY\":\"24\"}";
function SetOZParamters_OZViewer(){
var oz = document.getElementById("OZViewer");
oz.sendToActionScript("information.debug", "true"); // viewer console
oz.sendToActionScript("connection.servlet",serverUrl + "/oz/server");
oz.sendToActionScript("connection.reportname","/eform/membership.ozr");
oz.sendToActionScript("connection.inputjson", inputjson);
oz.sendToActionScript("etcmenu.copyinputdata_json", "true"); // enable [Copy input data (json)] option in etc menu
return true;
}
start_ozjs("OZViewer", serverUrl + "/oz/HTML5viewer/");
</script>
最終更新
役に立ちましたか?