Finding The Parent


Author
Message
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
No problem Smile
Geoff Hirst
Geoff Hirst
StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)
Group: Forum Members
Posts: 123, Visits: 3.5K
Trent,

Sorry, missed the shared (most important bit).

best

Geoff.

Geoff Hirst
Geoff Hirst
StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)
Group: Forum Members
Posts: 123, Visits: 3.5K
Hi Trent,

THanks for this.

If you are using the Listview automation, how do you get to be able to access this property? The form is wrapped up in the ChildFormDialog object, which doesn't have any events. The Listview has the BeforeChildFormExecuted, but again I can't find anyway to access the actual form.

thanks in advance

Geoff.

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
I have actually wanted to do this before and I jsut haven't done it....primarily because you can get around it pretty easy.  I just created a shared (static) property that was exposed on the child form which is a reference to the parent form.

Private Shared _MyParentForm As Form
Public Shared Property MyParentForm As Form
    Get
        Return _MyParentForm
    End Get
    Set
        _MyParentForm = value
    End Set
End Property

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.3K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Ah, I see. Because the ListView itself handles opening the ChildFormDialog, you don't have an easy way to requery the list (I think that is what's going on).



I think the first thing I'd try is to just handle an event on the BO, like the AfterSave event. Since you are likely passing this through to the ChildFormDialog, you could just requery whenever the child BO is saved.
Geoff Hirst
Geoff Hirst
StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)
Group: Forum Members
Posts: 123, Visits: 3.5K
Sorry Edhy,

I may not have explained this very well.

What I want to see is that if my user clicks OK/Add, for the listview that is on the parent form 'behind' my childform, updating with the record I just added.

If I can get a reference in the childform of the parentform, I can call a simple listview requery, but I can't seem to do this. If I could pass through parameters, I could just pass thru a reference to the form, that would enable me to do the above.

I have tried to accomplish this using different dialogresults, such as ignore or none. dialogresult.Ignore makes the child form close, which I don't want, and   dialogresult.none doesn't update the listview on the parent.

thanks

Geoff

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 Geoff,

I don't quite understand what is the problem here. I know your OK/Add button will add another record to the childBO and let the childform opened so this new record can be edited, right? if so what is the problem you are facing?

Also it would be helpful if you post the code in your OK/Add button.



About the parameter, I don't thing it is supported, but if you need to access the parent BO, simply add it to the childform and in the parent form's childformdialog add a translation to the parent BO as you did with the child BO.

Edhy Rijo

Geoff Hirst
Geoff Hirst
StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)StrataFrame User (219 reputation)
Group: Forum Members
Posts: 123, Visits: 3.5K
Hi Guys,

I am using the listview, in its full automated glory. What I have is a childform that has 3 buttons on it, that are OK/Add,OK and Cancel. OK and Cancel are easy enough to deal with, but the OK/Add button keeps the child form open so that the user can add another item and for the parent form to update and show the line that was added. The idea is to just reduce mouseclicks.

Now, I had previously done this using the parentform capability, but when using the childformdialog this seems to be empty.

What is best way of finding out the parent form that a childform was launched from is this held anywhere?

Also, how do you pass in parameters to a childform when using the automated listview? I can't see this being done in strataflix, but I might have missed it. Indeed, this could resolve my first problem.

thanks

Geoff.

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