Home » Developer & Programmer » Forms » Enable/disable only item (field) based in other checkbox field type (Oracle Forms Builder 11G)
Enable/disable only item (field) based in other checkbox field type [message #635836] Thu, 09 April 2015 14:56 Go to next message
brjeansilva
Messages: 5
Registered: April 2015
Location: São Paulo, Brazil
Junior Member

Hi All,

I'm new member! Thanks for atention and sorry for my english.

I need know how do for disable or enable only a item (text item field type) based in other checkbox field type and not all my block.

For example bellow:

--Enable/Disable TEXT_ITEM1
IF   (NVL(:UNINEG_TIPO_DESPESAS.CHECK_BOX_ITEM, 'N') = 'N') THEN
     SET_ITEM_INSTANCE_PROPERTY ('TEXT_ITEM', CURRENT_RECORD, UPDATE_ALLOWED, PROPERTY_FALSE);
     SET_ITEM_PROPERTY          ('TEXT_ITEM', BACKGROUND_COLOR, 'r214g214b214');
ELSE
     SET_ITEM_PROPERTY          ('TEXT_ITEM', BACKGROUND_COLOR, 'r255g255b255');
     SET_ITEM_INSTANCE_PROPERTY ('TEXT_ITEM', CURRENT_RECORD, UPDATE_ALLOWED, PROPERTY_TRUE);
END IF;



I did inserted the code up, in post-query and pre-record triggers from my block and when-checkbox-changed in trigger from checkbox item, but, no functioned. The system saw the selected line only and enable/disable all my block instead of disable only the line selected.

Anybody can help me, please?

Thanks guys!

[Updated on: Thu, 09 April 2015 14:58]

Report message to a moderator

Re: Enable/disable only item (field) based in other checkbox field type [message #635863 is a reply to message #635836] Fri, 10 April 2015 03:05 Go to previous messageGo to next message
cookiemonster
Messages: 13894
Registered: September 2008
Location: Rainy Manchester
Senior Member
The above code sets the update allowed for a single instance of an item in a block and the background colour of all the instances of the item in the block. You can set visual_attribute using set_item_instance_property.
Re: Enable/disable only item (field) based in other checkbox field type [message #635951 is a reply to message #635863] Mon, 13 April 2015 12:37 Go to previous messageGo to next message
brjeansilva
Messages: 5
Registered: April 2015
Location: São Paulo, Brazil
Junior Member

Hi cookiemonster,

Firstly, thanks for your replay and help

When I set the set_item_instance_property in visual_attribute in post-query and pre-record triggers show error bellow.

/forum/fa/12622/0/

But, in method above first topic, not me show error.

Thanks and regards!
  • Attachment: Error.png
    (Size: 3.79KB, Downloaded 8059 times)
Re: Enable/disable only item (field) based in other checkbox field type [message #635953 is a reply to message #635951] Mon, 13 April 2015 16:58 Go to previous messageGo to next message
CraigB
Messages: 386
Registered: August 2014
Location: Utah, USA
Senior Member
Show us your code... My first impression is that you are not passing the CURRENT_RECORD parameter to the Set_Item_Instance_Property() built-in, but we need to see your code to confirm what the cause is.

Craig...
Re: Enable/disable only item (field) based in other checkbox field type [message #636005 is a reply to message #635953] Tue, 14 April 2015 08:22 Go to previous messageGo to next message
brjeansilva
Messages: 5
Registered: April 2015
Location: São Paulo, Brazil
Junior Member

Hi Craig,

Thanks for help!

Bellow my code, I'm inserted in post-query and pre-record triggers from my block and when-checkbox-changed, when-validate-item and post-change trigger in my check-box item.

Quote:

--Enable/Disable TEXT_ITEM
IF (NVL(:MY_BLOCK.CHECK_BOX_ITEM, 'N') = 'S') THEN
SET_ITEM_INSTANCE_PROPERTY ('TEXT_ITEM', CURRENT_RECORD, UPDATE_ALLOWED, PROPERTY_FALSE);
SET_ITEM_INSTANCE_PROPERTY ('TEXT_ITEM', CURRENT_RECORD, NAVIGABLE, PROPERTY_FALSE);
SET_ITEM_PROPERTY ('TEXT_ITEM', BACKGROUND_COLOR, 'r214g214b214');
ELSE
SET_ITEM_PROPERTY ('TEXT_ITEM', BACKGROUND_COLOR, 'r255g255b255');
SET_ITEM_INSTANCE_PROPERTY ('TEXT_ITEM', CURRENT_RECORD, UPDATE_ALLOWED, PROPERTY_TRUE);
SET_ITEM_INSTANCE_PROPERTY ('TEXT_ITEM', CURRENT_RECORD, NAVIGABLE, PROPERTY_TRUE);
END IF;



Thanks and regards!
Jean Silva
Re: Enable/disable only item (field) based in other checkbox field type [message #636008 is a reply to message #636005] Tue, 14 April 2015 09:37 Go to previous messageGo to next message
cookiemonster
Messages: 13894
Registered: September 2008
Location: Rainy Manchester
Senior Member
That code doesn't set visual_attribute at any point.
Re: Enable/disable only item (field) based in other checkbox field type [message #636013 is a reply to message #636008] Tue, 14 April 2015 12:03 Go to previous messageGo to next message
brjeansilva
Messages: 5
Registered: April 2015
Location: São Paulo, Brazil
Junior Member

How do I can do it? Please!
Re: Enable/disable only item (field) based in other checkbox field type [message #636028 is a reply to message #636013] Wed, 15 April 2015 03:04 Go to previous messageGo to next message
cookiemonster
Messages: 13894
Registered: September 2008
Location: Rainy Manchester
Senior Member
The same way you set other properties. You do need to have some visual attributes set up. Form builder help describes all this in detail - have a look.
Re: Enable/disable only item (field) based in other checkbox field type [message #636047 is a reply to message #636028] Wed, 15 April 2015 10:14 Go to previous messageGo to next message
CraigB
Messages: 386
Registered: August 2014
Location: Utah, USA
Senior Member
Jean,
Quote:
SET_ITEM_PROPERTY ('TEXT_ITEM', BACKGROUND_COLOR, 'r214g214b214');
 ELSE
 SET_ITEM_PROPERTY ('TEXT_ITEM', BACKGROUND_COLOR, 'r255g255b255');

This code will set the background_color for all instances of the TEXT_ITEM object. Like CookieMonster stated, you want to create a Visual Attribute object (in the Visual Attribute node of the Object Navigator) for each background color and then use the Set_Item_Instance_Property() built-in to set your different background colors.

Craig...
Re: Enable/disable only item (field) based in other checkbox field type [message #636058 is a reply to message #636047] Wed, 15 April 2015 13:09 Go to previous message
brjeansilva
Messages: 5
Registered: April 2015
Location: São Paulo, Brazil
Junior Member

Hi,

Thank so much Craig and cookiemonster!

I got with help from you two!

Thanks a lot!
Previous Topic: Oracle forms impact due to OS upgrade
Next Topic: form not displaying
Goto Forum:
  


Current Time: Fri Aug 14 10:08:32 CDT 2020