Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Stuck without Navigation
Message
From
10/03/2005 15:12:55
 
 
To
All
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Stuck without Navigation
Environment versions
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
00994596
Message ID:
00994596
Views:
48
1. When my form loads the following successfully gets called:
    ' Parent Retrieved hook method
    Protected Overrides Sub HookParentRetrieved _
    (ByVal bizObj As mmBusinessObject, ByVal e As mmBusinessStateChangeEventArgs)
        Me.GetCompanyByCompanyId(e.PrimaryKeyValue)
    End Sub
2. The form has the CompanyList Business Object defined as the Parent of the Company Business Object as follows:
    Public Sub New()
        MyBase.New()

        'Instantiate and register business objects with the form
        Me.oCompanyList = _
            CType(Me.RegisterPrimaryBizObj(New CompanyList), CompanyList)
        Me.oCompany = CType(Me.RegisterBizObj(New Company), Company)
        Me.oLogoShape = CType(Me.RegisterBizObj(New LogoShape), LogoShape)
        ' Me.oPrintLogoOrName = _
        ' CType(Me.RegisterBizObj(New PrintLogoOrName), PrintLogoOrName)()

        ' Register the Company object as a child of the Company List object
        Me.oCompanyList.RegisterChildBizObj(Me.oCompany)

        ' Instantiate and register business rule objects with the form
        Me.oCompanyRules = _
            CType(Me.oCompany.GetBusinessRuleObject(), CompanyRules)

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        ' Retrieve all Business Object data
        Me.oCompanyList.GetCompanyList()
3. After I select a value in an UltraComboBox I expect to raise a BusinessStateChangeEvent that will call the following (in my Company Bus Obj):
(Note UltraComboBox settings: BindSource = CompanyList, BindDisplayMember = CompanyName, BindDisplayValue = CompanyId, BindValueSource = CompanyList, BindValueSourceMember = CompanyId)
    ' Parent Navigated hook method
    Protected Overrides Sub HookParentNavigated _
    (ByVal bizObj As mmBusinessObject, ByVal e As mmBusinessStateChangeEventArgs)
        Me.GetCompanyByCompanyId(e.PrimaryKeyValue)
    End Sub
WHAT DO I NEED TO DO WITHIN MY ULTRACOMBO_VALUECHANGED event to raise this BusinessStateChangeEvent correctly and cause the Customer Business Object's HookParentNavigate event to fire (thus getting the Company By Id shown above)? I am assuming I have to navigate to the record selected but not sure how to do this in a way that would fire the HookParentNavigate.
    Private Sub CompanySelectionUltraCombo_ValueChanged _
    (ByVal sender As Object, ByVal e As System.EventArgs) _
    Handles CompanySelectionUltraCombo.ValueChanged

        'This did not work: Me.CompanySelectionUltraCombo.NavigateData _
        '    (Me.BindingContext, oCompanyList, mmNavigate.First)
        'This was not good syntax: Me.oCompanyList.StateChangeHandler(oCompanyList, mmBusinessState.Navigated)

    End Sub
4. After I press one of my navigation buttons , I still am not raising the HookParentNavigate event as expected
    Private Sub buttonMoveNext_Click _
        (ByVal sender As System.Object, ByVal e As System.EventArgs) _
        Handles buttonMoveNext.Click

        ' Navigate to next record in dataset
        Me.CompanySelectionUltraCombo.NavigateData _
            (Me.BindingContext, oCompanyList, mmNavigate.Next)

        ' Update form fields with new value selected
        Me.CompanyFormSetFieldValues()

    End Sub
I know the navigation is occuring as I also have an Update Buttons function (as follows) that is correctly determining the current position within the dataset and applying the appropriate GUI changes after I press one of the nav buttons.
    Private Sub UpdateButtons()

        Select Case Me.GetCurrentPosition(oCompanyList)
            Case 0
                Me.buttonMovePrev.Enabled = False
                Me.buttonMoveFirst.Enabled = False
                Me.buttonMoveNext.Enabled = True
                Me.buttonMoveLast.Enabled = True
            Case oCompany.GetRowCount() - 1
                Me.buttonMoveNext.Enabled = False
                Me.buttonMoveLast.Enabled = False
                Me.buttonMovePrev.Enabled = True
                Me.buttonMoveFirst.Enabled = True
            Case Else
                Me.buttonMoveNext.Enabled = True
                Me.buttonMoveLast.Enabled = True
                Me.buttonMovePrev.Enabled = True
                Me.buttonMoveFirst.Enabled = True
        End Select

        Me.CurrentRowUltraTextEditor.Text = _
            CStr(Me.GetCurrentPosition(oCompanyList) + 1)
        Me.NumberOfRecordsUltraLabel.Text = "of " & oCompanyList.GetRowCount()


    End Sub
THANKS
Joe Salvatore, Programmer/Analyst - The Stellar Group
Next
Reply
Map
View

Click here to load this message in the networking platform