20210926 - this.triggeringElement

- Item Name : this.triggeringElement.id

- Item Value : $v(this.triggeringElement)

20210926 - 로그인 페이지 아이콘 대신 이미지로 변경

1. 이미지를 Static Application Files 에 업로드


2. 로그인 페이지 CSS 설정

Page - CSS - Inline :


.t-Login-logo {
    background-image: url('#APP_IMAGES#20210926-LogIn-FBF9F8.bmp'); 
    background-repeat: no-repeat; 
    background-size: cover;
    width: 240px;
    height: 70px;
    background-position: center center;
}
.t-Login-title {
    font-family: 'Hahmlet', serif;
    font-weight: 500;
    font-size: 28px;
}


3. 추가 : 백그라운드 변경 (redwood light 중)

Page - CSS - Inline :


.t-Body-main {
 background-image: url('https://static.oracle.com/cdn/apex/21.1.0/themes/theme_42/1.6/images/rw/textures/texture-11.png')
}

또는


body{
 background-image: url('https://static.oracle.com/cdn/apex/21.1.0/themes/theme_42/1.6/images/rw/textures/texture-11.png');
}





참고

https://www.traust.com/oracle-apex-simple-login-page-theming/

https://www.javainhand.com/2020/07/attractive-login-page-with-social-icons-in-oracle-apex.html

http://dgielis.blogspot.com/2015/09/custom-image-on-your-apex-app-login-page.html

https://apex.oracle.com/pls/apex/gamma_dev/r/demo/redwood


20210923 - Interactive Grid 선택한 열 Row 에 대한 특정 값 찾기

1. 디테일 그리드 등록 버튼 클릭시 마스터의 KEY 값을 읽어 팝업 창으로 전달


    config.initActions = function(actions){
        actions.add({
            name: "DA_PODTL_ClickAdd",
            action: function() {
                var ig$             = apex.region("myStaticIGPO").widget();
                var grid            = ig$.interactiveGrid("getViews","grid");
                var model           = grid.model;
                var selectedRecords = grid.view$.grid("getSelectedRecords");
                var record1         = selectedRecords[0];

                if( typeof record1 === 'undefined' || record1 === null){
                    apex.message.clearErrors();
                    apex.message.showErrors([{
                            type: "error",
                            location: ["page"],
                            message: "발주내역을 먼저 등록/선택 해 주십시오.",
                            unsafe: false
                        }
                    ]);    
                    return false;
                }

                var vPOID = model.getValue(record1,"PO_ID");

                if( typeof vPOID === 'undefined' || vPOID === null || vPOID == ""){
                    apex.message.clearErrors();
                    apex.message.showErrors([{
                            type: "error",
                            location: ["page"],
                            message: "발주내역을 먼저 등록/선택 해 주십시오.",
                            unsafe: false
                        }
                    ]);    
                    return false;
                }

                var l_url = 'f?p=#APP_ID#:5:#SESSION#::NO:RP,5:P5_PO_ID:#POID#';
                    l_url = l_url.replace('#APP_ID#',  $v('pFlowId'));
                    l_url = l_url.replace('#SESSION#', $v('pInstance'));
                    l_url = l_url.replace('#POID#', vPOID);

                // execute PL/SQL API apex_uti.prepare_url to generate a valid Session State Protection checksum
                apex.server.process(
                    'prodRegDA-popup',
                    {x01: l_url},
                    {success: function (pData) {
                            pData = pData.replace(",this", ",'#myStaticIG_ig_toolbar_btnOpenDialogPROD'");
                            apex.navigation.redirect(pData); // Call Modal Dialog Page                            
                        },
                        dataType: "text"
                    }
                );
            }
        });
    }


20210922 - 조건에 따라서 리전 펼치기/접기 Expand and collapsed

1. 리전 설정 (기본적으로 접기)

Region - Appearance - Template : Collapsible

Template Options : Use Template Defaults, Collapsed, Scroll - Default


2. Page Load - Dynamic Action - Execute Javascript


var vAQN = parseInt(apex.item("P5_ADJ_QTY_NORMAL").getValue());
var vAQR = parseInt(apex.item("P5_ADJ_QTY_REFURB").getValue());
var vAQD = parseInt(apex.item("P5_ADJ_QTY_DEFECTIVE").getValue());

if (vAQN > 0 || vAQR > 0 || vAQD > 0)
{
    $('#myStaticCollapsible.a-Collapsible.is-collapsed').removeClass('is-collapsed').addClass('is-expanded');
    $('#myStaticCollapsible.a-Collapsible .a-Collapsible-content').show();
}






참고

https://apex.oracle.com/pls/apex/f?p=44666:1:113177423838007:::::


20210921 - Interactive Grid 행 추가 버튼 대신 Custom 버튼으로 Modal Dialog 팝업 띄우기

1. IG - Attributes - Advanced - JavaScript Initialization Code :

  • IG Static ID 설정 : myStaticIG
  • 버튼 ID 설정 : btnOpenDialogPROD
  • 그리고 버튼 전체 ID 치환 : myStaticIG_ig_toolbar_btnOpenDialogPROD


