I have two combobox in a Browser Dialog "Customers" and "Building Address". The records in the Building Address should be filtered by the selected Customer.
I have done this for the maintenance form, but I have not find a way to have the combo filtered in the Browser Dialog (BD), and the events exposed to the BD does not allow me setup code to Requery the BuildingAddress BO.
Hi Trent,
Thanks for the response, even thought it is really sad for me. Do I have to enter this in the enhancement request forum, or you will take care of it for me?
I do like the way you guys design the Browser Dialog, but more hooks and flexibility are needed in there in order to allow the developer to cover more custom request by the application. So more events and access to the controls PEMs in the browser will enable this flexibility for us.
I would like to be able to do something like this:
Me
Me.ServiceCallsBO1_BrowseDialog.SearchFields("FK_Customers").Requery()
I though this functionality was added to the framework at some point, if so, how would I get access the value of a search field in the browser dialog?
I think I figured out by using the SearchValueChanged event. Could you please check this out to see if it is correct?
Private Sub ServiceCallsBrowserDialog_SearchValueChanged(ByVal sender As System.Object, ByVal e As MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialogSearchValueChangedEventArgs) Handles MyBase.SearchValueChanged '-- When a customer is selected form the combobox, then requery the Building combobox. If e.SourceSearchField.Key.Equals("FK_Customers", StringComparison.OrdinalIgnoreCase) Then Dim comboListPopulationParam1 As Integer = 0 '-- If the customer combobox has any selected record, then update the ' comboListPopulationParam1 with the Customer PK If CType(e.SourceControl, ComboBox).SelectedIndex > 0 Then '-- Resize the combo to properly show its information. e.AllVisibleSearchControls("FK_Buildings").Width = 300 comboListPopulationParam1 = CType(e.SourceControl, ComboBox).SelectedValue End If '-- Requery the Building Address combobox. CType(e.AllVisibleSearchControls.Item("FK_Buildings"), ComboBox).Requery(comboListPopulationParam1, MicroFour.StrataFrame.Business.BusinessEditingState.Idle) End IfEnd Sub
e.AllVisibleSearchControls(
comboListPopulationParam1 =
Also, the Building Address ("FK_Buildings") field combobox is not sized properly, the field type is an Integer, but the size of the combo is not enough to show the data correctly, so I am using e.AllVisibleSearchControls("FK_Buildings").Width = 300 here to at least re-size the combo when the Customer record has been selected, but that is not the correct way. Is there a way to set the size of any control in the Browser Dialog programmatically?
As for the SearchValueChanged, this is correct and where you will want to place your code...it has actualy been here since 1.6.5 I am pretty sure.
That is a great excuse. Just kidding
I will try to setup a sample test with the SF sample database, there is not rush on this one, so it can wait.
Thanks for the confirmation, I got confused trying to get the values, but it is working beautifully and a very powerful functionality.