Nested Combo Boxes


Author
Message
Felix M Avendano
Felix M Avendano
StrataFrame Novice (88 reputation)StrataFrame Novice (88 reputation)StrataFrame Novice (88 reputation)StrataFrame Novice (88 reputation)StrataFrame Novice (88 reputation)StrataFrame Novice (88 reputation)StrataFrame Novice (88 reputation)StrataFrame Novice (88 reputation)StrataFrame Novice (88 reputation)
Group: Forum Members
Posts: 48, Visits: 1.5K
I've put in a form 3 BO's, the firs one is the grand child and the one who appneds the data to the table, ther second is a FK of this one and the third is a FK of the second one.

I've put two CB, the first is the grand parent FK, this CB has to pass a value to the other CB filtering this one's data and showing only data filtered by the other  CB.

For example I select a Customer Grand Parent CB, then an order (parent CB) and I fill in a form the data of one (and only one) item.

I tried a lot of examples I saw at the forum but with no success. My question is, I now how to do it manually, but I think there must be a more powerfull way via the framework.

I've bounded my first CB to a BO using the populationdatasourcesettings. This one works fine.

Then Ive bounded the second one using the method copydatafrom.

Ive put this code in the ListPopulating method

    Private Sub cboEstablecimientos_ListPopulating(ByVal e As MicroFour.StrataFrame.UI.ListPopulatingEventArgs) Handles cboEstablecimientos.ListPopulating

        e.Parameters(0).Value = Me.BoEmpresa1
        e.Parameters(1).Value = MicroFour.StrataFrame.Business.BusinessCloneDataType.ClearAndFillFromDefaultView
    End Sub


    Private Sub BoEmpresa1_Navigated(ByVal e As MicroFour.StrataFrame.Business.NavigatedEventArgs) Handles BoEmpresa1.Navigated
        Me.cboEstablecimientos.Requery()

    End Sub

But when I debug it it never reaches this code.

I must have some wrong parameter but I don't know which is.

Help please!!!

Replies
Felix M Avendano
Felix M Avendano
StrataFrame Novice (88 reputation)StrataFrame Novice (88 reputation)StrataFrame Novice (88 reputation)StrataFrame Novice (88 reputation)StrataFrame Novice (88 reputation)StrataFrame Novice (88 reputation)StrataFrame Novice (88 reputation)StrataFrame Novice (88 reputation)StrataFrame Novice (88 reputation)
Group: Forum Members
Posts: 48, Visits: 1.5K
Solved!!!BigGrin

The question was that I was using the wrong instatiated BO, Y had to use the one Im filling with data, in this case is Potreros, and not the one I'm using to retrieve data, the parent one Empresa.

Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Glad you got it. Smile



Combobox and ListView can be populated in several ways I use this rule:

1.- If I only need the FK lookup value, then I don't add any BO to the form to populate the combo/listview, I will call the method in the Type BO instead.

2.- If I need to reference any other fields of the lookup data then I add a BO for the lookup and then use the BO.CopyFrom(....) method to populate that BO in the form from the lookup data.



Keep in mind that Combobox and ListView uses an "Internal" BO to show its data, we don't have easy access to that BO, but 99% of the time we don't need it, the BO.CopyDataFrom() will do just fine in these cases.



BTW, based on your BO names "Potreros, Establecimientos, Empresa, etc." what kind of application are you building? Are you building it in English/Español or both?

Edhy Rijo

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