Home » Developer & Programmer » Forms » CHECK BOX, people help I have several hours left.
CHECK BOX, people help I have several hours left. [message #84991] Tue, 18 May 2004 22:17 Go to next message
q__
Messages: 4
Registered: May 2004
Junior Member
Hello everyone,

I have correct working radio buttons. Everything is OK. There are 4 buttons, which display: a) < 100 points players b) 100< ... < 150 and c) >200 d) ALL.

So now I have to make a checkbox, which worked similar. Unfortunately, when I use this script, I can check only one Check Box, if I wanna check the check box2, then the ticle from the check box1 disappears... I use WHEN-CHECKBOX-CHANGED trigger on the check box. Here is my script:

DECLARE
             L_STR  VARCHAR2(2000):='WHERE 1=1';
             L_val  number(10):=:CHECK_BOX10;
  BEGIN
             IF :CHECK_BOX10=100 THEN
                   L_STR:=L_STR||' AND SURINKTI_TASKAI<100';
             ELSIF :CHECK_BOX10=150 THEN
                   L_STR:=L_STR||' AND SURINKTI_TASKAI BETWEEN 100 AND 150';
             ELSIF :CHECK_BOX10=200 THEN
                   L_STR:=L_STR||' AND SURINKTI_TASKAI>200';
             End IF;
            IF :CHECK_BOX7<> 0 THEN
               set_block_property('ZAIDEJAI',DEFAULT_WHERE,L_STR);
               EXECUTE_QUERY;
             END IF;
             :CHECK_BOX7:=l_val;
             L_STR:=NULL;
             set_block_property('ZAIDEJAI',DEFAULT_WHERE,L_STR);
End;


What I should change in order the script worked? There SURINKTI_TASKAI means POINTS ant ZAIDEJAI mean PLAYERS table...

Thank you in advance.

 

 
Re: CHECK BOX, people help I have several hours left. [message #84999 is a reply to message #84991] Wed, 19 May 2004 22:46 Go to previous message
Himanshu
Messages: 457
Registered: December 2001
Senior Member
Hi,
To implement this you need to create 4 separate Checkboxes.
In each of the checkboxes you need to write the code as per the value for which it is being used.
First create checkboxes say:
CHECK_BOX10 for values <100
CHECK_BOX11 for values 100<<150
CHECK_BOX12 for values >200
CHECK_BOX13 for all values
set the default value of each checkbox to N.

Write WHEN-Checkbox-chnaged on each checkbox.
& modify code as follows:

DECLARE
L_STR VARCHAR2(2000):='WHERE 1=1';
L_val Char(1):=:CHECK_BOX10;
BEGIN
If :CHECK_BOX10='Y' and (:CHECK_BOX11='Y' OR
:CHECK_BOX12='Y' OR :CHECK_BOX13='Y') Then
Message('You can select only Onc checkbox at a time');
Raise FORM_TRIGGER_FAILURE;
End If;

IF :CHECK_BOX10='Y' THEN
L_STR:=L_STR||' AND SURINKTI_TASKAI<100';
set_block_property('ZAIDEJAI',DEFAULT_WHERE,L_STR);
EXECUTE_QUERY;
END IF;
:CHECK_BOX10:=l_val;
L_STR:=NULL;
set_block_property('ZAIDEJAI',DEFAULT_WHERE,L_STR);
Exception
WHEN FORM_TRIGGER_FAILURE Then
Raise FORM_TRIGGER_FAILURE;
WHEN OTHERS then
message(sqlerrm);
End;

Repeat this Process on CHEK_BOX11 & change the check box nos accordingly+ chnage the L_STR stament as follows:
L_STR:=L_STR||' AND SURINKTI_TASKAI BETWEEN 100 AND 150';

Similarly rpeat this for all the checkboxes.

Hope this helps.

Regards
Himanshu
Previous Topic: Urgent ! Get file from mail
Next Topic: about binding variables
Goto Forum:
  


Current Time: Mon Jul 08 15:47:19 CDT 2024