Home » Developer & Programmer » Forms » problem with when-timer-expired and cursor position
problem with when-timer-expired and cursor position [message #265506] Thu, 06 September 2007 08:26 Go to next message
petku
Messages: 10
Registered: September 2007
Junior Member
Hi

I have a multi-record-block and want update one item (item A, not a database item) of this block every second.

To do that, for each record in the block I have to read the values of another item (item B) and do some sql to retrieve the new value for item A.

The problem is: To get the value of item B I navigate to this field. When a user writes text and the timer fires the change of the position disturbs the user.

Is there any way to navigate through a block without change the cursor position?

Thanks for answers!

Peter
Re: problem with when-timer-expired and cursor position [message #265510 is a reply to message #265506] Thu, 06 September 2007 08:42 Go to previous messageGo to next message
Flyhard
Messages: 21
Registered: April 2007
Location: Germany
Junior Member
Could you maybe get the value of the field with something like
:BLOCK.ITEM 

or
name_in('BLOCK.ITEM')


Regards

Flyhard
Re: problem with when-timer-expired and cursor position [message #265513 is a reply to message #265510] Thu, 06 September 2007 08:45 Go to previous messageGo to next message
petku
Messages: 10
Registered: September 2007
Junior Member
This is only possible if the block has one record.

But I must get the value of item B for all records!
Re: problem with when-timer-expired and cursor position [message #266428 is a reply to message #265513] Mon, 10 September 2007 21:30 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Then retrieve all the values in a 'select' cursor directly from the database. You know the current block query so use it to get your data.

David
Re: problem with when-timer-expired and cursor position [message #267380 is a reply to message #266428] Thu, 13 September 2007 02:28 Go to previous messageGo to next message
petku
Messages: 10
Registered: September 2007
Junior Member
Hello David,

this don´t work because item A and item B are objects of the some block and both items are visible. I use a post-query-trigger to retrieve to values of the no-database-item B.

regards,
Peter
Re: problem with when-timer-expired and cursor position [message #267612 is a reply to message #267380] Thu, 13 September 2007 20:26 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
I was going to ask and suggest: "Is the user changing either Item A or B? Store the information in a record group as well as on the screen, use a When-Validate-Item on A or B to update the record_group, do your calculations on the values in the record group and then you won't have to move the focus out of the field that the user is updating."

However, I reread your posts and I need to know "Is it your intention to update values on the screen while the user is trying to key data into another field?"

David
Re: problem with when-timer-expired and cursor position [message #267737 is a reply to message #267612] Fri, 14 September 2007 08:47 Go to previous messageGo to next message
petku
Messages: 10
Registered: September 2007
Junior Member
Hello David,

You asked:
<However, I reread your posts and I need to know "Is it your intention to update values on the screen while the user is trying to key data into another field?">

Yes this is my intention.
To express this more concretely:
The block shows which container are on a conveyor belt. For each container there is one record in the block. The container-ID I called 'item A'. Some items in the record are calculated: In the record I show the position of the container on the conveyor belt (I called 'item B').

While the user is doing some work, I have to update the container position (item B) cyclic. The number and the ID of the container are fix, only the position is changing.


So far I do this with a post-query-trigger and execute_query. Before I change the block I store the actual cursor position in a global variable and move the cursor after updating back to this item. Additional I set the item attribute KEEP_POSITON = YES of every text item.


But it would be better to update without changing the cursor position!

regards,
Peter
Re: problem with when-timer-expired and cursor position [message #268204 is a reply to message #267737] Mon, 17 September 2007 23:59 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
The problem as I see it is that although you can update items in a record without moving the focus to it, you can't update another record without moving the focus to that record.

If you used a non-database block and MANUALLY populated all the items then you would be able to update them without moving the focus but you would have to wait for your user to press an 'enter' button or 'update' button before doing the screen refresh via a 'synchronize' command or you would probably shift the cursor to the beginning of the item in which they are working.

Have a look at:
Populate block using cursor
http://www.orafaq.com/forum/m/605/67467/?srch=populate+block+cursor+create_record#msg_605

David
Re: problem with when-timer-expired and cursor position [message #268709 is a reply to message #268204] Wed, 19 September 2007 07:48 Go to previous messageGo to next message
petku
Messages: 10
Registered: September 2007
Junior Member
Hi David,

I see there is no other way as to move the cursor.

It would be nice if something like that exists in forms:
itemvalue := :blockname.record(recordnumber).itemname;

But access to the records in a block is possible only with cursor operations (go_block, next_record etc.)

Regards,
Peter
Re: problem with when-timer-expired and cursor position [message #268828 is a reply to message #268709] Wed, 19 September 2007 19:27 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
If you created an item in a single record for EACH of the items that you currently have on your screen, that is, for five rows of four columns you would need 20 named items in a non-database record, then you could update any of these items without changing record.

Have you considered using two separate forms, the second one called via an 'open_form' command so that the two forms are running at the same time. Then the 'background' form could continue to be updated while the 'foreground' form can take data entry.

David
Re: problem with when-timer-expired and cursor position [message #269037 is a reply to message #268828] Thu, 20 September 2007 09:09 Go to previous messageGo to next message
petku
Messages: 10
Registered: September 2007
Junior Member
Hi David,

unfortunately the number of recored in the block changes.

The user work with an order which consists of perhaps two container. Then he changes the order number an the new order consists of perhaps ten container. In this case I use a slider because only five records are visible at the same time.

Two forms would be possible but to arrange these forms on the screen is not so easy, isn&acute;t it?

Peter
Re: problem with when-timer-expired and cursor position [message #269170 is a reply to message #269037] Thu, 20 September 2007 22:56 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
If you can get all the information on one form then you should be able to get it on two forms. They don't have to be maximised.

Also, have a look at Kevin Meade's response in this thread http://www.orafaq.com/forum/t/89395/67467/

David
Re: problem with when-timer-expired and cursor position [message #269705 is a reply to message #269170] Mon, 24 September 2007 03:42 Go to previous message
petku
Messages: 10
Registered: September 2007
Junior Member
Hello David,

thanks for your help!

The solution to use a second forms works well!

Regards
Peter
Previous Topic: how to change message type
Next Topic: Disadvantages of Oracle Forms?!
Goto Forum:
  


Current Time: Sun Dec 04 16:47:30 CST 2016

Total time taken to generate the page: 0.08907 seconds