programmatically filling a form field? [message #536202] |
Mon, 19 December 2011 14:01 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
ericr
Messages: 22 Registered: January 2006
|
Junior Member |
|
|
I have a form that contains a button. When a user highlights a record in a multi-record block and clicks a "Show Detail" button I save the value of the highlighted record to a global variable. I then show another form using call_form.
The receiving form is put into query mode. All I want to do is fill a field in with the passed parameter that was set in the calling form. I cannot get the parameter to show up until I exit query mode. I don't understand why this is, I simply want to fill in the field value and that's it. I want the user to add more information to the form so they can refine the query. Then execute the query manually.
How can I fill in the form field? I have tried so many different ways. :BLOCK.ITEM := value, etc.
I know this seems quite simple but I just cannot get it to work.
Thanks!
|
|
|
Re: programmatically filling a form field? [message #536205 is a reply to message #536202] |
Mon, 19 December 2011 14:28 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Quote:The receiving form is put into query mode.
That might be a culprit. Once you enter query mode, form waits for you to enter search criteria and execute query. It does nothing in between.
However, as you simply want to execute query based on a value passed through a global variable, there are a few options available. One of them is to use PRE-QUERY trigger as:block.search_item := :global.variable_name; and - in WHEN-NEW-FORM-INSTANCE trigger
Another one is to set search criteria with SET_BLOCK_PROPERTY, using its ONETIME_WHERE or DEFAULT_WHERE clause (they both might work the same way in your case). You'd write a WHEN-NEW-FORM-INSTANCE trigger asset_block_property('block', onetime_where, 'search_item = :global.variable_name');
execute_query;
P.S. Forgot to mention: global variables are of CHARACTER datatype. Note that you might need to perform data conversion in order to get correct result. Consider using parameters instead.
[Updated on: Mon, 19 December 2011 14:29] Report message to a moderator
|
|
|
Re: programmatically filling a form field? [message #536211 is a reply to message #536205] |
Mon, 19 December 2011 14:56 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
ericr
Messages: 22 Registered: January 2006
|
Junior Member |
|
|
Thanks. This has shed some light on the issue I am having. I actually tried the first method you outlined (pre-query trigger). It works in that it DOES pull back the correct information for the passed in GLOBAL parameter. The issue is that all I want to do is take the passed in value and fill in the correct field in the receiving form and NOT actually query the form. I want the user to see the passed in parameter in the form, the user will then have the option of whether they want to execute the query as is or if they want to fill in more fields thus refining the query.
I just cannot seem to find a way to fill in the form with the GLOBAL variable and then leave the form in query mode so the user can decide what to do next. Do this make sense?
Thanks again...
|
|
|
|
Re: programmatically filling a form field? [message #536218 is a reply to message #536215] |
Mon, 19 December 2011 15:21 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
ericr
Messages: 22 Registered: January 2006
|
Junior Member |
|
|
I am trying to understand what you are saying. I want the user to SEE the value before the query is executed so they can choose to input more form fields or not. They will then have to execute the query manually. A pre-query trigger will not show the value until the query is executed.
Thanks...
|
|
|
|
Re: programmatically filling a form field? [message #536364 is a reply to message #536242] |
Tue, 20 December 2011 07:45 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
ericr
Messages: 22 Registered: January 2006
|
Junior Member |
|
|
Thanks much for your help Littlefoot. I just wish that I could make the passed value appear in the text box before the query is executed. Is that just not possible?
It seems like no matter what I have tried I cannot get the passed value to appear in the correct form field until AFTER the query has been executed.
Thanks...
|
|
|
|
|
Re: programmatically filling a form field? [message #536386 is a reply to message #536385] |
Tue, 20 December 2011 11:16 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
ericr
Messages: 22 Registered: January 2006
|
Junior Member |
|
|
Sort of. After I set the invisible item's value I left the form in query mode so that the user could either fill in more fields and narrow their results OR they could just execute the query straight away with the passed value as the only parameter.
Thanks!
|
|
|
|
|
|