Re: Oracle Web Question

From: Steve Shiflett <steven.p.shiflett_at_lmco.com>
Date: 1997/03/17
Message-ID: <332DDC72.785A_at_lmco.com>#1/1


Here's what I did to make a bunch of check bokes within a table... so they come out looking nice. You can fool around with the "my_columns" value to get the correct number of columns so that your table looks okay... it depends on the number of check boxes and the length of the titles. Isn't it lovely?

Try this:

CREATE OR REPLACE PROCEDURE media_format_check_boxes

        ( my_columns INTEGER    DEFAULT  5,
          my_border  VARCHAR2   DEFAULT 'BORDER')
IS
        CURSOR clist IS
                SELECT media_format 
                FROM formats 
                ORDER BY media_format;
        crec clist%ROWTYPE;
        icount integer := 0;
BEGIN
        htp.p('<center>');
        htp.formhidden('format_buffer','first');
        htp.tableOpen( my_border );
        htp.tableRowOpen;
        htp.p('<FONT SIZE=+2><STRONG><CENTER><TH COLSPAN='|| 
                  my_columns || '>Media
Formats</TH></CENTER></STRONG></FONT>' );
        htp.tableRowClose;      
        OPEN clist; 
        LOOP    
                FETCH clist INTO crec;
                EXIT WHEN clist%NOTFOUND;
                htp.tableData( '<input type="checkbox"
name="format_buffer" value="'||
                                    crec.media_format || '" > ' ||
crec.media_format );
                icount := icount + 1;

                if icount = my_columns then
                        icount := 0;
                        htp.tableRowClose;
                end if;
        END LOOP;
        CLOSE clist;
        htp.tableRowClose;
        htp.tableClose;
        htp.p('</center>');
END;
         /
         show errors
         /



Here is the structure of the table formats:

SQLWKS> describe formats

Column Name                    Null?    Type
------------------------------ -------- ----
MEDIA_FORMAT                            VARCHAR2(15)
PATH_NAME                               VARCHAR2(60)
CATEGORY                                VARCHAR2(15)

Vaughan Castine wrote:
>
> A new challenge.
>
> I'm trying to create a dynamic procedure that will produce a web page with
> a form containing radio buttons (the number of radio buttons changes
> depending upon a users' previous selection).
>
> Problems:
> * Radio button names must be unique... but I don't want to have to declare
> my procedure with hundreds of parameters.
>
> * Although I can pass a table as a parameter to my procedure and I can get
> HTML to recognise:
> table(indexnumber)
> as the radio group name... OWA does not recognise the value that is
> returned.
>
> If I just use the table name without the index then I cannot get more than
> one
> value back... ie all groups merge into one.
>
> Any ideas... any help greatly appreciated.
>
> **********************************
> v.castine_at_cowan.edu.au
> Vaughan Castine
> Information Technology Officer
> Edith Cowan University
>
> Phone: 273 8668
> **********************************
> "God put me on earth to accomplish a certain number of things....
> ... I'm so far behind I'll never die" Calvin &
> Hobbes
Received on Mon Mar 17 1997 - 00:00:00 CET

Original text of this message