Sunday, 20 July 2008

Throw some D's

Ask anyone who works with Oracle Application Express and they'll probably tell you that the most difficult/unreliable/uncontrollable/unruly ghetto in its whole universe is the tabular form. In truth, I don't really have enough experience to agree with them with any certainty, but hey, if that's what the experts say then who am I to disagree?

This past week I've had to create a few data entry tables (based on an irregularly-structured database table [someone else's fault - of course]) and I found that the regular wizard-driven tabular forms just couldn't cut it. And so I packed my rucksack and headed down the road signposted APEX_ITEM.

Actually I'm exaggerating when I say "signposted", cos like everything else in the Oracledom, the whole thing is very poorly documented, and I only stumbled across it by chance. But now that I'm here I'm having a really great time. It's so easy to use - all you do is write your SQL statement, throw in APEX_ITEM.TEXT(indexNo, defaultValue) (where indexNo is a number counting up from 1) , stick it in an SQL Report and - voila! It's brilliant.

And for data manipulation all you have to do is create a PL/SQL process that'll loop through the rows (you'll need APEX_APPLICATION.G_FindexNo(rowNumber) to read the values) and do what you want with them. To quote someone I like and respect a great deal (me, me!): it's brilliant! It's way better - if a little more fiddly - than the wizard-driven tabular forms.

There's only one little thing that I need to figure out how to do now. I'd love to be able to include some javaScript (did I tell you how much I'm enjoying the javaScript book I bought? There's this other non-tech book that I'm reading - and enjoying - at the moment, but often I find myself choosing the javascript one over it) to validate each text item as it is entered. You can't do that with wizard-driven tabular forms (I think), but I reckon it should be possible with these manual tables. It's Sunday today, I'll look into it tomorrow: can't wait.

In other news today: my laptop is old and crappy - the wifi has gone deaf and the keyboard is arthritic. The ctrl is missing and, today, the D key has stiffened. So if you find any words in today's entry that aren't in the lexicon just do like the rap song says and Throw some D's on it.

1 comment:

Unknown said...

You should post your question on the APEX forum.

From what I saw at ODTUG , Carl Backstrom as some nice javascript features implemented in APEX for tabular forms. I am sure if you ask, he will be able to help you implement javascript with your tabular form.

BTW , next version of APEX will include better tabular forms !

Francis.
http://insum-apex.blogspot.com