Hide Default Homepage for Tomcat

To hide default homepage for Tomcat we could redirect default homepage to other page
 
# Make a backup of the old homepage
cd /CATALINA_HOME/webapps/ROOT
mv index.html index.html.bak
# create a new index.html file and put the following contents in index.html file
touch index.html
vim index.html
and contents are
 
<head>
<meta http-equiv="refresh" content="0;URL=your_new_default_homepage">
</head>
<body>
</body>
</html>

Uncheck All Checkbox on Page Load for Apex Page Using Javascript

1. Put the following javascript function at "Function and Global Variable Declaration" of page attributes.
 function UncheckAll(){ 
      var w = document.getElementsByTagName('input'); 
      for(var i = 0; i < w.length; i++){ 
        if(w[i].type=='checkbox'){ 
          w[i].checked = false; 
        }
      }
  } 
2. Create page dynamics
  Event: Page Load
  Condition: No Condition
  Action: Eecute Javascript Code
  Code: UncheckAll()
  
Locate and open the true event "Execute Javascript Code" of create dynamic action, check "Fire On Page Load"

Display Binary Data in Oracle Apex using Checkbox


We want to use checkbox to display a column in interactive report, which contains binary data 0 and 1.

Solution 1: Not perfect. This will cause problem in exported CSV file

In Region Source for interactive report, using CASE function to format this filed.

select t1.sponsor,
CASE
    WHEN T1.EXPERIENCE = 1 THEN 'checked=checked'
END AS EXPERIENCE_CHECKBOX
from sponsor t1
Then add
<input type="checkbox" disabled readonly #EXPERIENCE_CHECKBOX# />
to HTML Expression of EXPERIENCE_CHECKBOX column formatting.

 

This solution works fine by looking. However, you will notice problem in downloaded file, the content of experience column was replaced by checked="checked" and null, not original values of 0 and 1.

Solution 2: a Better solution

Use a pl/sql function to format filed content based on request type.
CREATE OR REPLACE FUNCTION FORMAT_STRING (P_INT       IN INT,
                                          P_REQUEST   IN VARCHAR2)
   RETURN VARCHAR2
IS
   V_STRING   VARCHAR2 (40);
BEGIN
   IF P_REQUEST NOT IN ('HTMLD', 'XLS', 'CSV') OR P_REQUEST IS NULL
   THEN
      IF P_INT = 1 -- or whatever value used to indicate checked
      THEN
         V_STRING := 'checked=checked';
      END IF;
   ELSE
      V_STRING := P_INT;
   END IF;

   RETURN V_STRING;
EXCEPTION
   WHEN OTHERS
   THEN
      RAISE;
END FORMAT_STRING;

In Region Source for interactive report, use FORMAT_STRING function to format experience field.
select t1.sponsor, format_string(T1.experience, :request) EXPERIENCE_CHECKBOX from sponsor t1
Also add
<input type="checkbox" disabled readonly #EXPERIENCE_CHECKBOX# />
to HTML Expression of EXPERIENCE_CHECKBOX column formatting.

Final Product

Hide/Show Long Column Content in Oracle Apex Report

I used the following method to hide the extra long column contents when loading the page. The contents will then display when mouse hover the content.
Figure 1: Before applying CSS

Figure 2: After applying CSS

1. In the column attributes page, column Formatting section, add the following to HTML Expression text area for the column to modify:
<div>#COLUMN_NAME#</div> 
COLUMN_NAME is the name of the column to which you want to apply these css property.

2. Add the following style sheet to the report page Inline CSS property (replace "COLUMN_NAME" accordingly):
  
td[headers="COLUMN_NAME"] div {
          width: 15EM;
          white-SPACE: nowrap;
          OVERFLOW: hidden;
          text-OVERFLOW: ellipsis;
}

td[headers="COLUMN_NAME"] div:hover {
      width: 15EM;
      white-SPACE: NORMAL;
      OVERFLOW: VISIBLE;
}

Datatable static image not found on the server

When you use ```datatables.min.css``` and ```datatables.min.js``` locally, instead of datatables CDN, you may have encountered that ```sort...