Browse Dialog Question


Author
Message
Paul Chase
Paul Chase
Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)
Group: Forum Members
Posts: 414, Visits: 2.8K
I am using the following code to populate a browse dialog of possible zip code for a city. The problem I am having is that the record pointer does not seem to move to the selected city/zip combination after the browse intead it is sitting on the first record of the browse resultd for that city. I would think the record pointer of the BO would be set on the record selected from the browse results dialog instead of the first record of the result set. any ideas on whats going on

''' <summary>

''' Populates a Browse Dialog of Possible ZipCodes For a City

''' </summary>

''' <param name="sender"></param>

''' <param name="e"></param>

''' <remarks></remarks>

Private Sub ShowZipCodes(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtjscity.KeyDown

If e.KeyCode = Keys.Enter Then

Me.ZipCodeDialog.SearchFields.Item(0).InitialValue = Me.txtjscity.Text.Trim

If Me.ZipCodeDialog.ShowDialog(True) = Windows.Forms.DialogResult.OK Then

Me.txtjscity.Text = Me.ZipCodesBO1.CITY

Me.txtjsstate.Text = Me.ZipCodesBO1.STATE

Me.txtjszip.Text = Me.ZipCodesBO1.ZIP

Else

'Nothing was Selected-- ///*TODO-- Do we want to do anything here?

End If

End If

End Sub

 

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Are you saying the when you click the OK button in the browse, the BO set on to the BusinessObjectToPopulate property on the BrowseDialog is pointing to a record other than what was selected in the results list in the browse?  I have never seen this or even heard of it??? Ermm When you click the OK button in the BrowseDialog, it will populate and set the CurrentRowIndex of the business object set in the BusinessObjectToPopulate property to the RowIndex that was selected in the Results list in the browse.

If you are wanting some type of incremental search or to dynamically select the results index within the BrowseDialog itself, this functionality does not exist at the moment.

Paul Chase
Paul Chase
Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)
Group: Forum Members
Posts: 414, Visits: 2.8K
Trent,

That is what I am saying when I select a record by hitting the ok button the Bussiness object that is set as the BO to Populate always returns index 0 or the first record. I know that it should return the selected row but for whatever reason it is always returning row 0. So somewhere I have something screwy and was hoping you might have an idea of where I could look.

Paul Chase
Paul Chase
Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)
Group: Forum Members
Posts: 414, Visits: 2.8K
I just added to same logic to another form and it does work as expected. I must have something screwed up on the first form.
Paul Chase
Paul Chase
Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)
Group: Forum Members
Posts: 414, Visits: 2.8K
I don't know what the problem was I looked to everything a few times but deleting the Browse Dialog and re-adding and reconfiguring did the trick. Not sure what the issue was but that fixed it
StrataFrame Team
S
StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Configuring the browse dialog generates quite a bit of code within the designer file.  Sometimes, if you rename a business object, or rename the business object class, you have to go back to the browse dialog and reset a few properties to get them to work properly... you never know.
Paul Chase
Paul Chase
Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)
Group: Forum Members
Posts: 414, Visits: 2.8K
That may be what happened. I did some renaming awile back and just may not have noticed that this was not behaving properly.

I am trying to get ready for a demo this friday and am flushing out all the little problems that I probably didn't notice before. So it makes sense that some things that may have worked before could be broken because I renamed something and did not get a compiler error so never thought to look at it.

Well I have the rest of the week to find any more of these BigGrin 

Govinda Berrio
Govinda Berrio
StrataFrame User (240 reputation)StrataFrame User (240 reputation)StrataFrame User (240 reputation)StrataFrame User (240 reputation)StrataFrame User (240 reputation)StrataFrame User (240 reputation)StrataFrame User (240 reputation)StrataFrame User (240 reputation)StrataFrame User (240 reputation)
Group: StrataFrame Users
Posts: 94, Visits: 481
I ran into this problem today. I created a Browse Dialog and it would return search results just fine. But when I selected an item from the middle of the results, the records that was returned to the parent form was always the first item in the search results. I was banging my head stepping through the SF source until I realized (by seeing that SelectedPrimaryKey property was empty) that the Browse Dialog probably needs to know what the what the primary key column is. And, if you are using a view to populate the business object, which I am, that you need to explicitly define it in the BO Mapper ("Override Primary Key Specification"). 

So anyone running into this problem in the future, check the the BO Mapper, you may have neglected to set the primary key so that the Browse Dialog know how to Seek to the selected row internally. 
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search