When I use the standard Browsetemplate to update a record I:
1) Choose the record in the browse and the update form is called
2) Update the data and pressed OK-button on update form
Now the Browsetemplate updates the browse and returns the selection-bar on
the record I selected in the browse. Nice and simple!
I need to select the record in the browse, update the data (without update
form) and reset the Browse to show the new data and maintain the position.
Why is that so hard???
--
Regards,
Henrik Kartin
Kartin Data
Denmark
"Henrik Kartin" <h...@kartindata.dk> wrote in message
news:3d8d...@news.softvelocity.com...
1) Define a source module eg. UpdateMyBrowse with your update code in it
2) Define a 'Update from Browse Box' extension to your browse and give it
the above module's name
3) At the end of your source code, simply set GlobalResponse to the
appropriate value and tada!
HTH
Willie van Rensburg
bo...@bovan.net
Somerset West, SA
'Clarion doesn't make you a better person, just a better programmer !'
"Henrik Kartin" <h...@kartindata.dk> wrote in message
news:3d8d...@news.softvelocity.com...
! Updates the record (UpdateMyBrowse)
COM:COUNTER = COM:COUNTER + 1
! etc. whatever your update has to do
PUT(COMPANY)
! save the record
GLOBALRESPONSE = 1
! this is the value that a form normally returns whenever the record was
changed
! return 2 if you want to pretend to be a form that cancelled
Willie van Rensburg
bo...@bovan.net
Somerset West, SA
'Clarion doesn't make you a better person, just a better programmer !'
"Willie van Rensburg" <bo...@bovan.net> wrote in message
news:3d8e...@news.softvelocity.com...
I usually use:
BRW.ResetFromBuffer
BRW.ResetQueue(reset:queue)
BRW.PostNewSelection
I works most of the time.
John
In the beginning I also struggled with all that stuff, but it really was a
lot of trouble to remember to put everything in everytime (I'm a lazy kind
of a fellow :)
The method I use has served me well so far: The record is updated properly,
any values in the browse/queue/view are updated correctly, and the scrollbar
stays on the selected record.
I haven't studied the template/methods in detail, (I found my method by
looking at the source of the module that was generated by the template, and
tried to make the least changes) but I THINK that the proper GlobalResponse
causes the Browse itself to call the methods you propose.
That's what I think anyhow ...
Willie van Rensburg
bo...@bovan.net
Somerset West, SA
'Clarion doesn't make you a better person, just a better programmer !'
"John" <j-del...@globalesoft.com> wrote in message
news:3d8e2c5...@news.softvelocity.com...
On Sun, 22 Sep 2002 19:27:49 +0200, "Henrik Kartin"
<h...@kartindata.dk> wrote:
>I need to select the record in the browse, update the data (without update
>form) and reset the Browse to show the new data and maintain the position.
>Why is that so hard???
It is not but it takes a bit of figuring out<g> I had an app where I
was using a button to move data from one listbox to another where the
data was customer related. Basically select a customer, select a
product and hit a button and the product is added to a M:M relation
file that is related to both the customer and the product. I had had
this same problem and couldn't figure out how to do this and it wasn't
really a bit deal to me. But after I saw this post I decided to dig
around a bit and here is what I came up with. It works without any
apparent problems:
AddCustomerProduct ROUTINE
Data
I Byte
R Byte
Code
Clear(PPR:Record)
Clear(PPR:Comment)
Clear(PPR:LicenceText)
PPR:CustomerID = PEO:SystemID
PPR:ProductID = PRO:ProductID
PPR:PurchaseDate = Today()
PPR:PurchasePrice = PRO:Price
If Not Access:PProducts.Insert()
I = InsertRecord
R = RequestCompleted
BRW10.ResetFromAsk(I,R)
ThisWindow.Reset(1)
End
The trick was the call to ResetFromAsk using the InsertRecord and
RequestCompleted and then reset the window. That was it! You MUST
pass I and R as BYTE variables as ResetFromAsk is prototyped as (*Byte
Request, *Byte Response)
Best regards,
Arnór Baldvinsson
Icetips Software
San Antonio, Texas, USA
www.icetips.com
ar...@icetips.com
ICQ: 113314380
Subscribe to information from Icetips.com:
http://www.icetips.com/getnotificationinfo.htm