Re: Checkboxes on OAS 3
From: Gaston Cabrera <cabrera_at_veena.cc.uregina.ca>
Date: Thu, 30 Sep 1999 12:42:30 -0600
Message-ID: <7t0aum$s2h$1_at_sue.cc.uregina.ca>
htp.tableOpen( calign => 'Center', cattributes => ' BORDER="3" CELLPADDING="2"
CELLSPACING="0"' );
htp.hr;
htp.centerOpen;
Date: Thu, 30 Sep 1999 12:42:30 -0600
Message-ID: <7t0aum$s2h$1_at_sue.cc.uregina.ca>
mheyer_at_my-deja.com wrote:
> I am currently developing forms for an Intranet, using Oracle
> Application
> Server version 3. I have developed some check boxes, but I need to pass
> the parameters that have been checked off to a confirmation screen. How
> do I do it. Any examples?
> Thanks,
> Matt
>
Hi
Sorry for the delay but I was kind of busy. I hope this crude example may help you.
PROCEDURE inactivate_user(i_user IN NUMBER, i_refno IN VARCHAR2) IS
- Declare your cursor
- Declare your variables
BEGIN
htp.formOpen( curl => 'ww_your_page.newpage', cmethod => 'POST');
htp.formHidden( cname => 'i_user', cvalue => i_user);
htp.formHidden( cname => 'i_refno', cvalue => i_term);
htp.centerOpen;
htp.line;
htp.fontOpen('GREEN');
htp.tableOpen( calign => 'Center', cattributes => ' BORDER="3" CELLPADDING="2"
CELLSPACING="0"' );
FOR Y IN 1..2
LOOP
IF Y = 1 THEN
-- if the user does not select an option, they will receive
an error.
-- this is to guarantee that at least one value is submitted
htp.formHidden( cname => 'i_chck', cvalue => 'F');
ELSE
-- calling a cursor
FOR x IN csrUser(i_user, i_refno)
LOOP
pto := x.title||';'||x.active;
htp.tableRowOpen( cattributes => ' BGCOLOR="White"' );
htp.tableData( htf.formCheckbox( cname => 'i_chck',
cvalue => pto, cattributes => ' BGCOLOR="White"'));
htp.tableData(x.title, cattributes =>
'"BGCOLOR="White"');
htp.tableData(x.active, cattributes =>
' BGCOLOR="White"');
htp.tableRowClose;
END LOOP;
END IF;
END LOOP;
htp.tableClose;
htp.centerClose;
htp.nl;
htp.fontclose;
-- buttons --
htp.hr;
htp.centerOpen;
htp.tableOpen;
htp.tableRowOpen;
tableDataOpen;
htp.tableData(htf.formSubmit(cvalue => 'Inactivate User'));
htp.tableData(htf.formReset);
tableDataClose;
htp.tableRowClose;
htp.tableClose;
htp.centerClose;
htp.formClose;
END inactivate_user;
--
-- Note: In the package specs you must declare chck as follows:
-- Type varrayChck is table of VARCHAR2(35) INDEX by BINARY_INTEGER;
-- empty varrayChck;
--
PROCEDURE newpage(i_user IN NUMBER, i_refno IN VARCHAR2, chck in varrayChck)
is
-- Your Coursor Declaration (if any)
-- Your Variable Declaration
BEGIN
IF i_chck.COUNT > 1 THEN
htp.print(i_chck.COUNT);
FOR x IN 1..i_chck.COUNT
LOOP
l_string := i_chck(x);
l_endposn := instr(l_string,';');
l_title := substr(l_string,l_startposn,l_endposn -1 );
l_startposn := l_endposn + 1;
l_endposn := instr(l_string,';',l_startposn);
l_active := substr(l_string,l_startposn,l_endposn -
l_startposn);
IF l_title IS NOT NULL THEN
htp.br;
htp.bold(' Title: '||l_title||' Active: '||l_active);
END IF;
l_startposn := 0;
END LOOP;
ELSE
htp.bold('No rows checked');
END IF;
END newpage;
Received on Thu Sep 30 1999 - 20:42:30 CEST
