Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Drop-down box in PL/SQL? (kinda long!)
Hi David,
In your first attempt you want one htf.formSelectOpen before you go into the
loop,
one htf.formSelectClose after you come out of the loop and NONE within the
loop.
IN your second attempt get rid of htp.tableData altogether, and move
htf.formSelectClose
beyond the loop.
You are trying to work with two languages at once, worse - you are using
Oracle functions for the HTML.
Your brains are gonna fry.
If you are going to be doing this stuff seriously, you are going to have to
learn HTML. Once you know it,
the only procedure you need is htp.p.
It is much easier to pump in the HTML directly than to go through the extra
translation of the Oracle functions.
Regards
Garry
> Good evening folks,
>
> I'm trying to populate a drop-down box in a web page. I've tried all
kinds
> of stuff (including RTFM - "Oracle PL/SQL Programming","Oracle Application
> Server" and "Oracle8, The Complete Reference"). I've tried OTN, and
> downloaded a bunch of .pdf stuff, but can't figure this out. Here's a
> sample of one of my iterations (I've tried quite a few):
>
> OPEN c_employee;
> LOOP
> FETCH c_employee INTO employeeRec;
> EXIT when c_employee%NOTFOUND;
>
p.tableData(htf.bold( htf.fontOpen( csize
> => '-1') ||
> 'Employee ID: ' ||
> htf.fontClose) ||
> htf.formSelectOpen(cname => 'employee',
> cattributes => ' tabindex="3"') ||
>
> htf.formSelectOption(substr(employeeRec.employee,7)) ||
> htf.formSelectClose);
> END LOOP;
>
> This one gives me multiple option boxes, every selection creates a
> <td></td>. I've tried this (after the EXIT line):
>
> IF c_employee%ROWCOUNT = 1 THEN
>
p.tableData(htf.bold( htf.fontOpen( csize
> => '-1') ||
> 'Employee ID: ' ||
> htf.fontClose) ||
> htf.formSelectOpen(cname => 'employee',
> cattributes => ' tabindex="3"') ||
>
> htf.formSelectOption(substr(employeeRec.employee,7)));
> ELSE
>
> htp.tableData(htf.formSelectOption(substr(employeeRec.employee,7)));
> END IF;
> htp.formSelectClose;
>
> This gives me the first name in a drop-down box, and the rest just written
> out in a line on the page. Anybody have an idea on how to this that
they'd
> care to share?
>
> Thanks,
>
> David A. Barbour
> Once a fledgling DBA, now forced by circumstances to be a piss-poor
> developer.
> --
> Author: David Barbour
> INET: DBarbour_at_connectsouth.com
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
> ++++++++++++++++++++++++++++++++++++
> All internet traffic to this site is
> automatically scanned for viruses
> and vandals.
> ++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++