function(config) {
    let $                = apex.jQuery,
        toolbarData      = $.apex.interactiveGrid.copyDefaultToolbar();
        addrowAction     = toolbarData.toolbarRemove("selection-add-row");
        saveAction       = toolbarData.toolbarRemove("save");
        editAction       = toolbarData.toolbarRemove("edit");
        actionsMenuGroup = toolbarData.toolbarFind("actions2");

    actionsMenuGroup.controls.push({
        type: "BUTTON",
        id: "btnOpenDialogPROD",
        label: "등록",
        icon: "icon-ig-add-row",
        iconBeforeLabel: true,
        hot: true,
        action: "DA_PODTL_ClickAdd"
        });

    config.initActions = function(actions){
        actions.add({
            name: "DA_PODTL_ClickAdd",
            action: function() {
                
                var l_url = 'f?p=#APP_ID#:5:#SESSION#::NO:RP';
                    l_url = l_url.replace('#APP_ID#',  $v('pFlowId'));
                    l_url = l_url.replace('#SESSION#', $v('pInstance'));

                // execute PL/SQL API apex_uti.prepare_url to generate a valid Session State Protection checksum
                apex.server.process(
                    'prodRegDA-popup',
                    {x01: l_url},
                    {success: function (pData) {
                            pData = pData.replace(",this", ",'#myStaticIG_ig_toolbar_btnOpenDialogPROD'");
                            apex.navigation.redirect(pData); // Call Modal Dialog Page                            
                        },
                        dataType: "text"
                    }
                );
            }
        });
    }

    config.toolbarData = toolbarData;
    return config;
}


2. Dynamic Action Dialog Closed 

When - Event : Dialog Closed

Selection Type : jQuery Selector

jQuery Selector : #myStaticIG_ig_toolbar_btnOpenDialogPROD




처음에 안 되어서 이렇게 찾아본 것인데
이상하게도 하다보니 추가로 Dynamic Action 없이 기존 리전 Dialog Close 것으로 Refresh 되었음.

참고

https://blog.virtual7.de/implementing-a-select-list-in-the-interactive-grids-toolbar/


20210918 - 컬럼 배경색 제어 Highlight Column

1. SQL과 HTML Expression 활용


select ename, sal,
       CASE WHEN sal <= 1500 THEN 'background-color:green' 
            WHEN sal > 1500 AND sal <= 3000 THEN 'background-color:orange'
            WHEN sal > 3000 THEN 'background-color:red'
            ELSE NULL
       END css_style
  from  (  
            select 'John' ename, 1500 sal from dual
            union all
            select 'Maxwell' ename, 3000 sal from dual
            union all
            select 'Nike' ename, 4500 sal from dual
        )


SAL Column - Column Formatting - HTML Expression :

<span data-style="#CSS_STYLE#">#SAL#</span>


Dynamic Action - When

Event : After Refresh

Selection Type : Region

Execute JavaScript Code - Code :

apex.jQuery("span[data-style]").each(

  function()

  { 

    apex.jQuery(this).parent().attr('style', apex.jQuery(this).attr('data-style')); 

  }

);

Fire on Initialization : Checked

** 아니면 SQL에서 CSS 명칭을 지정 후 CSS - Inline 코드 활용하여 색상 변경

ex) select 'bd-green' css_name from dual




2. Javascript Only

1.번과 동일한 Dynamic Action

Execute JavaScript Code - Code :


$("#myStaticIR tbody tr td").each(function(){
   if ($(this).attr('headers') != 'TOT') {
     if (parseInt($(this).text()) <= 1500)
        $(this).css({"background-color":"SandyBrown"});
     else if(parseInt($(this).text()) <= 3000)
        $(this).css({"background-color":"lightgreen"});
     else if(parseInt($(this).text()) > 3000)
        $(this).css({"background-color":"red"});
   }
});




3. CSS Only (컬럼 포맷팅, 특별한 경우 마이너스 '-')

1.번과 동일한 Dynamic Action

Actual Column - Column Formatting - HTML Expression :


<span data-number="#ACTUAL#">#ACTUAL#</span>


CSS - Inline :


span[data-number*="-"] {
    color:red;
}


4. (배경색은 아니지만) 페이지 아이템 강조 색상 변경 Page Item Label, Value

Inline CSS :


label[for="P13_COMMENT"], #P13_REMARK {
  font-size: 16px !important;
  font-weight: bold !important;
  color: red! important;
}


5. 뽀나스 - Hierarchy 구조


select (level*20)-20 the_level,
        empno,ename,mgr
   from emp
connect by prior empno = mgr
  start with mgr is null



<span style="padding-left:#THE_LEVEL#px;">#ENAME#</span>



6. IR column Header

각 항목 SID 설정 후 PAGE CSS : 

#SID_OSTOCK a { color: #D86445; }
#SID_RSTOCK a { color: #D86445; }


20210918 - Interactive Grid, Interactive Report 툴바 메뉴 언어 한글 셋팅

기본적으로 옵션 조정을 하지 않으면 영어로 셋팅이 되고 변경하는 방법은 

1) 처음 Application 을 생성할 때 언어를 선택할 수도 있고 

2) 나중에 Shared Components >> Globalization Attributes >> Edit Globalization Attributes >> Application Primary Language 에서 조정 가능.





20250315 - 글로벌 변수 Global Variables

G_USER Specifies the currently logged in user. G_FLOW_ID Specifies the ID of the currently running application. G_FLOW_STEP_ID Specifi...