Home » Developer & Programmer » Forms » Disable Checkbox (oracle 10g)
Disable Checkbox [message #563578] Wed, 15 August 2012 05:42 Go to next message
abdulaziznh
Messages: 8
Registered: August 2012
Location: KSA
Junior Member
Hi i have a multirecords form and i made a main checkbox which will select/ unselect all records
CODE:
begin
    go_block('ATTENDANCE');
    FIRST_RECORD;
    if :MAIN_CHECKBOX.MAIN_CHECK_BOX = 'Y' then
        loop                     
            :ATTENDANCE.SIGGNED := 'Y' ;
            EXIT WHEN :SYSTEM.LAST_RECORD = 'TRUE';
            NEXT_RECORD;
        end loop;
    else
        loop                     
            :ATTENDANCE.SIGGNED := 'N' ;
            EXIT WHEN :SYSTEM.LAST_RECORD = 'TRUE';
            NEXT_RECORD;
        end loop;
    end if;
    FIRST_RECORD;
end;


now there is a button that i should be hit after selection to disable "lock" selected records and some selected item (i.e: main checkbox)
i used:

SET_ITEM_PROPERTY('MAIN_CHECKBOX.MAIN_CHECK_BOX', UPDATE_ALLOWED,PROPERTY_FALSE)
SET_ITEM_PROPERTY('MAIN_CHECKBOX.MAIN_CHECK_BOX', ENABLED,PROPERTY_FALSE)
SET_ITEM_PROPERTY('MAIN_CHECKBOX.MAIN_CHECK_BOX', INSERT_ALLOWED,PROPERTY_FALSE)

nothing work !!

I'm an IS student who is having his training in some company , so I'm not an expert or something

so, please guys if anyone have any idea that will help me i will be grateful
Re: Disable Checkbox [message #563579 is a reply to message #563578] Wed, 15 August 2012 06:18 Go to previous messageGo to next message
cookiemonster
Messages: 13925
Registered: September 2008
Location: Rainy Manchester
Senior Member
Looks like it should work, do you get an error message?
Re: Disable Checkbox [message #563580 is a reply to message #563579] Wed, 15 August 2012 06:28 Go to previous messageGo to next message
abdulaziznh
Messages: 8
Registered: August 2012
Location: KSA
Junior Member
no nothing at all

and when i change the value it overwrite the hole records even if i disable it
Re: Disable Checkbox [message #563581 is a reply to message #563580] Wed, 15 August 2012 06:54 Go to previous messageGo to next message
cookiemonster
Messages: 13925
Registered: September 2008
Location: Rainy Manchester
Senior Member
the hole records?

Use get_item_property to check the enabled property has been set correctly.
Re: Disable Checkbox [message #563601 is a reply to message #563581] Wed, 15 August 2012 15:18 Go to previous messageGo to next message
Littlefoot
Messages: 21813
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
A shorter version of your code might look like this:
begin
  go_block('ATTENDANCE');
  FIRST_RECORD;

  loop                     
    :ATTENDANCE.SIGGNED := :MAIN_CHECKBOX.MAIN_CHECK_BOX;
    EXIT WHEN :SYSTEM.LAST_RECORD = 'TRUE';
    NEXT_RECORD;
  end loop;

  FIRST_RECORD;
end;


I didn't quite understand what you meant by saying that "nothing works" ... what is "nothing"? Is it that code you posted doesn't check (or uncheck) all checkboxes, or is it that SET_ITEM_PROPERTY doesn't have any affect, or - bad news - nothing works at all?

Anyway, you might want to run the form in debug mode and see what is going on.
Re: Disable Checkbox [message #564541 is a reply to message #563601] Sat, 25 August 2012 02:16 Go to previous messageGo to next message
abdulaziznh
Messages: 8
Registered: August 2012
Location: KSA
Junior Member
what i meant is "SET_ITEM_PROPERTY" doesn't work, i cant disable the checkbok .. i have to disable it because it overwrite the records
Re: Disable Checkbox [message #564547 is a reply to message #564541] Sat, 25 August 2012 07:11 Go to previous messageGo to next message
cookiemonster
Messages: 13925
Registered: September 2008
Location: Rainy Manchester
Senior Member
Well set_item_property always works, unless you get an error. Are you getting an error?
Have you checked there's no other code that enables the checkbox?
Re: Disable Checkbox [message #564572 is a reply to message #564547] Sun, 26 August 2012 00:08 Go to previous messageGo to next message
abdulaziznh
Messages: 8
Registered: August 2012
Location: KSA
Junior Member
no there is no errors and i double check nothing is enabling the checkbox again
Re: Disable Checkbox [message #564602 is a reply to message #564572] Sun, 26 August 2012 08:55 Go to previous messageGo to next message
cookiemonster
Messages: 13925
Registered: September 2008
Location: Rainy Manchester
Senior Member
Then triple check.
There are exactly three options here:
1) You get an error when you try to disable the check box.
2) You aren't actually running code to disable the check box (code is being bypassed or references the wrong item)
3) Some other code is re-enabling it.

There are no other options.

So you need to debug your code to work out what's going on.
Run the form in debug mode or use get_item_property to check the property at various poinrs.
Re: Disable Checkbox [message #564760 is a reply to message #564602] Tue, 28 August 2012 08:00 Go to previous messageGo to next message
abdulaziznh
Messages: 8
Registered: August 2012
Location: KSA
Junior Member
problem solved i just need to use go_block
Re: Disable Checkbox [message #564977 is a reply to message #564760] Wed, 29 August 2012 14:44 Go to previous message
Littlefoot
Messages: 21813
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Where? There is GO_BLOCK in code you provided in the first message you posted.
Previous Topic: dynamic record group
Next Topic: frm-99999 error 408 occurred. see the release note
Goto Forum:
  


Current Time: Fri Jul 05 22:07:35 CDT 2024