Home » Developer & Programmer » Forms » error when changing item visual attribute property
error when changing item visual attribute property [message #283819] Wed, 28 November 2007 04:08 Go to next message
jitender.sadh
Messages: 82
Registered: May 2007
Member
hi

i want to change the visual attribute of the item on which the cursor exists.for that purpose i write code on pre-text-item at block leve
set_item_instance_property(:system.cursor_item,visual_attribute,'abc');

but at run time i got error (ora-06502).


regards
jitender.
Re: error when changing item visual attribute property [message #283828 is a reply to message #283819] Wed, 28 November 2007 04:27 Go to previous messageGo to next message
azamkhan
Messages: 548
Registered: August 2005
Senior Member
Dear the problem is that you have used PRE-TEXT-ITEM. Try to put your code in WHEN-NEW-ITEM-INSTANCE on block level.

Regards,
Azam Khan
Re: error when changing item visual attribute property [message #283834 is a reply to message #283828] Wed, 28 November 2007 04:42 Go to previous messageGo to next message
jitender.sadh
Messages: 82
Registered: May 2007
Member
hi

i have also tried that on when-new-item-instance trigger at block level but i am getting same error(ora-06502).

regards
jitender.
Re: error when changing item visual attribute property [message #283837 is a reply to message #283834] Wed, 28 November 2007 04:50 Go to previous messageGo to next message
azamkhan
Messages: 548
Registered: August 2005
Senior Member
ORA-06502 :Text: PL/SQL: numeric or value error


Cause: An arithmetic, numeric, string, conversion, or constraint error occurred.


For example, this error occurs if an attempt is made to assign the value NULL to a variable declared NOT NULL, or if an attempt is made to assign an integer larger than 99 to a variable declared NUMBER(2).


Action: Change the data, how it is manipulated, or how it is declared so that values do not violate constraints.

Regards,
Azam Khan
Re: error when changing item visual attribute property [message #283843 is a reply to message #283819] Wed, 28 November 2007 05:14 Go to previous messageGo to next message
scorpio_biker
Messages: 154
Registered: November 2005
Location: Kent, England
Senior Member
Hi,

According to the help set_item_instance_property needs 4 parameters, your example is only showing 3?
Re: error when changing item visual attribute property [message #283846 is a reply to message #283819] Wed, 28 November 2007 05:19 Go to previous messageGo to next message
azamkhan
Messages: 548
Registered: August 2005
Senior Member
Yes you are right... The parameter must be 4.
Following is the correct syntax:

SET_ITEM_INSTANCE_PROPERTY
(item_id ITEM,
record_number NUMBER,
property NUMBER,
value VARCHAR2);
OR

SET_ITEM_INSTANCE_PROPERTY
(item_id ITEM,
record_number NUMBER,
property NUMBER,
value NUMBER);
OR

SET_ITEM_INSTANCE_PROPERTY
(item_name VARCHAR2,
record_number NUMBER,
property NUMBER,
value VARCHAR2);
OR

SET_ITEM_INSTANCE_PROPERTY
(item_name VARCHAR2,
record_number NUMBER,
property NUMBER,
value NUMBER);

Regards,
Azam Khan
Re: error when changing item visual attribute property [message #283849 is a reply to message #283843] Wed, 28 November 2007 05:28 Go to previous messageGo to next message
jitender.sadh
Messages: 82
Registered: May 2007
Member
hi
now i am able to change the visual attribute of the item by writing code
SET_ITEM_INSTANCE_PROPERTY(:SYSTEM.CURSOR_ITEM,CURRENT_RECORD,VISUAL_ATTRIBUTE,'CURRENT_ITEM');
on per-text-item at block level. but this code no work on post-text-item.
actually i want that the visual attribute of a item on which the cursor exists have different colour form other item,
and when i navigate to another text item it set to default,means to at a state before navigation.


regards
jitender.
Re: error when changing item visual attribute property [message #283857 is a reply to message #283849] Wed, 28 November 2007 05:35 Go to previous messageGo to next message
azamkhan
Messages: 548
Registered: August 2005
Senior Member
First I would suggest that you should place WHEN-NEW-ITEM-INSTANCE trigger instead of pre-text-item.

Now the above trigger will set a visual attribute for the item on which U are right now.

You need now is a machenism that will set the attribute back to default when you leave this item.

So I suggest you try Pre-Text-Item and put the code for setting the attribute to default. Use :SYSTEM.CURSOR_ITEM in the item name.

Regards,
Azam Khan
Re: error when changing item visual attribute property [message #283872 is a reply to message #283857] Wed, 28 November 2007 05:52 Go to previous messageGo to next message
jitender.sadh
Messages: 82
Registered: May 2007
Member
hi
its working fine by writing code on when-new-item-instance & post-text-item but it is not working for list item, it changes the colour by executing the code written on when-new-item-instance but not able to chages back to default by executing post-text-item.



regard
jitender.
Re: error when changing item visual attribute property [message #288828 is a reply to message #283872] Tue, 18 December 2007 21:00 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Have you considered changing ALL the items on the line by using the block property 'Current Record Visual Atribute Group'?

David
Previous Topic: Customized Master-Detail Form
Next Topic: NVL with ORDER BY
Goto Forum:
  


Current Time: Wed Dec 07 14:32:10 CST 2016

Total time taken to generate the page: 0.11653 seconds