to change source table at runtime [message #324257] |
Sun, 01 June 2008 03:23 |
sd_md_rizwan@yahoo.com
Messages: 37 Registered: September 2007 Location: Saudi Arabia
|
Member |
|
|
please tell me how can i change the source table at runtime with an example, the situation is, i have 3 table with same structure, and i created 3 radio buttons and if i click radio button 1 i want the data from table1, and if i click radio button 2 then i want the data from table2 in the same fields like wise 3, please help me
|
|
|
|
Re: to change source table at runtime [message #324271 is a reply to message #324265] |
Sun, 01 June 2008 05:14 |
esraa90
Messages: 63 Registered: May 2008 Location: EGYPT
|
Member |
|
|
Or you can build three canvases.
each one based on its table.
i.e canvas1 based on table1, canvas2 based on table2 ,....
then when using radio buttons switch between those canvases.
display one and hide the others.
|
|
|
Re: to change source table at runtime [message #324296 is a reply to message #324257] |
Sun, 01 June 2008 13:22 |
urnikhil
Messages: 42 Registered: March 2008
|
Member |
|
|
Or else you can try using when-radio-changed trigger... Add logic to this trigger in such a way that it populates those text fields based on the selected radio button...
your text fields by default will be based on the table corresponding to your default button...
When user changes the radio button value, the trigger fires and updates those values based on the radio button...
- Nik.
|
|
|
|
|
|
Re: to change source table at runtime [message #324572 is a reply to message #324337] |
Tue, 03 June 2008 03:33 |
mailtokkalyan
Messages: 65 Registered: December 2006 Location: Bangalore
|
Member |
|
|
hi,
you can do this using on insert trigger.
On-Insert (block level) If :Control_Block.Radia_button='emp' Then
Insert Into emp(emp_code,name)values(:emp.emp_code,:emp.name);
Elsif :Control_Block.Radia_button='emp1' Then
Insert Into emp1(emp_code,name)values(:emp.emp_code,:emp.name);
Else
Insert Into emp2(emp_code,name)values(:emp.emp_code,:emp.name);
End If;
Pre_Query (block Level)
if :Control_Block.Radia_button='emp' then
set_block_property('emp',Query_data_source_name,'emp');
elsif :Control_Block.Radia_button='emp1' then
set_block_property('emp',Query_data_source_name,'emp1');
else
set_block_property('emp',Query_data_source_name,'emp2');
end if;
this will work...if required chk the attachment.(attachment form will have 3 tables temp_t1,temp_t2,temp_t3 Instead of emp1,emp2,emp2.
|
|
|