Beta 1.6.5.1: ListView enhanced features....


Author
Message
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
Hi Trent,

First, thanks for all the enhancements done to the ListView, very impressive Smile

I setup a form to test the ListView and found the following issues:

  • Moving the record pointer in the ToolStrip button does not update/refresh the ListView.
  • Creating a new record or modifying an existing one does not Refresh the ListView with the updated data.

I tested the functionality of the Add/Delete/Edit Objects and they all worked as expected. 

One question, when using the ListView with a child BO, I may need to have buttons for Save/Undo if not using a childform object, would you consider adding a SaveObject/UndoObject as well for this case?

Please take a loot at the video in this link:  http://www.progytech.com/videos/Beta_ListView\Beta_ListView.html

Edhy Rijo

Replies
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Point taken, then where to put the save code then?  In the ChildForm I am making a reference to the ParentBO PK field value which will be -1 if not saved and brake the code.  Any suggestion?

This is the whole point of a parent relationship.  You SHOULD be able to create a child record on a parent that doesn't yet have a PK yet.  SF will automatically persist the parent's PK to the child once the parent gets a PK.  So you should be saving these records at the same time.  It isn't fair to require the end-user to save a parent record before a child gets created.  All of this should be able to be done at the same time.

In one maintenance form that I recently finished, I have 11 child and grandchild records that could be created on a new record without ever first requiring a parent record to first be saved.  So that is the first thing I would rework versus forcing the save of the parent.

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
Trent L. Taylor (05/21/2008)
In one maintenance form that I recently finished, I have 11 child and grandchild records that could be created on a new record without ever first requiring a parent record to first be saved.  So that is the first thing I would rework versus forcing the save of the parent.
  • So basically all child BO should be Saved when clicking the Save button in the Parent Form? 
  • I guess that if I select Undo from the toolbar that all child data will be undoed?

Guess I am still thinking as a VFP developer BigGrin

Edhy Rijo

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
So basically all child BO should be Saved when clicking the Save button in the Parent Form?

Yes.  All Save and Undo logic should occur from a single point (not the child form Smile ) but the most common place would be the Parent form or container.

I guess that if I select Undo from the toolbar that all child data will be undoed?

Yup...you got it Smile

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
Hi Trent,

After your post, I when to check the SF Samples and after reviewing the ChildDialogFormSample.sln I think I now have a better understanding of this concept of drilling down child forms and having control of all the savings from a single point. 

I must admit that it still scares me a bit Cool drilling down several child forms without saving and potentially undo some data that the end user may not wanted to undo, but I guess is just a matter of understanding the design purpose of the ChildFormDialog control.

I'll keep you posted Hehe

Edhy Rijo

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Really, we didn't even do that in VFP (bad word, I know BigGrin).  We used table buffering and didn't commit the changes until down stream.  Granted, it was nowhere as clean as using the BOs and disconnected data, but the concept was really the same.
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
Trent,

Refactoring my child forms, i have a situation with my current code in the ChildForm Save button:

Private Sub cmdSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSave.Click

     '-- Use the form' Save method to force the Broken Rules to be check and show the Broken Rule InfoBox if needed.

     If Me.Save() <> MicroFour.StrataFrame.Data.SaveUndoResult.Success Then

          Exit Sub

     ElseIf Me.Save() = MicroFour.StrataFrame.Data.SaveUndoResult.Success Then

          Me.DialogResult = Windows.Forms.DialogResult.OK

     Else

          Me.PolicyBO1.Undo(MicroFour.StrataFrame.Business.BusinessUndoType.CurrentRowOnly)

          Me.DialogResult = Windows.Forms.DialogResult.Cancel

     End If

End Sub

As you can see, I am using the Form's Save() to force the Broken Rules check and show the InfoBox.  But intent to refactor it to simply check for broken rules and return a DialogResult.OK as it should be.

In the CustomerNodeEditor form this code is being used for the same reason:

Private Sub cmdSave_Click(ByVal sender As Object, ByVal e As EventArgs) Handles cmdSave.Click

     '-- Check the rules on the business object. We are not going to save

     '-- until we get all the way back to the parent form. A save could

     '-- be executed here if necessary, however, since this is a child

     '-- form, the parent form usually controls the saves. The true

     '-- will show the InfoBox error window if the rules are broken.

     If CustomerNotes.CheckRulesOnRow(True) Then

          Me.DialogResult = System.Windows.Forms.DialogResult.OK

     End If

End Sub

