Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Submitting a dynamically created form with radio buttons

Submitting a dynamically created form with radio buttons

From: Ronnie <ronnie_yours_at_yahoo.com>
Date: 1 Nov 2001 14:10:18 -0800
Message-ID: <ea603f8d.0111011410.4923f91a@posting.google.com>


I am creating a web page which dynamically creates a set of Radio Buttons based on a query. This is basically to rank the various values in a table.

I am dynamically creating radio button groups and the radio button names are also dynamically created. My problem is that when i hit the submit button it needs to call a different stored procedure to insert/update the rankings and for that the input parameters in the called procedure should be exactly same in type and number as the parameteres passed when pressing the formsubmit button.

Since I am creating the radio buttons on the fly i dont know before hand how many sets of radio buttons will be there and hence i cannot determine what the input parameters for the called procedure should be. Is there any workaround for this kind of a problem. Please suggest.

Also i am attaching the code which i am using to generate the radio buttons.

CODE



create or replace package codb_industryoperations as procedure rankindustry_operations;
function generateRadio(p_radioName in Varchar2,p_value in Number,p_attributes
in varchar2) return varchar2;
end codb_industryoperations;
/
show errors

create or replace package body codb_industryoperations as

procedure rankindustry_operations is

cursor industryCntCursor is select * from lkp_industry;

cursor operationsCntCursor (c_industry_id in number) is select a.operations_id,a.description from lkp_operations a , int_industry_operations b
where a.operations_id=b.operations_id and b.industry_id = c_industry_id;

begin

htp.print(head_title('Rank Industries/Operations')); 
htp.br; 
htp.br; 
htp.formOpen(curl =>

owa_util.get_owa_service_path||'codb_industryoperations.setRanks',cmethod
=> 'Post');

for i in industryCntCursor loop
htp.tableOpen;

htp.tableRowOpen;

htp.tableRowOpen; 
htp.tableData(generateRadio('PeerIndustry',2,'Enabled')); 
htp.tableData(head_small(i.Description)); 
htp.tableData(generateRadio('ind'||i.industry_id,2,'Enabled')); 
htp.tableData(generateRadio('ind'||i.industry_id,3,'Enabled')); 
htp.tableData(generateRadio('ind'||i.industry_id,4,'Enabled')); 
htp.tableData(generateRadio('ind'||i.industry_id,5,'Enabled')); 
htp.tableData(generateRadio('ind'||i.industry_id,6,'Enabled')); 
htp.tableData(generateRadio('ind'||i.industry_id,7,'Enabled')); 
htp.tableRowClose; 

for j in operationsCntCursor(i.industry_id) loop

htp.tableRowOpen; 
htp.tableData(''); 
htp.tableData(j.description); 
htp.tableData(generateRadio('oper'||j.operations_id,2,'Enabled')); 
htp.tableData(generateRadio('oper'||j.operations_id,3,'Enabled')); 
htp.tableData(generateRadio('oper'||j.operations_id,4,'Enabled')); 
htp.tableData(generateRadio('oper'||j.operations_id,5,'Enabled')); 
htp.tableData(generateRadio('oper'||j.operations_id,6,'Enabled')); 
htp.tableData(generateRadio('oper'||j.operations_id,7,'Enabled')); 
htp.tableRowClose; 

end loop;
htp.tableClose; 
htp.br; 
htp.br; 

end loop;

htp.formClose;
end rankindustry_operations;

Function generateRadio(p_radioName in varchar2,p_value in Number,p_attributes
in varchar2) return varchar2 is
v_radio varchar2(4000);
Begin

v_radio := htf.formradio(cname => p_radioName,cvalue =>
p_value,cattributes =>
p_attributes); 

return v_radio;
End generateRadio;

end codb_industryoperations;
/
show errors

Thanks
Ronnie Received on Thu Nov 01 2001 - 16:10:18 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US