Home » Developer & Programmer » Forms » How to ENABLE/DISABLE an item dynamically during Form6i run-time (Oracle 10g Forms 6i Windows)
How to ENABLE/DISABLE an item dynamically during Form6i run-time [message #548669] Sat, 24 March 2012 01:47 Go to next message
ashussain
Messages: 35
Registered: March 2011
Location: Saudi Arabia
Member

Hello Experts!

Hope u all doing fine.
I am here with another problem.
I have a master-detail form showing multiple records (tabular) in data-block. Now my problem is, based on certain column's value of a particular item in a particular row on the data-block to ENABLE/DISABLE during run-time .

For example, in a detail-block of 5 rows, if 3rd row's 'detail-block.item1' is equal to lets say, "X", then 'detail-block.item2' of that particular row ONLY must be 'disabled'. otherwise, it must 'enable' the 'detail-block.item2' of that particular item in that particular row on the data-block.

Even when, I query the form, it must enable/disable that particular item of that particular row from the data-block based on item1's value.

please some body help me to solve this.

thank you very much in advance to one and all.
Re: How to ENABLE/DISABLE an item dynamically during Form6i run-time [message #548673 is a reply to message #548669] Sat, 24 March 2012 05:15 Go to previous messageGo to next message
cookiemonster
Messages: 13923
Registered: September 2008
Location: Rainy Manchester
Senior Member
You can't set the enabled property for an individual row of an item.
Best you can do is set insert and update allowed to false and change the visual attribute to make it look like it's disabled.
Use set_item_instance_property to do this.
Re: How to ENABLE/DISABLE an item dynamically during Form6i run-time [message #548674 is a reply to message #548673] Sat, 24 March 2012 05:16 Go to previous messageGo to next message
cookiemonster
Messages: 13923
Registered: September 2008
Location: Rainy Manchester
Senior Member
Put the necessary code in the when-validate-item trigger on item1 and post-query on the block.
Re: How to ENABLE/DISABLE an item dynamically during Form6i run-time [message #548676 is a reply to message #548674] Sat, 24 March 2012 05:44 Go to previous messageGo to next message
ashussain
Messages: 35
Registered: March 2011
Location: Saudi Arabia
Member

actually I want to DISABLE a push button of particular row, if 'Status' (an item on form) of that particular row shows "Returned".
If the "Status" shows "Using" the push button should be ENABLE.
Re: How to ENABLE/DISABLE an item dynamically during Form6i run-time [message #548679 is a reply to message #548676] Sat, 24 March 2012 07:21 Go to previous messageGo to next message
cookiemonster
Messages: 13923
Registered: September 2008
Location: Rainy Manchester
Senior Member
You can't set the enabled property of any item on a per row basis.
2 Choices:
1) Have code in the when-button-pressed that raises an error if the button should be disabled.
2) Make the button part of a seperate data block and have it appear on the canvas once, rather than once per row. Then you can enable/disable it using when-new-record-instance and when-validate-item.
Re: How to ENABLE/DISABLE an item dynamically during Form6i run-time [message #608857 is a reply to message #548679] Tue, 25 February 2014 09:46 Go to previous messageGo to next message
BrianRobbins
Messages: 2
Registered: February 2014
Junior Member
If this has not been resolved, I think 6i still includes the set_item_instance property. I'm pretty sure that's what you're looking for
Re: How to ENABLE/DISABLE an item dynamically during Form6i run-time [message #608858 is a reply to message #608857] Tue, 25 February 2014 10:04 Go to previous messageGo to next message
cookiemonster
Messages: 13923
Registered: September 2008
Location: Rainy Manchester
Senior Member
Yes it's in 6i, and later versions.
But you can't use it to set the enabled property, hence my earlier comments.
Re: How to ENABLE/DISABLE an item dynamically during Form6i run-time [message #608859 is a reply to message #608858] Tue, 25 February 2014 10:15 Go to previous message
BrianRobbins
Messages: 2
Registered: February 2014
Junior Member
Ahh, my bad. Disregard
Previous Topic: updation is not happening when do insrt and update in same procedure in oracle forms
Next Topic: User Authentication in Forms 11g
Goto Forum:
  


Current Time: Fri May 17 00:36:58 CDT 2024