The CheckRulesOnRow(True) is not working in a sense that is not showing the required fields nor showing the InfoBox to inform the user that there is a problem with that record, but it is not entering the IF condition which mean that it is partially working.

How can I deal with this situation since in all my ChildForms I need to check for broken rules defined in the BO class?

Edhy Rijo

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Just call the CheckRules method, not the CheckRulesOnRow.  For example:

If MyBo.CheckRules(True) Then
    DialogResult = OK
End If

All of the error providers will then work, however, the InfoBox will not appear and this is by design.  That logic is placed in the Save() of the BaseForm and creates a collection list...however, you can add this yourself very easily in your BaseBO.  Just handle the BusinessRulesChecked event of the BaseBO, and you will probably want to have a property that determines if the InfoBox will be shown when there are broken rules (this too would be on your BaseBo).  The only other property that you may consider adding or testing for is the parent form (or which ever form you may want the InfoBox to show within).  But you would then call the InfoBox like this:

If e.CountOfBrokenRulesAdditionalRows > 0 Then
    InfoBox.ErrorBox(...)
Else
    InfoBox.ErrorBox(...)
End If

You can look at the BaseForm in the Business assembly of the source to see what we do in that dialog.

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
Hi Trent,

In the latest update 1.6.6 a new event BeforeChildFormExecuted was added to the ListView control.  I noticed that in the ListViewBeforeChildExecuteEventArgs there is no Cancel property to cancel any action handled by the ListView control.

Would it be necessary to add the e.Cancel property, or is there any other way to abort any of the 3 actions allow in the ListView (Add/Edit/Delete)?



Edhy Rijo

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Oh, I suppose we could add a cancel parm.  It was created so that there could be a centralized localization for pre-child form initialization code.  Technically the action is already in progress (Delete would actually never hit this event).  So either an Add or Edit will already be in progress.  Adding a cancel shouldn't be too big of a deal, so I will add this to the list.
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
Hi Trent,

Trent L. Taylor (06/24/2008)
Oh, I suppose we could add a cancel parm.  It was created so that there could be a centralized localization for pre-child form initialization code.  Technically the action is already in progress (Delete would actually never hit this event).  So either an Add or Edit will already be in progress.  Adding a cancel shouldn't be too big of a deal, so I will add this to the list.

I really have the need to be able to cancel out showing the childform dialog from the listview BeforeChildFormExecuted, I have not find a way to do this in a form without having to have all the listview code in the form to manage it. 

Have you consider adding an e.Cancel parameter?



Edhy Rijo

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Done, it will be in the next update.  We will post a 1.6.7 beta build in the next week or two, but this will be included.  Here is the update:

The ListView BeforeChildFormExecuted event now has a CancelAction parm on the event argument which allows several options.  None, which would continue as normal, cancel the ChildFormDialog execution only, or cancel the dialog execution and undo any data changes related to the currently executed action (i.e. if adding a new record the new record would not be added).  This gives the best of all worlds in regards to the potential needs to cancelling an automated ChildFormDialog execution.

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
Excellent!  this much more than what I asked.

Thanks Tongue

Edhy Rijo

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Edhy Rijo - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Edhy Rijo - 17 Years Ago
Edhy Rijo - 17 Years Ago
                         You probably have a filter applied or something along those lines. Or,...
Trent L. Taylor - 17 Years Ago
                             Trent, The problem was that I was not filling the Child BO and was...
Edhy Rijo - 17 Years Ago
                                 Based on my SF/.NET experience thus far...

[quote]When...
Greg McGuffey - 17 Years Ago
                                     [quote][b]Greg McGuffey (04/25/2008)[/b][hr]Hope that gets you...
Edhy Rijo - 17 Years Ago
                                         Trent, When the ListView shows the ChilForm Dim args As New...
Edhy Rijo - 17 Years Ago
                                             [quote] the form is shown as modal as it should, but it is outside the...
Trent L. Taylor - 17 Years Ago
                                                 [quote][b]Trent L. Taylor (04/27/2008)[/b][hr][quote]Initially we...
Edhy Rijo - 17 Years Ago
                                                     Hi Trent, Following my working with the ListView, I noticed that when...
Edhy Rijo - 17 Years Ago
                                                         Generally I do not allow access to the Toolstrip item if there is not...
Trent L. Taylor - 17 Years Ago
                                                             [quote][b]Trent L. Taylor (04/29/2008)[/b][hr]It is possible to add...
Edhy Rijo - 17 Years Ago
                                                                 Edhy,

