StrataFrame Forum

My BO don't move when I use the BrowseDialog and OLEDB VFP Table

http://forum.strataframe.net/Topic19855.aspx

By Elio Reyes - 10/2/2008

Hi



When the Browse Dialog is working, I can search, sort results... Everything is Ok, but When I use SF Browse Info Panel or try to get the result pointer from the search... The BO is steel in the first record.



Thanks SF
By Edhy Rijo - 10/2/2008

Hi Pedro,

You have to add code to the InfoPanel.RowChanged event to update the data in the info panel. 

Here a sample:

Private Sub CustomersBrowseInfoPanel_RowChanged(ByVal e As MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialogRowChangedEventArgs) Handles MyBase.RowChanged

     '-- Strong-type the business object

     With CType(e.BusinessObject, bizCustomers)

          '-- Set the Customer detailed info.

          Me.lblCompanyName.Text = .CompanyName

          Me.lblStreet.Text = .Street

          Me.lblCityStateZip.Text = String.Format("{0}, {1} {2}", .City, .State, .ZipCode)

          Me.lblContactName.Text = .ContactName

          Me.lblBusinessPhone.Text = .Phone

          Me.lblFax.Text = .Fax

          Me.lblMobilPhone.Text = .Mobil

          Me.lnkeMailAddress.Text = .eMail

     End With

End Sub

By Elio Reyes - 10/3/2008

Yes. I do that but always show me the first record.


By Trent L. Taylor - 10/5/2008

Pedro,

I would ask you to double check your work as I know that this works as Edhy has described.  This is a heavily leveraged part of a BD and something that we use everyday and I am confident that there is not an issue here.

By Elio Reyes - 10/6/2008

Hi



I'm so sorry to make lose your time, but is happening to me.



Maybe I have to put a index key or else to my Free Table. Because the Browse Dialog is working very good is just the move of the BO And work excellent in all my SQL Tables, is Just in this case with a Free Visual Foxpro Table.









Thanks SF



By Edhy Rijo - 10/6/2008

Hi Pedro,

Did you try to debug your code?  Also post your code so we can see it.

Also in the Panel, make sure you have an instance of the BO used in the Browser Dialog.

By Elio Reyes - 10/6/2008

Here's the code ...



Thanks a lot
By Edhy Rijo - 10/6/2008

Hi Pedro,

More info is needed to check on this sample:

  • The VFPOLEDB driver you are using.
  • The EXPENDIO.DBC
  • Which is the form that is not working?
By Edhy Rijo - 10/6/2008

Pedro, I think I know what your problem is.

In the Panel_Consulta_Cigarros, you have to drop an instance of the BO you want to use, then in the 2 textboxes you have to bind them to the BO instance.

When you assign the Panel_Consulta_Cigarros to the Browser Dialog, this will translate the BD BO to the instance of the Panel_Consulta_Cigarros BO, this is pretty much like what is done with the ChildForm dialog BO translations.

By Larry Caylor - 1/28/2010

Just though I'd add this post in case someone runs into this problem and they were handling the RowChanged event. In my case I was handling the event but each time it was raised the BO's current row index pointed to the first record no matter which record was selected from the search results. In my case I was populating the BO from a view and it turned out that I had forgot to define a primary key in BO mapper. Once I defined a key, everything worked as it shoud. Dumb mistake but sometimes those are the most difficult to findWink
By Trent L. Taylor - 1/28/2010

Thanks for sharing, Larry! Smile