20230227 - 사용자 접속 디바이스 정보 확인

Region - Type : Dynamic Content

Source - Language - PL/SQL



begin
  owa_util.print_cgi_env();
end;




select * from APEX_ACTIVITY_LOG




참고

https://forums.oracle.com/ords/apexds/post/display-user-agent-on-page-8638

 http://www.grassroots-oracle.com/2012/11/categorizr-for-apex-extended.html



--==============================================================================
-- Returns TRUE if the current page has been designed for Desktop browsers.
--==============================================================================
function is_desktop_ui return boolean;
--
--==============================================================================
-- Returns TRUE if the current page has been designed for smartphone devices
-- using jQuery Mobile.
--==============================================================================
function is_jqm_smartphone_ui return boolean;
--
--==============================================================================
-- Returns TRUE if the current page has been designed for tablet devices
-- using jQuery Mobile.
--==============================================================================
function is_jqm_tablet_ui return boolean;
--
--==============================================================================
-- Returns the UI type for which the current page has been designed for.
--==============================================================================
function get_ui_type return varchar2;

20230227 - SQL : REGEXP_LIKE 과 TABLE(APEX_STRING.SPLIT('부산|광주|충청||', '|')

조회 조건에 주소1, 주소2 ... 주소5가 있는 상황에 각 주소를 입력하게되면 OR 조건으로 해당 데이터를 가져올 수 있도록 SQL 구현.


처음에는 Oracle Text의 contains 를 활용하여 구현하였으나 한글에 대한 것은 지원이 잘 안 되는 부분들이 확인되어 정규 표현식으로 대체 구현하게 됨.

데이터가 분명히 존재함에도 '충청북도', '충청남도'로는 조회되지 않음


AS-IS


   and (decode(nvl2(:P302_ADDR1,1,0)+nvl2(:P302_ADDR2,1,0)+nvl2(:P302_ADDR3,1,0)+nvl2(:P302_ADDR4,1,0)+nvl2(:P302_ADDR5,1,0), 0, '%') = '%'
        or contains(pomst.cust_addr, '%'||:P302_ADDR1||'%|%'||:P302_ADDR2||'%|%'||:P302_ADDR3||'%|%'||:P302_ADDR4||'%|%'||:P302_ADDR5||'%') > 0)


TO-BE

 
   and REGEXP_LIKE(pomst.cust_addr, nvl((select listagg(column_value, '|') from table(apex_string.split('부산|광주|충청||', '|')
                                                                                     )
                                        ), '|')
                  )



20230218 - UX 컨텐츠 블럭 Contents Block

리전이 여러 개여도 하나의 컨텐츠처럼 보임.



1. About

Static Contents - HTML code

Appearance - Template : Contents Block

Template Options : 


2. Features

Classic Report 


select
  1 id,
  'Faster Performance' list_title,
  'Take advantage of advanced caching for even faster page rendering performance.' list_text,
  null list_class,
  null link,
  null link_attr,
  null icon_color_class,
  'fa fa-bolt' icon_class
from sys.dual
union all
select
  2 id,
  'Install on Mobile or Desktop' list_title,
  'Your app can be installed on any desktop or mobile devices without downloading from an app store.' list_text,
  null list_class,
  null link,
  null link_attr,
  null icon_color_class,
  'fa fa-cloud-arrow-down' icon_class
from sys.dual
......


Appearance - Template : Contents Block

Template Options : 


CSS Classes : col-lg-10 col-xl-8 col-xxl-8


3. Explore

List, Navigation Menu

Layout - Column CSS Classes : col-lg-10 col-xl-8 col-xxl-8

Appearance - Template : Contents Block

Template Options : 





20230212 - IG 수정 모드 제어를 위한 IG 버튼 보이기/감추기

마스터 대표상품 YN에 따라서 하위구성 IG의 버튼을 보이고 감추는 DA

SelectionChange



if (this.data == null || this.data.selectedRecords[0] == null) return;

if(this.data.model.getValue(this.data.selectedRecords[0], "REP_YN") == "Y") {
  var vActions = apex.region("SID_IGPDTL").widget().interactiveGrid("getActions");
  vActions.show("edit");
  vActions.show("selection-add-row");
  vActions.show("save");
  vActions.show("change-view");
}
else {
  var vActions = apex.region("SID_IGPDTL").widget().interactiveGrid("getActions");
  vActions.hide("edit");
  vActions.hide("selection-add-row");
  vActions.hide("save");
  vActions.hide("change-view");
}




참고

https://forums.oracle.com/ords/apexds/post/dynamically-set-options-on-an-interactive-grid-1813

https://docs.oracle.com/en/database/oracle/apex/22.2/aexjs/interactiveGrid.html#event:selectionchange


20230212 - Validation 검증

IG 저장 전 해당 입력 값에 대한 검증 진행


(:rep_yn = 'N') or
(:rep_yn = 'Y' and (select count(*) from prod_dtlx where dtl_pid = :prod_id) = 0)


Example


SQL Expression
( :JOB = 'SALESMAN' and :COMM is not null ) or ( :JOB != 'SALESMAN' and :COMM is null )

Error message
#COLUMN_HEADER# must have a value only when Job is Salesman.








20250202 - IG 다운로드 버튼 바로 보이기

JS initialization Code : function (config) {     var $ = apex.jQuery,         toolbarData = $.apex.interactiveGrid.copyDefaultToolbar(),  ...