From: Grant on
I have bBrowser 3 and VO 2.6. I want to use bBrowser to browse to a
customer name and then use the customer name to set a filter and open
a 2nd browser on a second file, the job file. I have created the 1st
browser and open it from a menu and then use CellDoubleClick() to pick
the customer name and then open the Job browser but without setting a
filter. I don't know how to capture the fieldname value to set the
filter from before opening the 2nd browser.
I am new to bbrowser and have a lot to learn about VO so maybe I am
overlooking something but is there not a field name or value passed
when the CellDoubleClick event handler returns. I know I can get the
row and column but how do I get a value from the field?
Perhaps this is not thte best way to accomplish what I wanted but it
seemed very logical up to the point of getting the values for the
filter.
Thank you for any advice. I haven't been able to find similar samples
to learn from so any direction in this would be appreciated.
From: Stephen Quinn on
Grant

Simple way is to open both servers and use a relationship (both bBrowsers on
the same window).
Eg // Check the syntax of the following as I type from memory
oParent := Customer{}
oChild := Jobs{}

oParent:SetSelectiveRelation( oChild, '_FIELD->CUSTID' )

oBBParent := bBrowser{ oParent, etc...}
oBBChild := bBrowser{ oChild, etc...}

oParent:GoTop()

If you want to use 2 windows then just pass oChild into the second window
when you instantiate it.
Eg
oWin := MyDataWindow{ p1,p2,p3, oChild }

You can always get the data from the Server if not the bBrowser
- whatever the bBrowser is pointing at is the current record in the
database.
Eg
// bBrowser
cFName := oBBParent:GetColumn( #FNAME ):Value
or
// Server
cFName := oParent:FIELDGET( #FNAME )
or
// Server via the bBrowser
cFName := oBBParent:Server:FIELDGET( #FNAME )

I suggest you avoid FILTERS until you absolutely HAVE to use them and then
try not to anyway<g>.

Another way (if you don't like relationships) is to use a SCOPE on the
(child) indices, you just need to re-apply it each time you change the
parent record.

HTH
Steve


From: Grant on
On Nov 2, 10:22 pm, "Stephen Quinn" <stevej...(a)bigpondSPAM.net.au>
wrote:
> Grant
>
> Simple way is to open both servers and use a relationship (both bBrowsers on
> the same window).
> Eg // Check the syntax of the following as I type from memory
> oParent := Customer{}
> oChild := Jobs{}
>
> oParent:SetSelectiveRelation( oChild, '_FIELD->CUSTID' )
>
> oBBParent := bBrowser{ oParent, etc...}
> oBBChild := bBrowser{ oChild, etc...}
>
> oParent:GoTop()
>
> If you want to use 2 windows then just pass oChild into the second window
> when you instantiate it.
> Eg
>     oWin := MyDataWindow{ p1,p2,p3, oChild }
>
> You can always get the data from the Server if not the bBrowser
>     - whatever the bBrowser is pointing at is the current record in the
> database.
> Eg
>     // bBrowser
>     cFName := oBBParent:GetColumn( #FNAME ):Value
> or
>     // Server
>     cFName := oParent:FIELDGET( #FNAME )
> or
>     // Server via the bBrowser
>     cFName := oBBParent:Server:FIELDGET( #FNAME )
>
> I suggest you avoid FILTERS until you absolutely HAVE to use them and then
> try not to anyway<g>.
>
> Another way (if you don't like relationships) is to use a SCOPE on the
> (child) indices, you just need to re-apply it each time you change the
> parent record.
>
> HTH
> Steve

Thank you Steve

I will use your suggestions tommorrow and see if I can get the
fieldnames to show up from my code.
I was using a filter because after the Customer name is picked there
are multiple records
in the Job data file that are valid and they would display in the 2nd
browser and then we would edit and do other
things with this data. It seemed the simplest way.

Thanks for your help
Grant
From: Geoff Schaller on
Grant,

Nothing to do with your question....but you should think about upgrading
your VO version. You are still using the CA created product and it has
been enhanced and upgraded substantially since then (2.6 was actually
2.5c - still the CA compiled version).

This is important because most of the comments and suggestions we may
make will relate to that version and some things don't apply to
something as old as 2.6

Cheers,

Geoff



"Grant" <grantd(a)dunsmoreinfo.com> wrote in message
news:1c1f41d9-9271-441e-a0a0-d393101c5b3f(a)d21g2000yqn.googlegroups.com:

> I have bBrowser 3 and VO 2.6. I want to use bBrowser to browse to a
> customer name and then use the customer name to set a filter and open
> a 2nd browser on a second file, the job file. I have created the 1st
> browser and open it from a menu and then use CellDoubleClick() to pick
> the customer name and then open the Job browser but without setting a
> filter. I don't know how to capture the fieldname value to set the
> filter from before opening the 2nd browser.
> I am new to bbrowser and have a lot to learn about VO so maybe I am
> overlooking something but is there not a field name or value passed
> when the CellDoubleClick event handler returns. I know I can get the
> row and column but how do I get a value from the field?
> Perhaps this is not thte best way to accomplish what I wanted but it
> seemed very logical up to the point of getting the values for the
> filter.
> Thank you for any advice. I haven't been able to find similar samples
> to learn from so any direction in this would be appreciated.

From: Stephen Quinn on
Grant

Forgot to mention that the child database MUST have an index for the
relationship to work, the link field doesn't have to be part of the index
expression though.
Eg
INDEX ON CUSTID + JOBNO TAG JOBNOORDER
INDEX ON CUSTID + DTOS( DATEFFLD ) TAG JOBNOORDER

That way the relationship on CUSTID will still show the Jobs in numerical
order or date order if you have the appropriate index defined.

CYA
Steve


 |  Next  |  Last
Pages: 1 2 3
Prev: Simple email sample
Next: Graphics4VO to vulcan