Automatic linebreak if word breaks out of table element

Tobias Arnhold | Mar 11, 2010 15:36 +0000
I found a great source how to prevent word break outs in <th> and <td> elements:
Peter Bromberg's: FIREFOX / IE Word-Wrap, Word-Break, TABLES FIX
How does the break out looks like:


CSS code to prevent this issue:

.prevent_breakout
{
width: 250px;
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}

With javascript it could look like this:

<script type="text/javascript">
function set_lb(v_val, v_max_width){
var v_browser=navigator.appName;
// ...
if (v_browser=="Microsoft Internet Explorer")
{
$x(v_val).style.width = v_max_width; // set width
$x(v_val).style.wordWrap = 'break-word'; // Internet Explorer 5.5+
}else
{
$x(v_val).style.width = v_max_width; // set width
$x(v_val).style.whiteSpace = 'pre-wrap'; // css-3
$x(v_val).style.whiteSpace = '-pre-wrap'; // Opera 4-6
$x(v_val).style.whiteSpace = '-o-pre-wrap'; // Opera 7
$x(v_val).style.wordWrap = 'break-word'; // Internet Explorer 5.5+
$x(v_val).style.whiteSpace = '-moz-pre-wrap'; // Mozilla, since 1999
}
</script>

Thanks Peter for this great hint!

Weird IE behaviour with JS function String.charAt(Index)

Tobias Arnhold | Mar 10, 2010 15:33 +0000
I had a real pain with the MS Internet Explorer and the javascript function String.charAt(Index)

I wanted to update a string and checked each value. IE was able to give just an empty value back. But it was not checkable!

if ((v_browser=="Microsoft Internet Explorer")&& (v_string.charAt(x)=='')&& (y+1==x) && (v_string.charAt(x+1)=='<'||v_string.charAt(x+2)=='<'))

Even the length was 1 and not 0!
Finally I tried this function String.charCodeAt(Index) with an alert box and voilĂ  two values where prompted: 13 and 10

13 and 10 wait... LINEBREAK!

HELL why does it do such things...

Now I could check it!

if ((v_browser=="Microsoft Internet Explorer")&&(v_check_unicode=='13'||v_check_unicode=='10'||v_check_unicode=='NaN'))

My script works and I feel released.
Now I have to watch the end of Real against Lyon.. :D

Column header groups in APEX report

Tobias Arnhold | Mar 10, 2010 13:30 +0000
Did you ever want a report header grouped like this:


Just add some html code into your report template > column headings > Before Column Heading:


Important to know:
- Changes like this have effect on every report you use with that report template
- Make a copy of your existing report template and use the new one instead

In my example I used 8 columns and three of them should have a group column above it. Use colspan="3" to stripe it over 3 columns.

Here the generated HTML code:


For APEX Interactive Reports watch there:
Dimitri Gielis: Group Headings in an Interactive Report (APEX)
And there:
Martin Giffy D'Souza: Column Groups in APEX Interactive Reports

AJAX based select list in APEX – Part 2

Tobias Arnhold | Mar 1, 2010 16:31 +0000
I couple of days ago I wrote about a way using AJAX based select lists in APEX.
After some hints from Peter Raganitsch I tried the ApexLib Framework but I run into some issues with ExtJS.
Error message:
vFieldValue is undefined
populateLovField(Object { name="pFieldId"}, Object { name="pLovEntry"})ApexLib_Full.js
populateDependingLovs(Object { name="pFieldId"})ApexLib_Full.js
(?)()ApexLib_Full.js
(?)(Object { name="pEvent"})ApexLib_Full.js
vAjaxRequest.add(pLovEntry.oUsedFi...ace(/\:/g, String.fromCharCode(1)));

Error part where somehow an ExtJS function got called:

vAjaxRequest.add(pLovEntry.oUsedFieldList[ii], vFieldValue.replace(/\:/g, String.fromCharCode(1)));

I found another solution from Carl Backstrom: Ajax Selects
I modified his script a bit and used it in my environment.

Using the ApexLib would have been much easier luckily I just had a really small application.

Good for us that APEX 4.0 will solve these problems by a new standard feature:
Oracle APEX 4.0: Cascading LOVs/Select Lists