ListView PerformEditActionOnDoubleClick not working...


Author
Message
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I recently was working with a parent-child-grandchild situation using listviews and child form dialogs. On the child form dialog for the child, the edit on double click doesn't work with the BO that was translated from the parent....The easiest way to see this error is to just modify the Child Form Dialog sample provided with SF.



1. On the CustomerNotesItems form, simply modify the listview by setting the BO to the CustomerNotes BO on the form.

2. Run it, select a customer, view notes.

3. Double click on a note...boom



Manually calling edit on the CustomerNotes works fine, as is done when clicking the Edit button. Any ideas what's happening?
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
Using the ChildFormDialog sample, here is how to fix the problem:

Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
    MyBase.OnLoad(e)

    lvNotes.BusinessObject = Me.CustomerNotes
End Sub

Notice that in the OnLoad AFTER the base logic has been called, I am resetting the object instance on the list to the one on the form.  Technically this is what you had done within the designer...right?  Well, yes and no.  StrataFrame "translates" the business objects using reflection in the Load.  However, we do not reflect over every object on the form so see if there is another instance of that BO used someplace else.  This could really slow things down.  So by resetting the object instance after the base logic has done its thing, the translated instance will then be used since the form level BO has been translated to use the BO from the calling form.

Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Trent,

I have one ChildForm in which I had to do the same, don't quite remember the reasons now, but does this mean that it should be a common practice when using the ListView with ChildForm features to confirm the ListView?

If so I will add that to my own ChildForm template Wink

Edhy Rijo

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
Not necessarily.  The only time this would happen is on a child form called through a BO translation class (i.e. ChildFormDialog, etc).  If the records are showing up correctly, I would leave this alone. 
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
That makes sense. Thanks Trent!
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