Prev: UAC in Windows 7 and VO
Next: Loading 16bit library
From: BillT on 18 Jun 2010 23:10 Hello again, Another biggie problem for this bBrowser newbie!! I am not sure whether I have a problem with VO2.8 or a bBrowser or a VO SQL Server (I am relatively inexperienced with all in VO). In VO2.5 with a VO Browser and a VO SQL Server, I could doubleclick on a browser row in a SubDataWindow and popup an editing window for the record on which I doubleclicked, and subsequently return to the original browser row. All used the same SQLserver I am now trying to do the same sort of thing with VO2.8, bB3. However, it seems that the record number in the server and the record number in bB3 are not the same even though I initialised with the same server instance? I feel that I may be missing some fundamental understanding of bB3??? i.e. is it still possible to have one server instance applying to all 3 components (the main window, the bBrowser and the popup child)? As I have written it, I find that the bBrowser often returns to its first row after I close the popup, and this despite having declared "#RetainCurrentRow" in the Refresh(). From that brief description, can anybody please help me? Thanks, Bill
From: Kevin on 19 Jun 2010 03:20 Bill, When you refresh bBrowser with a SQLServer it will return to the first row because the underlying server has in effect being read. Well that is my understanding. If you have an unique column, for example Product number, you can use that as a reference. In my tables I have one column which is auto-generated ensuring it is unique. Double-clicking a cell then passes this unique to the Edit window which uses it to open the SQL Table for that row. Before refreshing the bBrowser I store the record number, or ID, suspend updates on the server, go to the stored record number and then reset the notifications and refresh the browser. Hope this helps. Kevin "BillT" <wtillick(a)hotmail.com> wrote in message news:d88f7fc9-1986-4b52-b701-bb7814a6920f(a)34g2000prs.googlegroups.com: > Hello again, > Another biggie problem for this bBrowser newbie!! > > I am not sure whether I have a problem with VO2.8 or a bBrowser or a > VO SQL Server (I am relatively inexperienced with all in VO). > > In VO2.5 with a VO Browser and a VO SQL Server, I could doubleclick on > a browser row in a SubDataWindow and popup an editing window for the > record on which I doubleclicked, and subsequently return to the > original browser row. All used the same SQLserver > > I am now trying to do the same sort of thing with VO2.8, bB3. However, > it seems that the record number in the server and the record number in > bB3 are not the same even though I initialised with the same server > instance? > I feel that I may be missing some fundamental understanding of bB3??? > i.e. is it still possible to have one server instance applying to all > 3 components (the main window, the bBrowser and the popup child)? > > As I have written it, I find that the bBrowser often returns to its > first row after I close the popup, and this despite having declared > "#RetainCurrentRow" in the Refresh(). > > From that brief description, can anybody please help me? > > Thanks, > Bill
From: BillT on 19 Jun 2010 05:33 Hi Kevin, I do have an auto-generating column. But how do I use this number to open the row/record in the edit window? Can you please clarify. And do you refresh the bBrowser in the Close of the edit window or in method of the owner window such as Activate or Expose? Thanks, Bill
From: Geoff Schaller on 19 Jun 2010 05:52 Bill. 'retain current row' means nothing for SQL. This is something you have to maintain yourself. All my SQL tables have a RECID columns (effectively Recno) which is an identity column. The row number in the browser is the record number position in the recordset and for every SELECT you are not guaranteed to get the rows back in the same order. And as Kevin indicated, calling a refresh on the browser/server is going to land you back at record No. 1 in the recordset. I have my own code to manage this. Geoff "BillT" <wtillick(a)hotmail.com> wrote in message news:d88f7fc9-1986-4b52-b701-bb7814a6920f(a)34g2000prs.googlegroups.com: > Hello again, > Another biggie problem for this bBrowser newbie!! > > I am not sure whether I have a problem with VO2.8 or a bBrowser or a > VO SQL Server (I am relatively inexperienced with all in VO). > > In VO2.5 with a VO Browser and a VO SQL Server, I could doubleclick on > a browser row in a SubDataWindow and popup an editing window for the > record on which I doubleclicked, and subsequently return to the > original browser row. All used the same SQLserver > > I am now trying to do the same sort of thing with VO2.8, bB3. However, > it seems that the record number in the server and the record number in > bB3 are not the same even though I initialised with the same server > instance? > I feel that I may be missing some fundamental understanding of bB3??? > i.e. is it still possible to have one server instance applying to all > 3 components (the main window, the bBrowser and the popup child)? > > As I have written it, I find that the bBrowser often returns to its > first row after I close the popup, and this despite having declared > "#RetainCurrentRow" in the Refresh(). > > From that brief description, can anybody please help me? > > Thanks, > Bill
From: Kevin on 19 Jun 2010 05:53 Bill, In the CellDouble click method get the value for the auto-generating column, e.g. iProd = oBrowser:Server:FieldGet( #ProdID ) Then in your Edit window pass the ID either through the PostInit or a specific method and use it to open the SQL Table using an SQL statement like: Select * from Products where ProdID = iProd As you don't say what you using to open the SQL Table, i.e. the VO classes or VO2ADO, it is difficult to be more precise. The above should help. Is your Edit window a DataWindow or a dialog? If it is a dialog then put the browser window in the method that calls the window, after it closes. For a DataWindow you could call the browser Refresh from the Edit window close. What I do is send a message to the Shell of the app which then sends it to all child windows. I would not suggest you put it in the Activate method as this will cause the browser to refresh every time you go to the window even if you switch to it from another app. Sample code is below. Hope this helps. Kevin Put this method on your window with the bBrowser: method ReceiveBroadcastMessage( symMessage, cDescription ) class winFuelSQL // // Receive a broadcast message and action it if needed // Arguments: // symMessage - Message being sent tow windows // cDescription - description of message // do case case symMessage == #Claim_Updated self:oDCbrwFuel:Server:Requery() end case return nil Put this method on your Shell method BroadcastMessage( symMessage, cDescription ) class StandardShellWindow // // Broadcast a message to child windows // Arguments: // symMessage - Message being broadcast // cDescription - Description of message being Broadcast local aChildren as array local dwChildren as dword local dwCur as dword local oWin as Window // Get children aChildren := self:GetAllChildren() dwChildren := ALen(aChildren) // Loop through for dwCur := 1 upto dwChildren // Get window oWin := aChildren[ dwCur ] if IsMethod( oWin, #ReceiveBroadcastMessage ) Send( oWin, #ReceiveBroadcastMessage, symMessage, cDescription ) endif next return nil "BillT" <wtillick(a)hotmail.com> wrote in message news:61b01f11-d3f8-4798-bc76-d5490ddd8c53(a)o28g2000prh.googlegroups.com: > Hi Kevin, > I do have an auto-generating column. But how do I use this number to > open the row/record in the edit window? Can you please clarify. > > And do you refresh the bBrowser in the Close of the edit window or in > method of the owner window such as Activate or Expose? > > Thanks, > Bill
|
Pages: 1 Prev: UAC in Windows 7 and VO Next: Loading 16bit library |