You need to call the UpdateObjectStates() method...
Greg McGuffey - 17 Years Ago
                                                                     Oops, I've been sick and didn't read your post carefully enough. I...
Greg McGuffey - 17 Years Ago
                                                                         [quote][b]Greg McGuffey (04/29/2008)[/b][hr]The basic concept still...
Edhy Rijo - 17 Years Ago
                                                                         Greg is still right....there is no reason to even allow the ListView...
Trent L. Taylor - 17 Years Ago
                                                                             [quote][b]Trent L. Taylor (04/29/2008)[/b][hr]Greg is still...
Edhy Rijo - 17 Years Ago
                                                                                 Try this assembly. It also includes the changes I made to the...
Trent L. Taylor - 17 Years Ago
                                                                                     Edhy, This won't work until I make some other changes....this is why...
Trent L. Taylor - 17 Years Ago
                                                                                     [quote][b]Trent L. Taylor (04/30/2008)[/b][hr]Try this assembly. It...
Edhy Rijo - 17 Years Ago
                                                                                         Actually, I just tested it and it DOES fix the problem. Your program...
Trent L. Taylor - 17 Years Ago
                                                                                             [quote][b]Trent L. Taylor (04/30/2008)[/b][hr]Actually, I just tested...
Edhy Rijo - 17 Years Ago
                                                                                                 Sure, I just changed the UpdateObjectStates method to this:...
Trent L. Taylor - 17 Years Ago
                                                                                                     Thanks Trent.
Edhy Rijo - 17 Years Ago
                                                                                                         Trent, The DeleteChildRecord() method of the ListView is marking the...
Edhy Rijo - 17 Years Ago
                                                                                                             Your error has less to do with the delete than it does binding it...
Trent L. Taylor - 17 Years Ago
                                                                                                                 I did the test as follow and it worked just fine, of coursepassing the...
Edhy Rijo - 17 Years Ago
                                                                                                                     Edhy, Let me just point out something when we address a problem...we...
Trent L. Taylor - 17 Years Ago
                                                                                                                         Trent, [quote]Just because you get an error to go away doesn't mean...
Edhy Rijo - 17 Years Ago
                                                                                                                             Hi Trent, I have another situation with the ListView, I guess :D I...
Edhy Rijo - 17 Years Ago
                                                                                                                                 That cancel flag doesn't logically tie into the BOs BeforeAddNew...so...
Trent L. Taylor - 17 Years Ago
                                                                                                                                     [quote][b]Trent L. Taylor (05/21/2008)[/b][hr]...and FYI...saving...
Edhy Rijo - 17 Years Ago
                                                                                                                                         [quote]Point taken, then where to put the save code then? In the...
Trent L. Taylor - 17 Years Ago
                                                                                                                                             [quote][b]Trent L. Taylor (05/21/2008)[/b][hr]In one maintenance form...
Edhy Rijo - 17 Years Ago
                                                                                                                                                 [quote]So basically all child BO should be Saved when clicking the...
Trent L. Taylor - 17 Years Ago
                                                                                                                                                     Hi Trent, After your post, I when to check the SF Samples and after...
Edhy Rijo - 17 Years Ago
                                                                                                                                                         Really, we didn't even do that in VFP (bad word, I know :D). We used...
Trent L. Taylor - 17 Years Ago
                                                                                                                                                             Trent, Refactoring my child forms,i have a situation with my current...
Edhy Rijo - 17 Years Ago
                                                                                                                                                                 Just call the CheckRules method, not the CheckRulesOnRow. For example:...
Trent L. Taylor - 17 Years Ago
                                                                                                                                                                     Hi Trent, In the latest update 1.6.6 a new event...
Edhy Rijo - 17 Years Ago
                                                                                                                                                                         Oh, I suppose we could add a cancel parm. It was created so that there...
Trent L. Taylor - 17 Years Ago
                                                                                                                                                                             Hi Trent, [quote][b]Trent L. Taylor (06/24/2008)[/b][hr]Oh, I suppose...
Edhy Rijo - 17 Years Ago
                                                                                                                                                                                 Done, it will be in the next update. We will post a 1.6.7 beta build...
Trent L. Taylor - 17 Years Ago
                                                                                                                                                                                     Excellent! this much more than what I asked. Thanks :P
Edhy Rijo - 17 Years Ago
                                         [quote]Thanks Greg, much appreciated.:)[/quote]
Any time!
Greg McGuffey - 17 Years Ago
Guillermo Vilas - 17 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search