Wednesday, May 23, 2018

APEX Model Dialog Title

APEX 5.

I have a report with one col that is linking to an open Model Dialog, What I want is to show one of the report Column as part of the model dialog title. Here is what I did:

1. Create an hidden item in the dialog page: Pxx_TITLE
2. Build the link between the report and the dialog page and transfer the column name to this hidden item
3. In the dialog page, create an after refresh DA, putting following javascript as Action:

apex.util.getTopApex().jQuery(".ui-dialog-content").dialog("option", "title", $v("Pxx_TITLE")) 

Wednesday, May 16, 2018

Split Checkbox values into 'different Group'

I know this is kind of wired but I have a project where I will need to kind of putting different(multiple) checkbox values into multiple 'group' while it's actually just one CheckBox Item. this is most for the customer to kind of think of those values into multiple categories.

Here is how I did it:

$('table tr td').find("input[value='Home Street Address']").parent().addClass('break1');
boundary1 = $("td.break1");
$('table tr td').find("input[value='Religious Beleifs']").parent().addClass('break2');
boundary2 = $("td.break2");
$('table tr td').find("input[value='Physical Health']").parent().addClass('break3');
boundary3 = $("td.break3");
$('table tr td').find("input[value='Credit or Debit Card Number (PAN)']").parent().addClass('break4');
boundary4 = $("td.break4");
$("<tr>").insertAfter(boundary1.parent()).append(boundary1.nextAll().andSelf());
$("<tr>").insertAfter(boundary2.parent()).append(boundary2.nextAll().andSelf());
$("<tr>").insertAfter(boundary3.parent()).append(boundary3.nextAll().andSelf());
$("<tr>").insertAfter(boundary4.parent()).append(boundary4.nextAll().andSelf());
$('#P369_EMPLOYEE_DATA').find("input[value='Home Street Address']").parents('tr').before('<tr bgcolor="#f9940e"><td><font color=white>Contact Information</font></td></tr>');
$('#P369_EMPLOYEE_DATA').find("input[value='Religious Beleifs']").parents('tr').before('<tr bgcolor="#f9940e"><td><font color=white>Employee Beliefs</font></td></tr>');
$('#P369_EMPLOYEE_DATA').find("input[value='Physical Health']").parents('tr').before('<tr bgcolor="#f9940e"><td><font color=white>Health Information - Sensitive information</font></td></tr>');
$('#P369_EMPLOYEE_DATA').find("input[value='Credit or Debit Card Number (PAN)']").parents('tr').before('<tr bgcolor="#f9940e"><td><font color=white>Financial Information</font></td></tr>');

Basically I will need to 'split' the values into multiple 'groups'. then add 'one' virtual 'group title'(the red part) to each group.