Home » Developer & Programmer » Application Express, ORDS & MOD_PLSQL » set buttonwidth
set buttonwidth [message #458128] Thu, 27 May 2010 09:21 Go to next message
rkhatiwala
Messages: 177
Registered: April 2007
Senior Member
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
PL/SQL Release 11.1.0.6.0 - Production
"CORE 11.1.0.6.0 Production"

Hi,

I have this:
In my CSS,
.btnWidth1 {width:100px;}

In my sql
htp.tableData(htf.formSubmit('p_form_nav_type','Previous 10',cattributes=>'CLASS="btnWidth1"' , 'onClick=" return chgButton('Previous 10'));

Error(450,4): PL/SQL: Statement ignored
Error(450,100): PLS-00312: a positional parameter association may not follow a named association

But if i have only one in cattributes like
htp.tableData(htf.formSubmit('p_form_nav_type','Previous 10',cattributes=>'onClick=" return chgButton('Previous 10'));
then, it doesnt err out..

So, is it like, i cannot have more than 1 in cattributes ?

Thanks in advance
Re: set buttonwidth [message #458131 is a reply to message #458128] Thu, 27 May 2010 09:46 Go to previous messageGo to next message
rkhatiwala
Messages: 177
Registered: April 2007
Senior Member
Got the solution:

It has to be like this:
htp.tableData(htf.formSubmit('p_form_nav_type','Previous 10',cattributes=>'CLASS=btnWidth1 onClick=" return chgButton(' || '''' || 'Previous 10' ||'''' || ')"'));


No commas, and quotes....

Thanks
Re: set buttonwidth [message #458197 is a reply to message #458131] Thu, 27 May 2010 17:01 Go to previous message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
You'll notice that htp.p is a lot easier to produce the snippet of HTML you need (but it can make your pl/sql a bit messier to read). Ignore the html header stuff - it's just a side effect of the 1st pl/sql block to run.
SQL> set serveroutput on
SQL> DECLARE
  2     nm          OWA.vc_arr;
  3     vl          OWA.vc_arr;
  4     l_page      HTP.htbuf_arr;
  5     l_lines     NUMBER        DEFAULT 99999999;
  6  BEGIN
  7     -- initialize cgi environment
  8     nm (1) := 'REMOTE_ADDR';
  9     vl (1) := '1.2.3.4';
 10     OWA.init_cgi_env (nm.COUNT, nm, vl);
 11     htp.tableData(htf.formSubmit('p_form_nav_type','Previous 10',cattributes=>'CLASS=btnWidth1 onClick=" return chgButton(' || '''' || 'Previous 10' ||'''' || ')"'));
 12     OWA.get_page (l_page, l_lines);
 13
 14     -- print HTTP buffer using dbms_output
 15     FOR i IN 1 .. l_lines
 16     LOOP
 17        DBMS_OUTPUT.put_line (l_page (i));
 18     END LOOP;
 19  END;
 20  /
Content-type: text/html

Content-length: 133



<TD><INPUT TYPE="submit" NAME="p_form_nav_type" VALUE="Previous 10"
CLASS=btnWidth1 onClick=" return chgButton('Previous 10')"></TD>


PL/SQL procedure successfully completed.

SQL> DECLARE
  2     nm          OWA.vc_arr;
  3     vl          OWA.vc_arr;
  4     l_page      HTP.htbuf_arr;
  5     l_lines     NUMBER        DEFAULT 99999999;
  6  BEGIN
  7     -- initialize cgi environment
  8     nm (1) := 'REMOTE_ADDR';
  9     vl (1) := '1.2.3.4';
 10     OWA.init_cgi_env (nm.COUNT, nm, vl);
 11     htp.p('<TD><INPUT TYPE="submit" NAME="p_form_nav_type" VALUE="Previous 10" CLASS=btnWidth1 onClick=" return chgButton(''Previous 10'')"></TD>');
 12     OWA.get_page (l_page, l_lines);
 13
 14     -- print HTTP buffer using dbms_output
 15     FOR i IN 1 .. l_lines
 16     LOOP
 17        DBMS_OUTPUT.put_line (l_page (i));
 18     END LOOP;
 19  END;
 20  /
<TD><INPUT TYPE="submit" NAME="p_form_nav_type" VALUE="Previous 10"
CLASS=btnWidth1 onClick=" return chgButton('Previous 10')"></TD>


PL/SQL procedure successfully completed.

SQL>
Previous Topic: HTP package
Next Topic: Print page having SVG Chart
Goto Forum:
  


Current Time: Sat May 26 01:29:06 CDT 2018