<?xml version="1.0" encoding="UTF-8" ?>
<jsp:root
	xmlns:jsp="http://java.sun.com/JSP/Page"
	xmlns:og="hybs-taglib.tld"
	version="2.0">
<jsp:directive.page language="java" contentType="text/html; charset=UTF-8" />

<og:head headType="result" />
<jsp:directive.include file="/jsp/custom/result_info.jsp" />
<og:comment
	system	= "GF:エンジンサンプル"
	pgid	= "GFX013/result"
	title	= "DB登録"
	date	= "yyyy/MM/dd"
	author	= "Hiroki.Nakamura"
	text	= "Hiroki.Nakamura"
	version	= "001"
/>

<!-- ワーニングメッセージです。ここでは、登録完了のメッセージを表示します。 -->
<og:errorMessage command="{@command}" clear="{@clear}" displayMsg="{@displayMsg}" />
<!-- 入力チェック -->
<og:columnCheck
	command   = "{@command}"
	nullCheck = "TABLE_NAME"
/>

<og:equals val1="{@ACTION}" val2="{@ACTION}">
	<og:columnCheck
		command   = "{@command}"
		nullCheck = "masterKeys"
	/>
</og:equals>

<og:equals val1="{@ACTION}" val2="DIFFERENCE">
	<og:columnCheck
		command   = "{@command}"
		nullCheck = "diffKeys"
	/>
</og:equals>

<og:value command="SET" key="C_KEYS" value="{@CLMS}" action="APPEND" />

<!-- 取り消しボタンが押された時に必要です。 -->
<og:entry command="{@command}" />

<!-- DB検索 SQL文記述 debug="true" でSQL文を確認できます。-->
<og:query command="{@command}" dbid="{@DBID}" maxRowCount="{@maxRowCount}" quotCheck="false" >
		select {@C_KEYS},ROWID
		from {@TABLE_NAME} A
	<og:where>
		<og:and value = "{@CLM__0} {@CONDITION__0} '{@VALUE__0}'"	/>
		<og:and value = "{@CLM__0} {@CONDITION__0} '{@VALUE__0}'"	/>
		<og:and value = "{@CLM__1} {@CONDITION__1} '{@VALUE__1}'"	/>
		<og:and value = "{@CLM__2} {@CONDITION__2} '{@VALUE__2}'"	/>
		<og:and value = "{@CLM__3} {@CONDITION__3} '{@VALUE__3}'"	/>
		<og:and value = "{@CLM__4} {@CONDITION__4} '{@VALUE__4}'"	/>
		<og:and value = "{@CLM__5} {@CONDITION__5} '{@VALUE__5}'"	/>
		<og:and value = "{@CLM__6} {@CONDITION__6} '{@VALUE__6}'"	/>
		<og:and value = "{@CLM__7} {@CONDITION__7} '{@VALUE__7}'"	/>
		<og:and value = "{@CLM__8} {@CONDITION__8} '{@VALUE__8}'"	/>
		<og:and value = "{@CLM__9} {@CONDITION__9} '{@VALUE__9}'"	/>
		<og:and value = "{@CLM}    {@CONDITION}    '{@VALUE}'"		/>
		<og:and value = "{@AND}"	 quotCheck="false" />
	</og:where>
	<og:appear startKey = "order by" value = "{@ORDER_BY}" />
</og:query>

<!-- ACTION が指定された場合は、tableMerge により積集合/差分集合を取得します。-->
<og:equals val1="{@ACTION}" val2="{@ACTION}">
	<og:value command="SET" key="m_keys" value="{@masterKeys}" action="APPEND" />
	<og:value command="SET" key="d_keys" value="{@diffKeys}"   action="APPEND" />

	<og:query dbid="{@FROM_DBID}" scope="request" quotCheck="false" maxRowCount="{@maxRowCount}" >
		{@USER.LASTSQL}
	</og:query>
	<og:tableMerge
		action        = "{@ACTION}"
		masterScope   = "request"
		masterKeys    = "{@m_keys}"
		diffKeys      = "{@d_keys}"
		slaveScope    = "session"
		modifyClms    = "ROWID"
		display       = "true"
	/>
</og:equals>

<!-- formタグでリクエストフィールドを囲います。oneClick()関数は、２重押し防止JavaScriptです。 -->
<form onSubmit="return oneClick();" method="POST" action="forward.jsp" target="RESULT">

<!-- 複写、変更、削除ボタンを作成します。value属性+.jspの画面に制御が移ります。 -->
<!-- このとき、command=(value属性の値の大文字)が設定されます。 command属性で設定しなおすことも出来ます。-->
<og:writeCheck>
	<og:submit  value="update" lbl="COPY"   command="COPY"   accesskey="C" />
	<og:submit  value="update" lbl="MODIFY" command="MODIFY" accesskey="M" />
	<og:submit  value="update" lbl="DELETE" command="DELETE" accesskey="Z" />
	<br />
</og:writeCheck>

<!-- DB検索結果を表示させます。 -->
<!-- checked="true" で、チェック済みの状態で表示できます。 -->
<!-- selectedType="checkbox(デフォルト)/radio/hidden" から、選べます。-->
<og:view
	viewFormType = "HTMLTable" 
	command    = "{@command}" 
	checked    = "{@checked}"
	startNo    = "{@startNo}" 
	pageSize   = "{@pageSize}"
	noDisplay  = "ROWID"
/>

</form>
<jsp:directive.include file="/jsp/common/htmlend.jsp" />
</jsp:root>
