1. 단가 표현을 위한 Collection 생성
Pre-Rendering - Before Regions - Processes
Identification - Name : CreateCollection
Type : Execute Code
Source - Location : Local Database
Language : PL/SQL
PL/SQL Code :
2. 예상금액확인 리전 생성
Identification - Name : 예상금액확인
Type : Classic Report
** 앞서 만들어 놓은 collection 에서 데이터를 읽어 오면서 컬럼별 스타일 적용
Icon : fa-dollar fa-2x
그리고 디자인이 들어간 CD, BTN_UP, BTN_DOWN 은 컬럼 Type을 Markdown 으로하여 HTML 표현
When - Event : Click
Selection Type : jQuery Selector
jQuery Selector : .ButtonXU (button class name in sql design)
-- True Action1 : Set Value (PL/SQL에서 클릭 버튼 종류를 인식하기 위해 U, D 값 셋팅)
Set Type : JavaScript Expression : this.triggeringElement.id
Affected Elements : P3_ID
-- True Action3 : Refresh (계산된 Collection에서 값 읽어오기)
Selection Type : Region
Region : 예상금액확인
-- True Action4 : Execute JavaScript Code (리전 상단의 합계 버튼에 값 셋팅)
$('#myStaticBTN span.t-Button-label').text(apex.item('P3_SUM').getValue())
참고
https://docs.oracle.com/en/database/oracle/application-express/21.1/aeapi/CREATE_COLLECTION_FROM_QUERY2-Procedure.html#GUID-7800CD9E-FD29-4E49-B637-A426D78A644C
CREATE_COLLECTION_FROM_QUERY2 Procedure
Use this procedure to create a collection from a supplied query. This method is identical to CREATE_COLLECTION_FROM_QUERY
, however, the first 5 columns of the SELECT
clause must be numeric and the next 5 must be date. After the numeric
and date columns, there can be up to 50 character columns in the SELECT
clause. The query is parsed as the application owner. If a collection
exists with the same name for the current user in the same session for
the current Application ID, an application error is raised.
이 프로시저를 사용할 경우 반드시 첫 5개는 숫자, 다음 5개는 일자 그리고 1개는 문자가 필요함. Null이라도 표시해야 함.