Beta 1.6.5.1: ListView enhanced features....
 
Home My Account Forum Try It! Buy It!
About Contact Us Site Map
StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      


«««12345»»»

Beta 1.6.5.1: ListView enhanced features....Expand / Collapse
Author
Message
Posted 04/29/2008 2:00:17 PM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: Yesterday @ 10:32:31 PM
Posts: 402, Visits: 1,633
Trent L. Taylor (04/29/2008)
Greg is still right....there is no reason to even allow the ListView to Requery itself if there is no parent record.  More than likely you already have something in the Navigated event of the parent BO that calls a Refresh on the child list...if there are no parent records, the you can just clear the list and ensure that your form method is called:

Trent, if you look at my previous message, you will notice that I am only calling the ListView.Refresh() method in the ParentBO.Navigated() event.  The ListView is being populated by MicroFour.StrataFrame.Business.BusinessCloneDataType.ClearAndFillFromDefaultView, see the code below.

Private Sub lvPolicy_ListPopulating(ByVal e As MicroFour.StrataFrame.UI.ListPopulatingEventArgs) Handles lvPolicy.ListPopulating

     '-- Use the already populated business object on the form to load the list.

     e.Parameters(0).Value = Me.Child_PolicyBO1

     '-- Tell the business object that will be used in the listview (creates a new instance)

     '-- to clear itself and load from the forms default view on the Customers business object.

     e.Parameters(1).Value = MicroFour.StrataFrame.Business.BusinessCloneDataType.ClearAndFillFromDefaultView

End Sub

This is a bit frustrating   As you can see, I am not calling the ListView.Refresh() in any other place other than the ParentBO.Navigated() event and I still believe that the problem is in the ListView code which will be called after all other events has occurred and it is setting the Add button Enabled=True.

I hope you can see this and if possible test it.

Edhy Rijo
Progytech (Computer Consultants)
Post #15993
Posted 04/30/2008 9:57:14 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 9:47:36 PM
Posts: 4,115, Visits: 4,185
Try this assembly.  It also includes the changes I made to the DateTimePicker.  I will do another build later today and post it on the forum for the 1.6.6 beta that will include both of these changes.

  Post Attachments 
MicroFourStrataFrameUI.zip (4 views, 743.55 KB)
Post #16017
Posted 04/30/2008 10:07:00 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 9:47:36 PM
Posts: 4,115, Visits: 4,185
Edhy,

This won't work until I make some other changes....this is why I was reluctant to mess with it.  Also, in order for this to work, you will have to define the parent relationship and set the ParentBusinessObject properties...but at this point it still won't work.  I will have to add handlers to the parent BO events.

Post #16021
Posted 04/30/2008 10:08:43 AM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: Yesterday @ 10:32:31 PM
Posts: 402, Visits: 1,633
Trent L. Taylor (04/30/2008)
Try this assembly.  It also includes the changes I made to the DateTimePicker.  I will do another build later today and post it on the forum for the 1.6.6 beta that will include both of these changes.

Hi Trent,

Sorry, but this assembly did not fix the problem with the ListView Add button.  It did fix the DateTimePicker problem.

Edhy Rijo
Progytech (Computer Consultants)
Post #16022
Posted 04/30/2008 10:23:10 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 9:47:36 PM
Posts: 4,115, Visits: 4,185
Actually, I just tested it and it DOES fix the problem.  Your program is not setup right.  You need to create a ParentRelationship on the OrdersBO that is CustomersBO.  Then on the form (after you recompile) set the ParentBusinessObject to the CustomersBO1 on the form....then the final, most important step, and this could be why you have had other issues, set the BusinessObject property on the ListView to the OrdersBO1 on the form.  If you do all of this, as it was intended to work, it will work like you want it to.
Post #16026
Posted 04/30/2008 10:40:45 AM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: Yesterday @ 10:32:31 PM
Posts: 402, Visits: 1,633
Trent L. Taylor (04/30/2008)
Actually, I just tested it and it DOES fix the problem.

Hi again,

Yes IT DOES WORK, sorry but my quick sample project was too quick and not setup properly, but after testin in my actual project it did work and then after adding all the missing setp in the quick project it also worked.

If you don't mind, could you tell me what was changed in the source code?

Edhy Rijo
Progytech (Computer Consultants)
Post #16030
Posted 04/30/2008 10:50:24 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 9:47:36 PM
Posts: 4,115, Visits: 4,185
Sure, I just changed the UpdateObjectStates method to this:

''' <summary>
''' Updates the objects states based on the selected state of the list items and security
''' </summary>
''' <remarks></remarks>
Private Sub UpdateObjectStates()
    '-- Establish Locals
    Dim isSelected As Boolean = Me.SelectedItems.Count > 0
    Dim isAddAllowed As Boolean = HasPermission(_AddObjectSecurityKey)
    '-- Determine if additional logic should be performed to determine the add status
    If (_BusinessObject IsNot Nothing) AndAlso _
       (_BusinessObject.ParentBusinessObject IsNot Nothing) AndAlso _
       isAddAllowed Then
        isAddAllowed = _BusinessObject.ParentBusinessObject.Count > 0
    End If
    If _AddObject IsNot Nothing Then SetObjectEnabledState(_AddObject, isAddAllowed)
    If _EditObject IsNot Nothing Then SetObjectEnabledState(_EditObject, isSelected AndAlso HasPermission(_EditObjectSecurityKey))
    If _DeleteObject IsNot Nothing Then SetObjectEnabledState(_DeleteObject, isSelected AndAlso HasPermission(_DeleteObjectSecurityKey))
End Sub
Post #16031
Posted 04/30/2008 11:05:00 AM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: Yesterday @ 10:32:31 PM
Posts: 402, Visits: 1,633
Thanks Trent.

Edhy Rijo
Progytech (Computer Consultants)
Post #16032