0

APEX – Textarea Resizer width issue in IE

Currently I’m developing an application in APEX 4.1 for a target browser of IE6. One of the latest problems I encountered was with the textarea resizer not extending to the full width of the textarea. This was due to APEX automatically adding an inline style to the FIELDSET tag with a very small width. To work around the issue I added the following style to my IE specific stylesheet to overcome the issue:

fieldset.textarea { width:auto !important; }

Luckily the !important flag will override inline styling. Here’s what the symptom looks like:

3

Sticky Region Display Selector

I ran into one of those frustrations today with APEX 4.0. Whilst the introduction the region display selector has been very welcomed, I had the requirement for it to be sticky, i.e. remembered across page refreshes. Unfortunately this functionality is not available, but it is available in the APEX builder application just to rub our faces in it :)

Now my first port of call was to hit the forum and to my surprise no-one has posted a solution even though there have been several threads on the topic. So I had one of the moments where I contemplated being lazy and wait for a future release, but being someone who thrives on challenges (no matter how small) I thought I’d try my luck with a couple of dynamic actions to solve the problem. (I did think about writing a plugin, but it’s probably overkill for this requirement)

So here are the steps:

  1. Create a (non protected) hidden page item to hold the active region value of the region display selector
  2. Create the following dynamic action “Advanced -> Page Load”
  3. and for the true action
    The trick with the above javascript is that we’ll simulate a click event to change the active selection on page load. This will mean that there will be a flicker on page load, to avoid this use a modal overlay that hides the screen until all javascript has finished executing.
  4. Create a second dynamic action “Avanced -> Click”
  5. for the first true action
  6. for the second true action

    Now the trick with the above true action is that we simply want to update our page item value in session state with the selected region and nothing else. We use the first true action to set the page item value using a javascript expression and the second true action to fire an AJAX post to update the items value in session state server side. The DOM Object is a non existing element and just a hack to keep APEX validations happy. I could write an AJAX routine but I’m looking for the quickest and simplest method. This hack works quite well but you may want to do something a little cleaner.

The most optimal solution is probably to create an item and define these 2 dynamic actions on page zero and use a condition with an exists query that checks the APEX data dictionary to see which pages a region display selector defined on them. Or simply set a condition of a comma delimited list of pages etc. whichever works best for your situation.

Pages ... 1 2