Home » Developer & Programmer » Forms » selecting all check boxes in a data block by selecting one check box in control box
selecting all check boxes in a data block by selecting one check box in control box [message #82829] Tue, 08 July 2003 05:38 Go to next message
mani
Messages: 105
Registered: September 1999
Senior Member
Hi,
I need to accomplish a 'Select All' functionality in my form.
The form has data block which has 10 records.I need to select all 10 check boxes when selecting 'Select All' check box.Please guide me...

Mani.A
Re: selecting all check boxes in a data block by selecting one check box in control box [message #82832 is a reply to message #82829] Tue, 08 July 2003 06:34 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
1. Navigate to the first record in the block.
FIRST_RECORD built-in.
2. Set the checkbox.
:your_block.your_checkbox := value_when_checked;
3. Navigate to the next record and set the checkbox.
NEXT_RECORD built-in. Of course, you use a loop...
4. Exit the loop once you're at the last record.
:System.Last_Record system variable can be used here.

It is possible this might give you some problems due to the usage of restricted built-ins, but if you use a timer and WHEN-TIMER-EXPIRED trigger, you can work around this issue.

HTH,
MHE
Re: selecting all check boxes in a data block by selecting one check box in control box [message #82845 is a reply to message #82832] Wed, 09 July 2003 01:39 Go to previous message
sujit
Messages: 94
Registered: April 2002
Member
hi,
I think you can use this.
Sujit
------------------------------------------------------
if :blk_control.select_all = 'Y' then
go_block('BLK1');
first_record;
loop
:blk1.chk_j := 'Y';
exit when :system.last_record = 'TRUE';
next_record;
end loop;
else
go_block('BLK1');
first_record;
loop
:blk1.chk_j := 'N';
exit when :system.last_record = 'TRUE';
next_record;
end loop;
end if;
Previous Topic: key-enter trigger
Next Topic: Dynamic List
Goto Forum:
  


Current Time: Wed Jul 03 05:12:42 CDT 2024