Home » Developer & Programmer » Forms » Modify Value of Text Field During Runtime (Oracle Forms 10g on Windows XP)
Modify Value of Text Field During Runtime [message #346764] Tue, 09 September 2008 12:09 Go to next message
davydany
Messages: 11
Registered: September 2008
Location: New Hyde Park
Junior Member
I'd like to modify a textbox's value right after the form loads (POST-FORM). I tried doing :BLOCK:ITEM := 'hi', but it says bad binding variable. Any suggestions?

(I looked around because this looks like a pretty simple thing but I couldn't find it.)
Re: Modify Value of Text Field During Runtime [message #346772 is a reply to message #346764] Tue, 09 September 2008 12:24 Go to previous messageGo to next message
szogu
Messages: 21
Registered: July 2008
Junior Member
Do you mean :BLOCK.ITEM := 'hi' ?

Regards,
Re: Modify Value of Text Field During Runtime [message #346821 is a reply to message #346764] Tue, 09 September 2008 15:49 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
"Right after the form loads" is not POST-FORM; it fires as you EXIT the form! I'd rather use WHEN-NEW-FORM-INSTANCE trigger.

(not to mention what @szogu has already said - reference an item using colon in front of a block name, and separate block and item names using a dot)
Re: Modify Value of Text Field During Runtime [message #346918 is a reply to message #346821] Wed, 10 September 2008 01:42 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Why not use an 'Initial Value'?

David
Re: Modify Value of Text Field During Runtime [message #347406 is a reply to message #346764] Thu, 11 September 2008 09:25 Go to previous messageGo to next message
davydany
Messages: 11
Registered: September 2008
Location: New Hyde Park
Junior Member
You're all right guys. I'm such a newbie at this.
szogu:
Yes I meant :BLOCK.ITEM := 'hi'

Littlefoot:
Yeah, I realized POST is for after. PRE is for before. (duh!)

djmartin:
I want to change this during runtime. I didn't see any properties that does this or builtins that did this.

Basically, the user enters a date into a text item, and it loads up the data that was entered on that date into the system.

Any thoughts? Thanks!
Re: Modify Value of Text Field During Runtime [message #347420 is a reply to message #347406] Thu, 11 September 2008 10:22 Go to previous messageGo to next message
szogu
Messages: 21
Registered: July 2008
Junior Member
1.
Quote:
I'd like to modify a textbox's value right after the form loads


2.
Quote:
Basically, the user enters a date into a text item


Now I am getting confused,
Do you want users to enter the data or the application to enter the data.


Quote:
I didn't see any properties that does this or builtins that did this


Initial Value is one of the properties of text_items,check boxes etc under DATA on the list of properties (if you open property palette).

You can use that to assign a default value (each time a new record is created) (as David said)
Re: Modify Value of Text Field During Runtime [message #347438 is a reply to message #347406] Thu, 11 September 2008 11:51 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
davydany
user enters a date into a text item, and it loads up the data that was entered on that date into the system.


If we manage to find out what is it, where to someone has entered the data and which system you are talking about, perhaps we could suggest how to load the data.

Gee, what an awful coloring!
Re: Modify Value of Text Field During Runtime [message #347463 is a reply to message #346764] Thu, 11 September 2008 13:55 Go to previous messageGo to next message
davydany
Messages: 11
Registered: September 2008
Location: New Hyde Park
Junior Member
Yeh. Obviously, I'm confused. Sorry for wasting your time. (I'm doing too many stuff at once)

so to clarify this for once in for all, this is what I want.
Please Ignore what I said the second time. Like I said, i was just doing too many things at once and I didn't think it clearly what I wanted to ask.

Ok. I'm working on Oracle Forms as an intern. And I'm learning this as I go on. So, the thing is. I want to input data into a text field.

So now, I have two text items that the user inputs the date and by a dept ID. My code queries the DB with the date and the dept ID to get info about who made the entry and update this text item during runtime dynamically and have his/her name entered into that 3rd item. I originally had both the questions that I placed, but I figured out the second one and I was thinking about it while typing. (sorry for wasting your time)

Thanks.
Re: Modify Value of Text Field During Runtime [message #347482 is a reply to message #347463] Thu, 11 September 2008 18:43 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
"Hasten slowly!" Do one thing and then the next.

Your post describes a VB mindset method of form creation. You are using Oracle Forms, remember the KISS principal, and let Oracle Forms do the work for you.

Create a new Form, with a single block. Use the wizard to base that block on your table. Only 'use' the fields in which you are interested. Do not write any code of your own.

Compile (Ctrl-Shft-k) and generate (Ctrl-t) your form. Run it. Use the menu button to go into 'enter query' mode and enter the date and department, press 'execute query'. If a record comes back then the user can update the name field. It no records are found then they can key in the date, department, and name.

Remember, at this phase of development, do not write any code of your own!

David
Re: Modify Value of Text Field During Runtime [message #349054 is a reply to message #347482] Thu, 18 September 2008 13:13 Go to previous message
davydany
Messages: 11
Registered: September 2008
Location: New Hyde Park
Junior Member
You're right David. Thank you. I spent the time looking through this forum and the Help in Oracle after reading what you said, and I realized how simple this is. Thanks!
Previous Topic: oracle.forms.webutil.ole.olefunctions
Next Topic: create controls at runtime
Goto Forum:
  


Current Time: Thu Dec 08 22:20:30 CST 2016

Total time taken to generate the page: 0.41463 seconds