How to limit browse dialog on child dialog form


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

I am confuse here, why would you need (or want) a Browser Dialog in a child form which I believe will only display filtered records by its parent?

Edhy Rijo

Larry Tucker
Larry Tucker
StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)
Group: StrataFrame Users
Posts: 69, Visits: 308
Trent L. Taylor (03/07/2008)
I am not sure exacatly what you are doing, but the BrowseDialog will update the BO that is set in the BusinessObjectToPopulate property of the BrowseDialog, as well as set the current index to the selected record in the results.  So be sure to check that you have the correct instance of the BO being updated...otherwise, nothing will happen Smile

Trent, not sure if you were really asking for "exactly what I'm doing", but here are some attached screen shots <s>.  As you can see, the BusinessObjectToPopulate property is correctly set.

I deleted the child form completely and started from scratch with an absolute minimum configuration and am getting the same results.  The browse dialog does work when I call the child form directly (and fill it using a FillAll() button).  It does not work when I call the child form from the parent form.  This suggests that the browse settings are correct and that it the problem has something to do with the way the child form is being called (direct or as a CFD).

In a way, it makes sense to me that the browse should have trouble when the form is called as a child form.  Let's say the child form loads with 10 records associated with the parent record on the parent form.  Then you hit the browse button with no special conditions and it offers all 50 records in the child table (unfiltered).  And you pick one that is not even in the current 10 in the child form BO.  Where is the record pointer supposed to go when you close the browse?  Obviously, I don't yet know s#it from shinola about what is actually going on under Strataframe's hood but it seems logical that either the browse dialog is already tuned into the filter assumed by the child form... or its not.  And if its not, then I don't see how it could reliably work.  BTW, I tried setting the FK_TemHead filter in the browse window, which correctly limited the displayed records to the same ones in the child form... and the positioning still doesnt work.

Enough speculating... If you could take a look at the attachment, I'd appreciate it.  I fully expect that it will take you 2 seconds to find a setting I have missed.Unsure

Larry

Attachments
ChildDialogBrowse.doc (168 views, 317.00 KB)
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
I am not sure exacatly what you are doing, but the BrowseDialog will update the BO that is set in the BusinessObjectToPopulate property of the BrowseDialog, as well as set the current index to the selected record in the results.  So be sure to check that you have the correct instance of the BO being updated...otherwise, nothing will happen Smile
Larry Tucker
Larry Tucker
StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)
Group: StrataFrame Users
Posts: 69, Visits: 308
Trent,

I've run the upgrade and had some success sending in an initial search value (the child FK) to the browse dialog.   But I notice that something more basic is amiss:  the browse dialog selection is not actually moving the record pointer in the calling form.  In other words, it doesn't matter what I select in the browse dialog... nothing is changed when it closes.  Again, I am calling the browse dialog from a child dialog form.  Is there something about a child dialog that precludes using a browse dialog? 

Just to test it, I started over with a fresh BrowseDialog on the ChildForm with no FK filtering or changes.  When I call the ChildForm directly (not via a CFD on a parent form), the BrowseDialog correctly moves the record pointer to the record selected.  When I call the exact same form via a CFD on a parent form, the browse selection does not move the record pointer.  It does appear that the CFD process is interfering with the BrowseDialog.

Larry

Larry Tucker
Larry Tucker
StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)
Group: StrataFrame Users
Posts: 69, Visits: 308
Trent,

Thanks for the quick reply.  Sounds like a good plan.

Larry

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
The Filter is not respected in the BrowseDialog because a new instance of the BO is created...but aside from that it is querying the database, not the BO.  You can get around this though by either adding a SearchField that is hidden and setting the InitialSearchValue...or by handling the Searching event of the BrowseDialog and manually adding a WHERE condition to the query that only searches on the child records that match the parent.  This can be done fairly easily and it just depends on which avenue that you want to travel.

I recommend loading the 1.6.5 update and then looking at the Advanced BrowseDialog sample.  It shows a simple usage of the Searching event...additionally there is help documentation that has been added that shows how to add a WHERE element through the Searching event of the BrowseDialog.

Larry Tucker
Larry Tucker
StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)
Group: StrataFrame Users
Posts: 69, Visits: 308
Hi,

I've got a child dialog form (built from SF Maintenance class) working well except for its browse dialog, which is not limiting the offered records to those associated with the current parent record.  When it is searched, it offers all possible child records. 

The BO relationship is correctly setup, because adding a MyChildBO1 record correctly fills its FK_Parent foreign key field.  And when I navigate through the child records, only those for a given FK_Parent are shown.   What I would like is for only those records to be offered on the child form's browse dialog.

To help inform the browse dialog, I added a copy of the MyParentBO1 to the child form and have the parent form CFD fill both the MyChildBO1 and MyParentBO1.   I've checked that on the child form, MyParentBO1 is sitting there on the correct record after it is loaded, so that its PK does match the FK on the child records.

I've tried fiddling with the various settings within the ChildForm.BrowseDialog1.BusinessObjectToPopulate properties.  In there, the ParentBusinessObject is correctly set to MyParentBO1.  "ChildAutoFilterOption" looked promising but doesn't seem to help.

Any suggestions would be appreciated. 

TIA,

Larry

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