Re: Basic Portal Question

From: andrija <ar35644_at_fer.hr>
Date: Fri, 21 Dec 2001 18:08:57 +0100
Message-ID: <9vvqbr$9opa$1_at_as201.hinet.hr>


This is an example of the two dynamic pages. First page sends parameters by
<form> tag and the second page is printing it.

<HTML>
<HEAD>
<TITLE>Example</TITLE>
</HEAD>

<BODY>
<form action="prod.dyn_form_print.show" method="post" id="form1"
name="form1">
<INPUT TYPE="hidden" NAME="p_arg_names" VALUE="text1">
<INPUT TYPE="text" NAME="p_arg_values" SIZE="30" MAXLENGTH="2000">
<INPUT TYPE="hidden" NAME="p_arg_names" VALUE="text2">
<INPUT TYPE="text" NAME="p_arg_values" SIZE="30" MAXLENGTH="2000">

<INPUT TYPE="BUTTON" NAME="p_request" VALUE="Run Report"
onClick="javascript:document.form1.submit()">
</form>
</BODY>
</HTML>

As you see, there is no PL/SQL, but you can see how <form> tag is used on Portal. You send an array of parameters, allways in pairs 'p_arg_names' and 'p_arg_values'. First is the name of the parameter, second is the value. That's why you must use hidden fields in the form, just to send both parameters, not just the value. Also, submit button is send with name 'p_request'.

prod.dyn_form_print.show

<HTML>
<HEAD>
<TITLE>Example</TITLE>
</HEAD>
<BODY>
<ORACLE>begin

htp.p(:text1);
htp.p(:text2);
end;
</ORACLE>
</BODY>
</HTML>

This is just simple printing of the parameters.

And now, the long one, just so you can see how can it look (this page also uses parameters send by <form> tag):

<HTML>
<HEAD>
<ORACLE>

declare
n number;
vbroj varchar2(50);
vkorisnik varchar2(50);
vkvar varchar2(50);
vkvar_status varchar2(50);
vvaznost varchar2(50);
vrjesen varchar2(10);
vopis varchar2(3000);

begin
vbroj:=:broj;
if vbroj='' or vbroj is null then

   vbroj:='%';
end if;

vkorisnik:=:korisnik;
if vkorisnik='' or vkorisnik is null then vkorisnik:='%';
end if;

vkvar:=:kvar;
if vkvar='' or vkvar is null then
vkvar:='%';
end if;

vkvar_status:=:kvar_status;
if vkvar_status='' or vkvar_status is null then vkvar_status:='%';
end if;

vvaznost:=:vaznost;
if vvaznost='' or vvaznost is null then
vvaznost:='%';
end if;

vrjesen:=:rjesen;
if vrjesen='' or vrjesen is null then
vrjesen:='%';
end if;

vopis:=:opis;

htp.p('</head>');
htp.p('<body>');

htp.p('<a href=prod.dyn_prijava_kvara_trazi2.show>Back</a><br>');

htp.p('<TABLE cellSpacing=1 cellPadding=1 width="75%" border=1>'); htp.p('<TR><TD>Sifra zahtjeva</TD><TD>Datum zahtjeva</TD><TD>Status</TD><TD>Datum statusa</TD></TR>');

for c_zahtjev in
(select kvar_zahtjev_id,to_char(datum_zahtjeva,'DD.MM.YYYY HH24:MI:SS') as datum_zahtjeva, status, to_char(status_dt,'DD.MM.YYYY HH24:MI:SS') as rjeseno from prod.kvar_zahtjev

    where kvar_zahtjev_id like vbroj
    and prijavio like vkorisnik
    and kvar_id like vkvar
    and (kvar_status_id like vkvar_status or kvar_status_id is null)     and status like vrjesen
    and opis_kvara like '%' || vopis || '%' order by kvar_zahtjev_id ) loop

htp.p('<TR>');

htp.p('<TD>');

--here you can see how parameters are sent in URL htp.p('<a
href=prod.dyn_prijava_kvara_rjesenje.show?p_arg_names=broj&p_arg_values=' || c_zahtjev.kvar_zahtjev_id || '>' || c_zahtjev.kvar_zahtjev_id || '</a>'); htp.p('</TD>');

htp.p('<TD>');
htp.p(c_zahtjev.datum_zahtjeva);
htp.p('</TD>');

htp.p('<TD>');

htp.p(c_zahtjev.status);
htp.p('</TD>');
htp.p('<TD>');
htp.p(c_zahtjev.rjeseno);
htp.p('</TD>');

htp.p('</TR>');

end loop;
htp.p('</table>');

end;
</ORACLE>
</BODY>

</HTML>

Sorry, but comments and variable names are in Croatian, don't have the time to change it.

Hope this helps!

Bye! Received on Fri Dec 21 2001 - 18:08:57 CET

Original text of this message