caldernet
asked on
How do I move text from a a detail field to a button label?
Oracle Forms - 10g
I have a working form with a standard header/detail one to many relationship. (Up to 4 detail lines are displayed at any one time.)
I would like to add push buttons to the detail section, displaying (in the label) text from another column from the details table. (After I'll do something when the button is pushed, but I won't worry about that now.)
I have been able to add a Text Item to the details and display the data from the new column there, but I want to be able to see this data on the push buttons. I assume I need to do one of the following:
A. Get the data to appear directly on the push buttons the way I can using the Display Item item.
B. Automatically copy the text from the Display Item fields to my push buttons.
Attached you will find a screen capture which I hope helps in the understanding of my problem.
Thank you.
FORM1.jpg
I have a working form with a standard header/detail one to many relationship. (Up to 4 detail lines are displayed at any one time.)
I would like to add push buttons to the detail section, displaying (in the label) text from another column from the details table. (After I'll do something when the button is pushed, but I won't worry about that now.)
I have been able to add a Text Item to the details and display the data from the new column there, but I want to be able to see this data on the push buttons. I assume I need to do one of the following:
A. Get the data to appear directly on the push buttons the way I can using the Display Item item.
B. Automatically copy the text from the Display Item fields to my push buttons.
Attached you will find a screen capture which I hope helps in the understanding of my problem.
Thank you.
FORM1.jpg
Why do you need a push button there ? you can't simply populate data of a text item into a push button.
ASKER
I am planning on having a push button open an associated attachment.
For now, I would like to simply populate data of a text item (TDNB_TEXT) into the label of my push button (TDNB_PUSH_BUTTON) but I simply don't know how to do it.
The following may be close but it gives me an error
FIRST_RECORD;
While :system.Last_Record <> 'TRUE' LOOP
set_item_property(':d20re. TDNB_PUSH_ BUTTON', label, :d20re.TDNB_TEXT);
NEXT_RECORD;
END LOOP;
For now, I would like to simply populate data of a text item (TDNB_TEXT) into the label of my push button (TDNB_PUSH_BUTTON) but I simply don't know how to do it.
The following may be close but it gives me an error
FIRST_RECORD;
While :system.Last_Record <> 'TRUE' LOOP
set_item_property(':d20re.
NEXT_RECORD;
END LOOP;
ASKER
_____ I put the following in the detail block's POST-QUERY trigger and it appears to do NOTHING.___
_____ It compiles OK __________________________ ____--
DECLARE
aa varchar(128);
BEGIN
while :system.last_record = 'False' loop
aa := :d20re.tdnb_text;
set_item_property('tdnb_pu sh_button' , label, aa);
next_record;
end loop;
END;
_____ It compiles OK __________________________
DECLARE
aa varchar(128);
BEGIN
while :system.last_record = 'False' loop
aa := :d20re.tdnb_text;
set_item_property('tdnb_pu
next_record;
end loop;
END;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
For the moment, I'm testing jwahl's solution as it appears simpler. However...
- Should the trigger not be WHEN-MOUSE-CLICK, rather than WHEN-NEW-ITEM-INSTANCE (which fires when the fields are loaded) ?
- How do I make these fields "unbound" ? What would this accomplish?
- Right now pressing ENTER when my new "button" has focus tabs me to the next field...how could make ENTER = mouse click ?
Thanks.
- Should the trigger not be WHEN-MOUSE-CLICK, rather than WHEN-NEW-ITEM-INSTANCE (which fires when the fields are loaded) ?
- How do I make these fields "unbound" ? What would this accomplish?
- Right now pressing ENTER when my new "button" has focus tabs me to the next field...how could make ENTER = mouse click ?
Thanks.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks - I assume I still want to be Database Item = Yes, as I like the fact that the text on my "button" shows the data from the database automatically.
Please let me know why you think I might want to disconnect this field from database.
(I imagine I'll be assigning points for this question shortly.)
Please let me know why you think I might want to disconnect this field from database.
(I imagine I'll be assigning points for this question shortly.)
you have to set Database Item = Yes only if you want the data of the field to be stored in the database!
but in your case it's only a display item - so set database item=no ...
but in your case it's only a display item - so set database item=no ...
ASKER
When I set Database Item = No, I no longer see the contents of the field on the "button", so I'm setting it back to "Yes".
Setting Update Allowed = No will prevent anybody from changing the contents of this column.
Thanks.
Bruce C.
Setting Update Allowed = No will prevent anybody from changing the contents of this column.
Thanks.
Bruce C.
ASKER
Actually, my button was set to "Text Item" - So I changed it to "Display Item" (so "Update Allowed" is no longer a parameter.)
I still have to have it set to Database Item = Yes or the text will not display.
Curiously, I have another Display Item with the Datatase Item set to No which does display that column's data.
I still have to have it set to Database Item = Yes or the text will not display.
Curiously, I have another Display Item with the Datatase Item set to No which does display that column's data.