Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: help in a call of a procedure
Part of the problem with debugging plsql generated javascript code has to do with the levels of quotes needed to do this.
I would suggest loading the javascript through a link tag and building the javascript in a file with a .js extension. This would allow you to debug the javascript independently of the plsql.
The reason Chp appears is that it is part of the string:
''http://pcmeade/xyric/XYRIC.Listedevises?Cod=Chp''
that is being passed to the window.open method. It should probably look something like
"http://pcmeade/xyric/XYRIC.Listedevises?Cod="+Chp
Also the onclick:
onClick="ShowLst(''DevTrspt'');"
perhaps should be formatted as
onClick="ShowLst(DevTrspt)"
(There may be other problems I misssed on reading it. I have not attempted to run the code.)
Note that it is tempting to use the htp.p procedure to do everything. But this embeds many strings (literals) in your code. I have seen plsql generated code that is often more than half literals strings. Why is this a problem? Because the code that is embodied in the strings is not checked for spelling mistakes and other syntax errors. Hence you could get a plsql procedure to compile and run, but the browser displays garbage because the code in the literals misspelled or missing something simple.
Another recommendation: use the htp methods whenever possible. If they are annoying because they don't do what you want, write your own methods (using htp.p) that work better.
Frank Hubeny
Sandy wrote:
> Hi,
>
> I have created a form in a pl/sql procedure :
>
> the code is :
>
> procedure b is
>
> begin
>
> htp.p('<HTML><HEAD>
>
> <TITLE>Saisie d''une remontée d'' informations</TITLE>
>
> <script language="javascript">
> <!-- ;
>
> function ShowLst(Chp)
> {
> sLstDev=window.open
> (''http://pcmeade/xyric/XYRIC.Listedevises?
> Cod=Chp'',''LstDevFen'',''width=300,height=300,location=1
> ,menubar=0,resizable=0,scrollbars=1,dependent=1,status=0,
> toolbar=0'');
> }
>
> // -->
>
> </script>
> </HEAD>');
> htp.p('<BODY>');
> htp.p('<FORM NAME="FormRmi"
> ACTION="http://pcmeade/xyric/xyric.insertion" METHOD="POST"
> >
Code Devise du transport <INPUT TYPE="text" NAME="DevTrspt"
> >
> <img src="/images/list.gif" border="0" alt="Liste des codes
> situation" onClick="ShowLst(''DevTrspt'');">
>
> </form>
> ..
>
> The problem is in the call of the procedure listedevises
> which is in the function javascript showlst(chp) i would
> like the variable Chp to contain DevTrspt then i can use
> Devtrspt like this :
>
> document.FormRmi.Devtrspt.value
>
> but the problem is that the variable Chp doesn't contain it
> and when i call the procedure ShowLst the value of Chp is
> Chp.
>
> I hope it was clear if it is not you can ask i will explain
> again.
>
> thanks
>
> Sandy
>
> when i call this procedure (showlst(chp)) i would like it to
>
> * Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping. Smart is Beautiful
Received on Fri Jul 21 2000 - 00:00:00 CDT
![]() |
![]() |