Home » Developer & Programmer » Forms » Disable Item in a Block (merged 3) (Forms [32 Bit] Version 6.0.8.11.3; Oracle Database 11g Enterprise Edition )
icon1.gif  Disable Item in a Block (merged 3) [message #679266] Wed, 19 February 2020 13:23 Go to next message
anil4oracle
Messages: 6
Registered: February 2020
Junior Member
I am new to forms and have been tasked to do the following.

Disable the field(FOREIGN_ACCEPTOR_NO) in the block for certain records based on the value in 1st column (Card_Type_ID). The screenshot is a popup from the main form.

Request some input on:

1. How to disable that one field while leaving others editable?
2. Where is the best place to do this?

Thanks
  • Attachment: Capture.JPG
    (Size: 199.71KB, Downloaded 63 times)
Disable Item in a Block [message #679268 is a reply to message #679266] Wed, 19 February 2020 13:57 Go to previous messageGo to next message
anil4oracle
Messages: 6
Registered: February 2020
Junior Member
Request some input on the following task:

1. Popup form based on a data-block (from a single table) - Attached snapshot
2. Need to disable Column3 (Foreign Acceptor No) of select records having values in Column1 (Card Type ID)


/foru/forum/fa/14285/0/
  • Attachment: Capture.JPG
    (Size: 141.62KB, Downloaded 65 times)
Re: Disable Item in a Block [message #679272 is a reply to message #679266] Wed, 19 February 2020 14:28 Go to previous messageGo to next message
buggleboy007
Messages: 248
Registered: November 2010
Location: Canada
Senior Member
Try the following:
Set_Item_Property(ITEM_ID,NAVIGABLE,PROPERTY_FALSE);
Re: Disable Item in a Block (merged 3) [message #679273 is a reply to message #679266] Wed, 19 February 2020 14:33 Go to previous messageGo to next message
buggleboy007
Messages: 248
Registered: November 2010
Location: Canada
Senior Member
I could be wrong based on what I have said. I am new to FORMS as well but would start with what I have mentioned. In case it does not work, then read the following:

https://stackoverflow.com/questions/31266287/disable-text-fields-depending-upon-the-value-in-other-text-field-retrieved-using
http://www.orafaq.com/forum/t/70166/
Re: Disable Item in a Block (merged 3) [message #679275 is a reply to message #679266] Wed, 19 February 2020 16:36 Go to previous messageGo to next message
anil4oracle
Messages: 6
Registered: February 2020
Junior Member
Thanks for your quick reply buggleboy007, however, it did not work. I checked out the posts listed, but couldn't find anything I could use. Appreciate you looking into it.
Re: Disable Item in a Block (merged 3) [message #679276 is a reply to message #679275] Wed, 19 February 2020 16:49 Go to previous messageGo to next message
buggleboy007
Messages: 248
Registered: November 2010
Location: Canada
Senior Member
anil4oracle wrote on Wed, 19 February 2020 16:36
Thanks for your quick reply buggleboy007, however, it did not work. I checked out the posts listed, but couldn't find anything I could use. Appreciate you looking into it.
When you say it did not work, what do you mean by it? Secondly, what have you tried? Could you post it? Even I am new to Forms so may be we both can learn from each other.

BTW - The field that you want to make it non-editable, is it based on a specific condition or is it non-editable across the board i.e. for all records? If so, then you can change the properties in the 'Property Palette'.
Re: Disable Item in a Block (merged 3) [message #679277 is a reply to message #679276] Wed, 19 February 2020 17:33 Go to previous messageGo to next message
anil4oracle
Messages: 6
Registered: February 2020
Junior Member
Yes, it is based on the value in first column(Dropdown). I tried both set_item_property and set_item_instance_property

When the user goes to this popup screen, I pre-populate the data in Column3/Foreign_Acceptor_No and they don't want the user to change it, but only for certain select records(key on value in Col1)

--Full code snippet in the attached.

IF :site_network.card_type_id IN (7, 109) --Column1 Value Condition
THEN
--set_item_instance_property('SITE_NETWORK.FOREIGN_ACCEPTOR_NO', current_record, update_allowed, property_true);
set_item_property('SITE_NETWORK.FOREIGN_ACCEPTOR_NO', navigable, property_false);
ELSE
--set_item_instance_property('SITE_NETWORK.FOREIGN_ACCEPTOR_NO', current_record, update_allowed, property_false);
set_item_property('SITE_NETWORK.FOREIGN_ACCEPTOR_NO', navigable, property_true);
END IF;
  • Attachment: add_sn.sql
    (Size: 2.12KB, Downloaded 47 times)
Re: Disable Item in a Block (merged 3) [message #679278 is a reply to message #679277] Wed, 19 February 2020 18:29 Go to previous messageGo to next message
buggleboy007
Messages: 248
Registered: November 2010
Location: Canada
Senior Member
Try this:
set_item_property('SITE_NETWORK.FOREIGN_ACCEPTOR_NO', enabled, property_false);
()
Re: Disable Item in a Block (merged 3) [message #679279 is a reply to message #679278] Wed, 19 February 2020 18:59 Go to previous messageGo to next message
anil4oracle
Messages: 6
Registered: February 2020
Junior Member
Cool buggleboy007, we made some progress (-: The column is disabled now.

Only issue I have now is it disabled the whole column for ALL records. Ideally, we would like that field to be editable based on first column.

Really appreciate your help with this.
  • Attachment: Capture.JPG
    (Size: 56.18KB, Downloaded 56 times)
Re: Disable Item in a Block (merged 3) [message #679281 is a reply to message #679279] Wed, 19 February 2020 19:37 Go to previous messageGo to next message
buggleboy007
Messages: 248
Registered: November 2010
Location: Canada
Senior Member
Ok. Using the property that I furnished, find a way to have your issue fixed. Try searching on Oracle's forms forums and see if you can get an answer.

I am sailing in the same boat as you. So cannot help you beyond this :(-
Re: Disable Item in a Block (merged 3) [message #679290 is a reply to message #679281] Thu, 20 February 2020 02:45 Go to previous messageGo to next message
cookiemonster
Messages: 13894
Registered: September 2008
Location: Rainy Manchester
Senior Member
I suggest you read the forms help topics on set_item_property and set_item_instance_property.
Set_item_property affects all records
Set_item_instance_property affects the specified record only

Unfortunately you can't set enabled with set_item_instance_property.

Form builder help is incredibly detailed and you should make use of it.
The topics mentioned above list every property they can set, with examples, and link through to the help pages for properties.
The help page for each property will mention all the ways the property can be set.
Re: Disable Item in a Block (merged 3) [message #679304 is a reply to message #679290] Thu, 20 February 2020 08:53 Go to previous messageGo to next message
buggleboy007
Messages: 248
Registered: November 2010
Location: Canada
Senior Member
@Anil: Cookiemonster is right. SET_ITEM_INSTANCE property is only for that specific text item of the record, where as SET_ITEM_PROPERTY is for the entire items of that block. This is what the manual says:

SET_ITEM_INSTANCE_PROPERTY
Modifies all instances of an item in a block by changing a specified item property
SET_ITEM_PROPERTY built-in
Description
Modifies all instances of an item in a block by changing a specified item property. Note that in some
cases you can get but not set certain object properties.

Re: Disable Item in a Block (merged 3) [message #679319 is a reply to message #679304] Fri, 21 February 2020 03:14 Go to previous messageGo to next message
cookiemonster
Messages: 13894
Registered: September 2008
Location: Rainy Manchester
Senior Member
If the manual says that it would be a typo.
The description is the same for both.
Re: Disable Item in a Block (merged 3) [message #679335 is a reply to message #679319] Sat, 22 February 2020 09:41 Go to previous messageGo to next message
anil4oracle
Messages: 6
Registered: February 2020
Junior Member
I agree the manual is very detailed with examples. I did read about both those built-in procedures. I tried using SET_ITEM_INSTANCE with the "UPDATE_ALLOWED" but that didn't seem to work. For now I have disabled the whole column a using approach suggested by buggleboy007 and it might be OK for our users.

I was just curious if there was any other option to handle this.

Appreciate your valuable inputs.

Re: Disable Item in a Block (merged 3) [message #679339 is a reply to message #679335] Mon, 24 February 2020 04:03 Go to previous message
cookiemonster
Messages: 13894
Registered: September 2008
Location: Rainy Manchester
Senior Member
anil4oracle wrote on Sat, 22 February 2020 15:41

I agree the manual is very detailed with examples. I did read about both those built-in procedures. I tried using SET_ITEM_INSTANCE with the "UPDATE_ALLOWED" but that didn't seem to work.
It was never going to work, which you'd know if you read the help topics properly. update_allowed is not one of the small set of properties that can be set with site_item_instance

anil4oracle wrote on Sat, 22 February 2020 15:41

I was just curious if there was any other option to handle this.
The properties set_item_instance_property does let you set allow you to rendered an item unchangeable - insert_allowed, update_allowed, navigable - and then set visual attribute to make it obvious it can't be set.
Previous Topic: sign in to oracle enterprises manager fusion middle ware control 12c
Next Topic: Capturing photo from webcam in oracle forms
Goto Forum:
  


Current Time: Wed May 27 02:18:06 CDT 2020