Home » Developer & Programmer » Forms » DYNAMICALLY SETTING ITEM PROPERTY
DYNAMICALLY SETTING ITEM PROPERTY [message #115564] Tue, 12 April 2005 12:15 Go to next message
AAKHEEB
Messages: 9
Registered: June 2004
Junior Member
HI ,
I HAVE A TABLE HAVING FOLLOWING COLUMNS
WHICH STORING ITEM PROPERTY AND ITS VALUE .
I AM USING PROCEDURE WHICH
WILL SET ALL ITEM PROPERTYS DYNAMICALLY


FIELDS_INFO

FILEDNAME FTYPE PROPERTYS VALUE FORMNAME
ENAME TEXTITEM VISIBLE PROPERTY_TRUE EMP


PROCEDURE VALIDATE_FIELDS(FNAME VARCHAR2)
IS
CURSOR C1 IS SELECT * FROM FIELDS_INFO WHERE FORM_NAME=FNAME;
BEGIN
FOR I IN C1
LOOP
SET_ITEM_PROPERTY(I.FIELDNAME,I.PROPERTYS,i.val); -- LINE 7 ERROR
--SET_ITEM_PROPERTY(I.FIELDNAME,VISIBLE,i.val); -- LINE 8 NO ERROR
END LOOP;
END;

IN THIS PROCEDURE IT'S NOT ALLOWING TO SET THE PROPERTY DYNAMICALLY
AT LINE NO 7
CAN ANYBODY HELP ME
Re: DYNAMICALLY SETTING ITEM PROPERTY [message #115603 is a reply to message #115564] Tue, 12 April 2005 19:27 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
I am not sure of your objectives. However, if you want to load multiple values you may want to look at set_item_instance_property and then increment the row number as part of your loop.

ps. Please stop 'SHOUTING'. Write your entries in mixed case, it is much easier to read.

[Updated on: Tue, 12 April 2005 19:28]

Report message to a moderator

Re: DYNAMICALLY SETTING ITEM PROPERTY [message #115621 is a reply to message #115603] Wed, 13 April 2005 02:31 Go to previous messageGo to next message
AAKHEEB
Messages: 9
Registered: June 2004
Junior Member
Hi
Thanku For Replay .
My Exact problem is like this

i am Storeing fieldname ,fieldtype ,fieldpropertys,fieldvalue,formname
in table named as fileds_info

i am creating procedure
suth that it will fetch filedname,fieldpropertys,filedvalue
from the table and it will set.

for that my statement

set_item_property(cursor.fieldname,cursor.filedpropertys,cursor.fielvalue)
-- erorr


Default

set_item_property(itemname,property,value);

Here what i observed is my propertys column having varchar2 value
but in syntax
set_item_property(
itemname item,
property number, -- table value varchar
value varchar2(5)
)


Now how to find the equal number for visible ,enable propertys
so that i can assign this value in the loop

Thanku


Re: DYNAMICALLY SETTING ITEM PROPERTY [message #115624 is a reply to message #115564] Wed, 13 April 2005 03:55 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
I am having trouble working out what you are trying to do. I will look at it again tomorrow.
Re: DYNAMICALLY SETTING ITEM PROPERTY [message #243130 is a reply to message #115564] Wed, 06 June 2007 03:36 Go to previous messageGo to next message
SWATI15.U
Messages: 6
Registered: June 2007
Location: DELHI
Junior Member

did u get the solution of DYNAMICALLY SETTING ITEM PROPERTY?we are having the same issue,if yes please shared it with us ..
Re: DYNAMICALLY SETTING ITEM PROPERTY [message #243235 is a reply to message #115564] Wed, 06 June 2007 10:23 Go to previous messageGo to next message
hemavb
Messages: 103
Registered: May 2007
Location: Dubai , UAE
Senior Member
dunno if this will help.

when you way
SET_ITEM_PROPERTY(i.item_name, i.property_name, i.property_setting);

what happens here is that all the three values are posted as STRINGS.

Now the first argument.. i.item_name, the name of the item can be a string. Unless you pass the ID of the item.

The last argument should be a Boolean value if its of true/false style or it can also be a string value.

when it comes to the 2nd argument, this argument is NOT a string. Forms has a NUMBER for each of is properties (for those of you who have done C++, Forms uses Enumeration) Each property name co-incides with a number which is actually passed to the set_item_property an get_item_property functions.

That is why you always write:
SET_ITEM_PROPERTY('emp.ename', VISIBLE, PROPERTY_FALSE); -- Correct

not as...
SET_ITEM_PROPERTY('emp.ename', 'VISIBLE', PROPERTY_FALSE); -- Wrong


So using " SET_ITEM_PROPERTY(i.item_name, i.property_name, i.property_setting) " will actually not work. as the cursor value gets passed as a string and not as the number.

Hope it helps.

[Updated on: Wed, 06 June 2007 10:25]

Report message to a moderator

Re: DYNAMICALLY SETTING ITEM PROPERTY [message #243572 is a reply to message #243235] Thu, 07 June 2007 15:13 Go to previous messageGo to next message
NizamUlMulk
Messages: 11
Registered: May 2007
Location: Paraguay
Junior Member

set_item_property(i.itemname, i.property_name, i.value) is wrong

1.- i.itemname must include blockname {'BLOCK.'||i.itemname};
2.- i.value dosn´t work when it must be PROPERTY_TRUE or PROPERTY_FALSE.

you must put the question:
if i.value = 'PROPERTY_TRUE' then
set_item_property('BLOCK.'||i.itemname, i.property_name, PROPERTY_TRUE);
elsif i.value = 'PROPERTY_FALSE' then
set_item_property('BLOCK.'||i.itemname, i.property_name, PROPERTY_FALSE);
else -- a char property
set_item_property('BLOCK.'||i.itemname, i.property_name, i.value);
end if;

That works!
Re: DYNAMICALLY SETTING ITEM PROPERTY [message #243605 is a reply to message #243572] Fri, 08 June 2007 00:02 Go to previous messageGo to next message
SWATI15.U
Messages: 6
Registered: June 2007
Location: DELHI
Junior Member

i got one solution to solve this issue..i used number value instead of char..but in case of prompt_text setting it won't work..
is any solution to solve this issue..
Re: DYNAMICALLY SETTING ITEM PROPERTY [message #243814 is a reply to message #115564] Sat, 09 June 2007 04:16 Go to previous message
hemavb
Messages: 103
Registered: May 2007
Location: Dubai , UAE
Senior Member
number for what?
value or property name?
Previous Topic: Set Text Item visible to false if it's contents are null
Next Topic: Strange Problem :-(
Goto Forum:
  


Current Time: Fri Dec 09 06:17:36 CST 2016

Total time taken to generate the page: 0.11847 seconds