[BR_forum] Search with Grid / List

General development discussion.

Moderators: Susan Smith, admin, Gabriel

Post Reply
Larry

[BR_forum] Search with Grid / List

Post by Larry »

One of the cool things I learned about at the conference was that there is a
search feature that can be attached to a grid or a list.

Unfortunately even with sample code from George, hints from Gabriel, I can't
quite make the connection.

First, does this feature work with both lists and grids? Or just one?

Second, is there a reference in any release notes or other documentation.

And, to make life simple, what is the syntax that makes this all work?


Thanks for any help !


_______________________________________________
BR_forum mailing list
BR_forum@ads.net
http://ads.net/mailman/listinfo/br_forum_ads.net
GomezL
Posts: 258
Joined: Wed Apr 29, 2009 5:51 am
Contact:

[BR_forum] Search with Grid / List

Post by GomezL »

Nice example!

25790 Input #EMF_WIN, Fields "1,16,SEARCH 30,U,2,1;2,1,LIST 19/59,ROWCNT,SEL" : SEARCH_ARG$,AVAIL_ROWS

I pulled this one line out of the sample. It might not have been obvious with all of that code.

1,16,SEARCH 30,U,2,1
Row,Column,SEARCH ##,Attribute,List Row,List Column.

It’s almost like a “C”, but you add the List information at the end of the line.

I think that we tested grids during the conference, and found it’s lists only!


Luis I. Gomez
GomezL@CollectionSoftware.com (GomezL@CollectionSoftware.com)
1-800-435-7257
Commercial Legal Software, Inc.
http://www.CollectionSoftware.com

From: br_forum-bounces@ads.net [mailto:br_forum-bounces@ads.net] On Behalf Of Doug Meenen
Sent: Thursday, May 21, 2009 11:32 PM
To: Business Rules Forum
Subject: Re: [BR_forum] Search with Grid / List


Larry,
Here is a subroutine of a List Window with a Search included.
see the attached screen shot "Search_Window.jpg" for the finished product.

The attached srchwin.wbs file is the code.
Pay attention to the line with "sort", this is the key to searching on the name in column 2.

It uses Gabriel's Fileio to build the data for the list, but this is not required - Fileio just makes life easier in the long run.
I think search may work in a grid, but haven't tried that - I have enough problems with grids already.
Doug Meenen



--- On Thu, 5/21/09, Larry <ltietz@verizon.net> wrote:

From: Larry <ltietz@verizon.net>
Subject: [BR_forum] Search with Grid / List
To: "'Business Rules Forum'" <br_forum@ads.net>
Date: Thursday, May 21, 2009, 10:10 PM
One of the cool things I learned about at the conference was that there is a
search feature that can be attached to a grid or a list.

Unfortunately even with sample code from George, hints from Gabriel, I can't
quite make the connection.

First, does this feature work with both lists and grids? Or just one?

Second, is there a reference in any release notes or other documentation.

And, to make life simple, what is the syntax that makes this all work?


Thanks for any help !


_______________________________________________
BR_forum mailing list
BR_forum@ads.net
http://ads.net/mailman/listinfo/br_forum_ads.net
George Tisdale

[BR_forum] Search with Grid / List

Post by George Tisdale »

SEARCH works very well. In my applications however, I found that I often wanted to search on something other than the first characters of a column and so have added functions to FNSNAP that will search arrays for an instance of the search criteria and build an array of the row numbers that match. I then append a routine to the normal LIST or GRID query that advances the cursor to the next instance by pressing F3. When the last on is reached the F3 cycles back to the first again.

Following is the code that I use (excluding the FNSNAP functions) to display a list or grid and then search (F2 initiates the search, F3 continues it).

00001 MAT HEADERS$(5) !:
LET HEADERS$(1)="Invoice" !:
LET HEADERS$(2)="Date" !:
LET HEADERS$(3)="Unpaid" !:
LET HEADERS$(4)="This run" !:
LET HEADERS$(5)="Balance"
00002 MAT WIDTHS(5) !:
LET WIDTHS(1)=6 !:
LET WIDTHS(2)=10 !:
LET WIDTHS(3)=12 !:
LET WIDTHS(4)=12 !:
LET WIDTHS(5)=12
00003 MAT FORMS$(5) !:
LET FORMS$(1)="c 6" !:
LET FORMS$(2)="fmt(99/99/9999)" !:
LET FORMS$(3)="pic(zzzz,zz#.##-)" !:
LET FORMS$(4)="pic(zzzz,zz#.##-)" !:
LET FORMS$(5)="pic(zzzz,zz#.##-)" !:
! Add P and format specs if needed
00004 LET FNWINROWCOL(0,LROW,LCOL) ! function is in VOL002NEWSCRN.DLL
00005 LET AROWS=0 : LET SROW=4 : LET SCOL=3 !:
LET LCOLS=MIN(LCOL-SROW-2,SUM(MAT WIDTHS)+2) !:
LET LROWS=MIN(LROW-SROW-2,MAX(3,AD+2+AROWS))
(AROWS is additional rows to add to the bottom of the window that is opened to hold the list or grid so that buttons or other information can be added there)

00007 LET LISTSPEC$=FNLISTSPEC$(LISTWIN,SROW,SCOL,LROWS,LCOLS,AROWS,MAT HEADERS$,MAT WIDTHS,MAT FORMS$,"Select Invoice") !:
! add ,GRID$ after "select Invoice" to make a grid where grid$="GRID"
00008 PRINT #LISTWIN, FIELDS LISTSPEC$&",=R" : (MAT ONE$,MAT TWO$,MAT THREE)
00009 MAT SELECT(1)=(0) !:
00010 INPUT #LISTWIN, FIELDS LISTSPEC$&",rowsub,sel ": AX !:
LET FK=FKEY !:
IF FK=201 THEN LET FK=0 !:
! parameters are !:
! GRID cnt,sub,cell !:
! LIST rowsub,rowcnt,cell!:
! cur,sel,all
00011 IF FK=2 THEN
00012 LET SRCHSTR$=FNSRCHCRIT$(STR$(ROUND(LROWS/2,0)),"2",2,LCOLS-4,LISTWIN,"Item to search for") !:
MAT SELECT(1)=(0) !:
! LET FNLISTSRCH(MAT PDINVNR$,SRCHSTR$,MAT SELECT) !:
! LET FNLISTSRCHN(MAT PDPAID,SRCHSTR$,MAT SELECT) !:
! Turn these on to search for stings in matrixes
00013 IF SELECT(1)=0 AND UDIM(SELECT)=1 THEN !:
LET MSGBOX("No matching criterea","Search Results","OK","EXCL") !:
GOTO 10 !:
ELSE !:
LET FF=1 : LET CURFLD(1,SELECT(FF)) : GOTO 10
00014 END IF
00015 IF FK=3 THEN
00016 IF FF<UDIM(MAT SELECT) THEN LET FF+=1 ELSE LET FF=1
00017 LET CURFLD(1,SELECT(FF)) !:
GOTO 10
00018 END IF
00019 IF NOT (FK=0 OR FK=99) THEN GOTO 10
00020 CLOSE #LISTWIN: !:
LET LISTWIN=0

FNLISTSRCH does a case insensitive search of a named character array
FNLISTSRCHN does a case insensitive search of a numeric array by converting each element to a string before searching
All functions referenced are in FNSNAP.dll

In some cases the imbedded search of BR works great, in other cases the “extended” search capability of the FNLISTSRCH functions works great. It’s good to have multiple tools.


George L. Tisdale, CPA
Tisdale CPA
75 Junction Square Drive
Concord, MA 01742
(978) 369-5585


From: br_forum-bounces@ads.net [mailto:br_forum-bounces@ads.net] On Behalf Of Luis I. Gomez
Sent: Friday, May 22, 2009 7:52 AM
To: Business Rules Forum
Subject: Re: [BR_forum] Search with Grid / List



Nice example!

25790 Input #EMF_WIN, Fields "1,16,SEARCH 30,U,2,1;2,1,LIST 19/59,ROWCNT,SEL" : SEARCH_ARG$,AVAIL_ROWS

I pulled this one line out of the sample. It might not have been obvious with all of that code.

1,16,SEARCH 30,U,2,1
Row,Column,SEARCH ##,Attribute,List Row,List Column.

It’s almost like a “C”, but you add the List information at the end of the line.

I think that we tested grids during the conference, and found it’s lists only!


Luis I. Gomez
GomezL@CollectionSoftware.com (GomezL@CollectionSoftware.com)
1-800-435-7257
Commercial Legal Software, Inc.
http://www.CollectionSoftware.com

From: br_forum-bounces@ads.net [mailto:br_forum-bounces@ads.net] On Behalf Of Doug Meenen
Sent: Thursday, May 21, 2009 11:32 PM
To: Business Rules Forum
Subject: Re: [BR_forum] Search with Grid / List


Larry,
Here is a subroutine of a List Window with a Search included.
see the attached screen shot "Search_Window.jpg" for the finished product.

The attached srchwin.wbs file is the code.
Pay attention to the line with "sort", this is the key to searching on the name in column 2.

It uses Gabriel's Fileio to build the data for the list, but this is not required - Fileio just makes life easier in the long run.
I think search may work in a grid, but haven't tried that - I have enough problems with grids already.
Doug Meenen



--- On Thu, 5/21/09, Larry <ltietz@verizon.net> wrote:

From: Larry <ltietz@verizon.net>
Subject: [BR_forum] Search with Grid / List
To: "'Business Rules Forum'" <br_forum@ads.net>
Date: Thursday, May 21, 2009, 10:10 PM
One of the cool things I learned about at the conference was that there is a
search feature that can be attached to a grid or a list.

Unfortunately even with sample code from George, hints from Gabriel, I can't
quite make the connection.

First, does this feature work with both lists and grids? Or just one?

Second, is there a reference in any release notes or other documentation.

And, to make life simple, what is the syntax that makes this all work?


Thanks for any help !


_______________________________________________
BR_forum mailing list
BR_forum@ads.net
http://ads.net/mailman/listinfo/br_forum_ads.net
gordon
Posts: 358
Joined: Fri Apr 24, 2009 6:02 pm

[BR_forum] Search with Grid / List

Post by gordon »

From 4.1 release notes:

Variable Positioning Control Field

RINPUT FIELDS "nn,nn,15/SEARCH 10,leading-attributes,row,col": str-value

Where row,col addresses a GRID or LIST that has been sorted on a column.
This causes the 'current' position to progressively reposition based on
the last column sorted. If no column has been sorted, the an error is
generated.

gordon


On Fri, May 22, 2009 at 7:51 AM, Luis I. Gomez <GomezL@collectionsoftware.com (GomezL@collectionsoftware.com)> wrote:

Nice example!
 
25790     Input #EMF_WIN, Fields "1,16,SEARCH 30,U,2,1;2,1,LIST 19/59,ROWCNT,SEL" : SEARCH_ARG$,AVAIL_ROWS
 
I pulled this one line out of the sample.   It might not have been obvious with all of that code.
 
1,16,SEARCH 30,U,2,1
Row,Column,SEARCH ##,Attribute,List Row,List Column.
 
It’s almost like a “C”, but you add the List information at the end of the line.
 
I think that we tested grids during the conference, and found it’s lists only!
 
 
Luis I. Gomez
GomezL@CollectionSoftware.com (GomezL@CollectionSoftware.com)
1-800-435-7257
Commercial Legal Software, Inc.
http://www.CollectionSoftware.com
 
From: br_forum-bounces@ads.net (br_forum-bounces@ads.net) [mailto:br_forum-bounces@ads.net (br_forum-bounces@ads.net)] On Behalf Of Doug Meenen
Sent: Thursday, May 21, 2009 11:32 PM
To: Business Rules Forum
Subject: Re: [BR_forum] Search with Grid / List


 
Larry,
Here is a subroutine of a List Window with a Search included.
see the attached screen shot "Search_Window.jpg" for the finished product.

The attached srchwin.wbs file is the code.
Pay attention to the line with "sort", this is the key to searching on the name in column 2.

It uses Gabriel's Fileio to build the data for the list, but this is not required - Fileio just makes life easier in the long run.
I think search may work in a grid, but haven't tried that - I have enough problems with grids already.
Doug Meenen



--- On Thu, 5/21/09, Larry <ltietz@verizon.net (ltietz@verizon.net)> wrote:

From: Larry <ltietz@verizon.net (ltietz@verizon.net)>
Subject: [BR_forum] Search with Grid / List
To: "'Business Rules Forum'" <br_forum@ads.net (br_forum@ads.net)>
Date: Thursday, May 21, 2009, 10:10 PM
One of the cool things I learned about at the conference was that there is a
search feature that can be attached to a grid or a list.

Unfortunately even with sample code from George, hints from Gabriel, I can't
quite make the connection.

First, does this feature work with both lists and grids?  Or just one?

Second, is there a reference in any release notes or other documentation.

And, to make life simple, what is the syntax that makes this all work?


Thanks for any help !


_______________________________________________
BR_forum mailing list
BR_forum@ads.net
http://ads.net/mailman/listinfo/br_forum_ads.net

 




_______________________________________________
BR_forum mailing list
BR_forum@ads.net (BR_forum@ads.net)
http://ads.net/mailman/listinfo/br_forum_ads.net
Gabriel
Posts: 412
Joined: Sun Aug 10, 2008 7:37 am
Location: Arlington, TX
Contact:

[BR_forum] Search with Grid / List

Post by Gabriel »

The keys are:
1) It doesn't work with a GRID, only with a LIST
2) The listview HAS to be sorted before the user tries to type into the search box. (You can do this by programatically sorting the list).
3) The you input from your listview and your sort box at the same time.
 
Other people have already chimed in with code examples.
 
Let us know if you are still having troubles.
 
Gabriel

On Thu, May 21, 2009 at 10:10 PM, Larry <ltietz@verizon.net (ltietz@verizon.net)> wrote:
One of the cool things I learned about at the conference was that there is a
search feature that can be attached to a grid or a list.

Unfortunately even with sample code from George, hints from Gabriel, I can't
quite make the connection.

First, does this feature work with both lists and grids?  Or just one?

Second, is there a reference in any release notes or other documentation.

And, to make life simple, what is the syntax that makes this all work?


Thanks for any help !


_______________________________________________
BR_forum mailing list
BR_forum@ads.net (BR_forum@ads.net)
http://ads.net/mailman/listinfo/br_forum_ads.net
Larry

[BR_forum] Search with Grid / List

Post by Larry »

How do you sort the list programmatically? (assuming you can tell the list to do the sort) Or do I just sort before implementing list?



From: br_forum-bounces@ads.net [mailto:br_forum-bounces@ads.net] On Behalf Of Gabriel Bakker
Sent: Friday, May 22, 2009 11:33 AM
To: Business Rules Forum
Subject: Re: [BR_forum] Search with Grid / List


The keys are:

1) It doesn't work with a GRID, only with a LIST
2) The listview HAS to be sorted before the user tries to type into the search box. (You can do this by programatically sorting the list).

3) The you input from your listview and your sort box at the same time.



Other people have already chimed in with code examples.



Let us know if you are still having troubles.



Gabriel

On Thu, May 21, 2009 at 10:10 PM, Larry <ltietz@verizon.net (ltietz@verizon.net)> wrote:
One of the cool things I learned about at the conference was that there is a
search feature that can be attached to a grid or a list.

Unfortunately even with sample code from George, hints from Gabriel, I can't
quite make the connection.

First, does this feature work with both lists and grids? Or just one?

Second, is there a reference in any release notes or other documentation.

And, to make life simple, what is the syntax that makes this all work?


Thanks for any help !


_______________________________________________
BR_forum mailing list
BR_forum@ads.net (BR_forum@ads.net)
http://ads.net/mailman/listinfo/br_forum_ads.net
Kevin Klappstein

[BR_forum] Search with Grid / List

Post by Kevin Klappstein »

Print #SELWIN, Fields "XPOS,YPOS,LIST ROWS/COLS,SORT": COLUMN

Where column is the column # you want to sort by.
ie.

Print #SELWIN, Fields "2,1,LIST 10/50,SORT": 1

Kevin Klappstein
Western Canadian Software
kevin@wcs.ab.ca



Larry wrote:
How do you sort the list programmatically? (assuming you can tell the
list to do the sort) Or do I just sort before implementing list?





------------------------------------------------------------------------

*From:* br_forum-bounces@ads.net [mailto:br_forum-bounces@ads.net] *On
Behalf Of *Gabriel Bakker
*Sent:* Friday, May 22, 2009 11:33 AM
*To:* Business Rules Forum
*Subject:* Re: [BR_forum] Search with Grid / List



The keys are:

1) It doesn't work with a GRID, only with a LIST
2) The listview HAS to be sorted before the user tries to type into
the search box. (You can do this by programatically sorting the list).

3) The you input from your listview and your sort box at the same time.



Other people have already chimed in with code examples.



Let us know if you are still having troubles.



Gabriel

On Thu, May 21, 2009 at 10:10 PM, Larry <ltietz@verizon.net
<mailto:ltietz@verizon.net>> wrote:

One of the cool things I learned about at the conference was that
there is a
search feature that can be attached to a grid or a list.

Unfortunately even with sample code from George, hints from Gabriel, I
can't
quite make the connection.

First, does this feature work with both lists and grids? Or just one?

Second, is there a reference in any release notes or other documentation.

And, to make life simple, what is the syntax that makes this all work?


Thanks for any help !


_______________________________________________
BR_forum mailing list
BR_forum@ads.net <mailto:BR_forum@ads.net>
http://ads.net/mailman/listinfo/br_forum_ads.net



------------------------------------------------------------------------

_______________________________________________
BR_forum mailing list
BR_forum@ads.net
http://ads.net/mailman/listinfo/br_forum_ads.net
_______________________________________________
BR_forum mailing list
BR_forum@ads.net
http://ads.net/mailman/listinfo/br_forum_ads.net
Larry

[BR_forum] Search with Grid / List

Post by Larry »

I am using a grid to input orders. The grid shows item numbers, descriptions and prices. The quantity column is empty, because that is where ordered quantities will be entered.

The operator would like to goto a particular item number. The item number would be entered into the search field and the corresponding row might be returned.

However, the search field needs to be linked to a list. Can I switch back and forth between a list and a grid?

The only thing a list will provide is a row that has been selected

Would the process look something like this-

Print list

Input search

Print grid



From: br_forum-bounces@ads.net [mailto:br_forum-bounces@ads.net] On Behalf Of Gabriel Bakker
Sent: Friday, May 22, 2009 11:33 AM
To: Business Rules Forum
Subject: Re: [BR_forum] Search with Grid / List


The keys are:

1) It doesn't work with a GRID, only with a LIST
2) The listview HAS to be sorted before the user tries to type into the search box. (You can do this by programatically sorting the list).

3) The you input from your listview and your sort box at the same time.



Other people have already chimed in with code examples.



Let us know if you are still having troubles.



Gabriel

On Thu, May 21, 2009 at 10:10 PM, Larry <ltietz@verizon.net (ltietz@verizon.net)> wrote:
One of the cool things I learned about at the conference was that there is a
search feature that can be attached to a grid or a list.

Unfortunately even with sample code from George, hints from Gabriel, I can't
quite make the connection.

First, does this feature work with both lists and grids? Or just one?

Second, is there a reference in any release notes or other documentation.

And, to make life simple, what is the syntax that makes this all work?


Thanks for any help !


_______________________________________________
BR_forum mailing list
BR_forum@ads.net (BR_forum@ads.net)
http://ads.net/mailman/listinfo/br_forum_ads.net
Larry

[BR_forum] Search with Grid / List

Post by Larry »

What does the 10 represent in your example, or the 30 in Luis’s example?



From: br_forum-bounces@ads.net [mailto:br_forum-bounces@ads.net] On Behalf Of Gordon Dye
Sent: Friday, May 22, 2009 11:07 AM
To: Business Rules Forum
Subject: Re: [BR_forum] Search with Grid / List


From 4.1 release notes:

Variable Positioning Control Field

RINPUT FIELDS "nn,nn,15/SEARCH 10,leading-attributes,row,col": str-value

Where row,col addresses a GRID or LIST that has been sorted on a column.
This causes the 'current' position to progressively reposition based on
the last column sorted. If no column has been sorted, the an error is
generated.

gordon


On Fri, May 22, 2009 at 7:51 AM, Luis I. Gomez <GomezL@collectionsoftware.com (GomezL@collectionsoftware.com)> wrote:
Nice example!

25790 Input #EMF_WIN, Fields "1,16,SEARCH 30,U,2,1;2,1,LIST 19/59,ROWCNT,SEL" : SEARCH_ARG$,AVAIL_ROWS

I pulled this one line out of the sample. It might not have been obvious with all of that code.

1,16,SEARCH 30,U,2,1
Row,Column,SEARCH ##,Attribute,List Row,List Column.

It’s almost like a “C”, but you add the List information at the end of the line.

I think that we tested grids during the conference, and found it’s lists only!


Luis I. Gomez
GomezL@CollectionSoftware.com (GomezL@CollectionSoftware.com)
1-800-435-7257
Commercial Legal Software, Inc.
http://www.CollectionSoftware.com

From: br_forum-bounces@ads.net (br_forum-bounces@ads.net) [mailto:br_forum-bounces@ads.net (br_forum-bounces@ads.net)] On Behalf Of Doug Meenen
Sent: Thursday, May 21, 2009 11:32 PM
To: Business Rules Forum
Subject: Re: [BR_forum] Search with Grid / List


Larry,
Here is a subroutine of a List Window with a Search included.
see the attached screen shot "Search_Window.jpg" for the finished product.

The attached srchwin.wbs file is the code.
Pay attention to the line with "sort", this is the key to searching on the name in column 2.

It uses Gabriel's Fileio to build the data for the list, but this is not required - Fileio just makes life easier in the long run.
I think search may work in a grid, but haven't tried that - I have enough problems with grids already.
Doug Meenen



--- On Thu, 5/21/09, Larry <ltietz@verizon.net (ltietz@verizon.net)> wrote:

From: Larry <ltietz@verizon.net (ltietz@verizon.net)>
Subject: [BR_forum] Search with Grid / List
To: "'Business Rules Forum'" <br_forum@ads.net (br_forum@ads.net)>
Date: Thursday, May 21, 2009, 10:10 PM
One of the cool things I learned about at the conference was that there is a
search feature that can be attached to a grid or a list.

Unfortunately even with sample code from George, hints from Gabriel, I can't
quite make the connection.

First, does this feature work with both lists and grids? Or just one?

Second, is there a reference in any release notes or other documentation.

And, to make life simple, what is the syntax that makes this all work?


Thanks for any help !


_______________________________________________
BR_forum mailing list
BR_forum@ads.net
http://ads.net/mailman/listinfo/br_forum_ads.net







_______________________________________________
BR_forum mailing list
BR_forum@ads.net (BR_forum@ads.net)
http://ads.net/mailman/listinfo/br_forum_ads.net
gordon
Posts: 358
Joined: Fri Apr 24, 2009 6:02 pm

[BR_forum] Search with Grid / List

Post by gordon »

Hey everybody - the doco says it DOES work with a GRID. That's why I pasted the release notes in my previous comment.

If it doesn't, then please provide an example that fails.

gordon


On Fri, May 22, 2009 at 3:25 PM, Larry <ltietz@verizon.net (ltietz@verizon.net)> wrote:

What does the 10 represent in your example, or the 30 in Luis’s example?
 
 

From: br_forum-bounces@ads.net (br_forum-bounces@ads.net) [mailto:br_forum-bounces@ads.net (br_forum-bounces@ads.net)] On Behalf Of Gordon Dye
Sent: Friday, May 22, 2009 11:07 AM

To: Business Rules Forum
Subject: Re: [BR_forum] Search with Grid / List




 
From 4.1 release notes:

Variable Positioning Control Field

RINPUT FIELDS "nn,nn,15/SEARCH 10,leading-attributes,row,col": str-value

Where row,col addresses a GRID or LIST that has been sorted on a column.
This causes the 'current' position to progressively reposition based on
the last column sorted. If no column has been sorted, the an error is
generated.

gordon


On Fri, May 22, 2009 at 7:51 AM, Luis I. Gomez <GomezL@collectionsoftware.com (GomezL@collectionsoftware.com)> wrote:
Nice example!
 
25790     Input #EMF_WIN, Fields "1,16,SEARCH 30,U,2,1;2,1,LIST 19/59,ROWCNT,SEL" : SEARCH_ARG$,AVAIL_ROWS
 
I pulled this one line out of the sample.   It might not have been obvious with all of that code.
 
1,16,SEARCH 30,U,2,1
Row,Column,SEARCH ##,Attribute,List Row,List Column.
 
It’s almost like a “C”, but you add the List information at the end of the line.
 
I think that we tested grids during the conference, and found it’s lists only!
 
 
Luis I. Gomez
GomezL@CollectionSoftware.com (GomezL@CollectionSoftware.com)
1-800-435-7257
Commercial Legal Software, Inc.
http://www.CollectionSoftware.com
 
From: br_forum-bounces@ads.net (br_forum-bounces@ads.net) [mailto:br_forum-bounces@ads.net (br_forum-bounces@ads.net)] On Behalf Of Doug Meenen
Sent: Thursday, May 21, 2009 11:32 PM
To: Business Rules Forum
Subject: Re: [BR_forum] Search with Grid / List

 
Larry,
Here is a subroutine of a List Window with a Search included.
see the attached screen shot "Search_Window.jpg" for the finished product.

The attached srchwin.wbs file is the code.
Pay attention to the line with "sort", this is the key to searching on the name in column 2.

It uses Gabriel's Fileio to build the data for the list, but this is not required - Fileio just makes life easier in the long run.
I think search may work in a grid, but haven't tried that - I have enough problems with grids already.
Doug Meenen



--- On Thu, 5/21/09, Larry <ltietz@verizon.net (ltietz@verizon.net)> wrote:

From: Larry <ltietz@verizon.net (ltietz@verizon.net)>
Subject: [BR_forum] Search with Grid / List
To: "'Business Rules Forum'" <br_forum@ads.net (br_forum@ads.net)>
Date: Thursday, May 21, 2009, 10:10 PM
One of the cool things I learned about at the conference was that there is a
search feature that can be attached to a grid or a list.

Unfortunately even with sample code from George, hints from Gabriel, I can't
quite make the connection.

First, does this feature work with both lists and grids?  Or just one?

Second, is there a reference in any release notes or other documentation.

And, to make life simple, what is the syntax that makes this all work?


Thanks for any help !


_______________________________________________
BR_forum mailing list
BR_forum@ads.net
http://ads.net/mailman/listinfo/br_forum_ads.net

 





_______________________________________________
BR_forum mailing list
BR_forum@ads.net (BR_forum@ads.net)
http://ads.net/mailman/listinfo/br_forum_ads.net

 




_______________________________________________
BR_forum mailing list
BR_forum@ads.net (BR_forum@ads.net)
http://ads.net/mailman/listinfo/br_forum_ads.net
Larry

[BR_forum] Search with Grid / List

Post by Larry »

Ok, how do I use this info. How does this connect to the list or grid?

I sort the grid using:

PRINT FIELDS "nn,nn,GRID 10/40,SORT": {column number}

I give the grid info via:

RINPUT FIELDS "nn,nn,15/SEARCH 10,leading-attributes,row,col": str-value

Is row 10 and col 40?

Shouldn’t there be a GRID 10/40 somewhere in that line?



From 4.1 release notes:

Variable Positioning Control Field

RINPUT FIELDS "nn,nn,15/SEARCH 10,leading-attributes,row,col": str-value

Where row,col addresses a GRID or LIST that has been sorted on a column.
This causes the 'current' position to progressively reposition based on
the last column sorted. If no column has been sorted, the an error is
generated.

gordon


On Fri, May 22, 2009 at 7:51 AM, Luis I. Gomez <GomezL@collectionsoftware.com (GomezL@collectionsoftware.com)> wrote:
Nice example!

25790 Input #EMF_WIN, Fields "1,16,SEARCH 30,U,2,1;2,1,LIST 19/59,ROWCNT,SEL" : SEARCH_ARG$,AVAIL_ROWS

I pulled this one line out of the sample. It might not have been obvious with all of that code.

1,16,SEARCH 30,U,2,1
Row,Column,SEARCH ##,Attribute,List Row,List Column.

It’s almost like a “C”, but you add the List information at the end of the line.

I think that we tested grids during the conference, and found it’s lists only!


Luis I. Gomez
GomezL@CollectionSoftware.com (GomezL@CollectionSoftware.com)
1-800-435-7257
Commercial Legal Software, Inc.
http://www.CollectionSoftware.com

From: br_forum-bounces@ads.net (br_forum-bounces@ads.net) [mailto:br_forum-bounces@ads.net (br_forum-bounces@ads.net)] On Behalf Of Doug Meenen
Sent: Thursday, May 21, 2009 11:32 PM
To: Business Rules Forum
Subject: Re: [BR_forum] Search with Grid / List


Larry,
Here is a subroutine of a List Window with a Search included.
see the attached screen shot "Search_Window.jpg" for the finished product.

The attached srchwin.wbs file is the code.
Pay attention to the line with "sort", this is the key to searching on the name in column 2.

It uses Gabriel's Fileio to build the data for the list, but this is not required - Fileio just makes life easier in the long run.
I think search may work in a grid, but haven't tried that - I have enough problems with grids already.
Doug Meenen



--- On Thu, 5/21/09, Larry <ltietz@verizon.net (ltietz@verizon.net)> wrote:

From: Larry <ltietz@verizon.net (ltietz@verizon.net)>
Subject: [BR_forum] Search with Grid / List
To: "'Business Rules Forum'" <br_forum@ads.net (br_forum@ads.net)>
Date: Thursday, May 21, 2009, 10:10 PM
One of the cool things I learned about at the conference was that there is a
search feature that can be attached to a grid or a list.

Unfortunately even with sample code from George, hints from Gabriel, I can't
quite make the connection.

First, does this feature work with both lists and grids? Or just one?

Second, is there a reference in any release notes or other documentation.

And, to make life simple, what is the syntax that makes this all work?


Thanks for any help !


_______________________________________________
BR_forum mailing list
BR_forum@ads.net
http://ads.net/mailman/listinfo/br_forum_ads.net







_______________________________________________
BR_forum mailing list
BR_forum@ads.net (BR_forum@ads.net)
http://ads.net/mailman/listinfo/br_forum_ads.net
Gabriel
Posts: 412
Joined: Sun Aug 10, 2008 7:37 am
Location: Arlington, TX
Contact:

[BR_forum] Search with Grid / List

Post by Gabriel »

Larry,
 
Following is a sample listview with a sort. To keep the example short I have left off the code that builds the arrays for the fields in the listview. I am assuming you already have code that works to build arrays.
 
In this example, mat ClientHeadings$, mat ClientWidths, and mat ClientSpec$ are the definition of the columns in your listview.
 
The arrays that are called Mat CLV_Something$ in the example contain the actual data to display on the listview.
 
The steps required to get your search box working are:
 
1) Draw the listview
2) Populate the listview
3) Sort the listview through code
4) Input from the listview and the search box.
 
 
 ! Draw Listview
 print #0, fields "6,9,LIST 15/65,HEADERS,[LVHEADERS]" : (Mat Clientheadings$, Mat Clientwidths, Mat Clientspec$)
 
 ! Populate Listview
 print #0, fields "6,9,LIST 15/65,=" : (Mat Clv_Acct$,Mat Clv_Name$,Mat Clv_Street$,Mat Clv_Town$)

 ! Presort List On Acct Num
 print #0, fields "6,9,LIST 15/65,SORT": 1
 
 ! Input from the listview and the search box.
 input #0, fields "4,34,SEARCH 25,,6,9;6,9,LIST 15/65,ROWSUB,SELONE" : Search$,Selectedrow

 
Now, take a closer look at the last line, the input statement. You want to input from both your search box and your listview at the same time - that way they will both be active at the same time. The format for the search box is "row,col,SEARCH width,,ListviewRow,ListviewCol". The format for the listview is "ListviewRow,ListviewCol,LIST Height/Width". The ListviewRow and ListviewCol is what tells the search box which listview to search through. All the rest of the magic is handled for us in BR.
 
Does this explanation help?
 
Gabriel


 
On Sat, May 23, 2009 at 6:04 AM, Larry <ltietz@verizon.net (ltietz@verizon.net)> wrote:

Ok,  how do I use this info.  How does this connect to the list or grid?
 
I sort the grid using:
 
PRINT FIELDS "nn,nn,GRID 10/40,SORT": {column number}
 
I give the grid info via:
 
RINPUT FIELDS "nn,nn,15/SEARCH 10,leading-attributes,row,col": str-value
 

Is row 10 and col 40?
 
Shouldn’t there be a GRID 10/40 somewhere in that line?

 
 
 
From 4.1 release notes:

Variable Positioning Control Field

RINPUT FIELDS "nn,nn,15/SEARCH 10,leading-attributes,row,col": str-value

Where row,col addresses a GRID or LIST that has been sorted on a column.
This causes the 'current' position to progressively reposition based on
the last column sorted. If no column has been sorted, the an error is
generated.

gordon


On Fri, May 22, 2009 at 7:51 AM, Luis I. Gomez <GomezL@collectionsoftware.com (GomezL@collectionsoftware.com)> wrote:
Nice example!
 
25790     Input #EMF_WIN, Fields "1,16,SEARCH 30,U,2,1;2,1,LIST 19/59,ROWCNT,SEL" : SEARCH_ARG$,AVAIL_ROWS
 
I pulled this one line out of the sample.   It might not have been obvious with all of that code.
 
1,16,SEARCH 30,U,2,1
Row,Column,SEARCH ##,Attribute,List Row,List Column.
 
It’s almost like a “C”, but you add the List information at the end of the line.
 
I think that we tested grids during the conference, and found it’s lists only!
 
 
Luis I. Gomez
GomezL@CollectionSoftware.com (GomezL@CollectionSoftware.com)
1-800-435-7257
Commercial Legal Software, Inc.
http://www.CollectionSoftware.com
 
From: br_forum-bounces@ads.net (br_forum-bounces@ads.net) [mailto:br_forum-bounces@ads.net (br_forum-bounces@ads.net)] On Behalf Of Doug Meenen
Sent: Thursday, May 21, 2009 11:32 PM
To: Business Rules Forum
Subject: Re: [BR_forum] Search with Grid / List

 
Larry,
Here is a subroutine of a List Window with a Search included.
see the attached screen shot "Search_Window.jpg" for the finished product.

The attached srchwin.wbs file is the code.
Pay attention to the line with "sort", this is the key to searching on the name in column 2.

It uses Gabriel's Fileio to build the data for the list, but this is not required - Fileio just makes life easier in the long run.
I think search may work in a grid, but haven't tried that - I have enough problems with grids already.
Doug Meenen



--- On Thu, 5/21/09, Larry <ltietz@verizon.net (ltietz@verizon.net)> wrote:

From: Larry <ltietz@verizon.net (ltietz@verizon.net)>
Subject: [BR_forum] Search with Grid / List
To: "'Business Rules Forum'" <br_forum@ads.net (br_forum@ads.net)>
Date: Thursday, May 21, 2009, 10:10 PM
One of the cool things I learned about at the conference was that there is a
search feature that can be attached to a grid or a list.

Unfortunately even with sample code from George, hints from Gabriel, I can't
quite make the connection.

First, does this feature work with both lists and grids?  Or just one?

Second, is there a reference in any release notes or other documentation.

And, to make life simple, what is the syntax that makes this all work?


Thanks for any help !


_______________________________________________
BR_forum mailing list
BR_forum@ads.net
http://ads.net/mailman/listinfo/br_forum_ads.net

 





_______________________________________________
BR_forum mailing list
BR_forum@ads.net (BR_forum@ads.net)
http://ads.net/mailman/listinfo/br_forum_ads.net

 




_______________________________________________
BR_forum mailing list
BR_forum@ads.net (BR_forum@ads.net)
http://ads.net/mailman/listinfo/br_forum_ads.net
Larry

[BR_forum] Search with Grid / List

Post by Larry »

Yes!! I finally located the source of my problem. The Search control needed the row and col where the starting row and columun of the list /grid control I wanted to connect to. That;s why I kept asking what the various parameters meant.

I can confirm that the SEARCH command works equally well with both LISTs and GRIDs.

I fully empathize with Susan, about what we know and what we have forgotten and why one approach may be favored over another. All too often we are racing to complete a project, choosing anything that works. We envy those operations with a stuff that work out which approach is best in terms of speed, etc (lol) !

I am very grateful for everyone’s help and willingness to share.

Extra especially grateful on these holidays and weekends. BRers never sleep !


From: br_forum-bounces@ads.net [mailto:br_forum-bounces@ads.net] On Behalf Of Gabriel Bakker
Sent: Monday, May 25, 2009 1:05 PM
To: Business Rules Forum
Subject: Re: [BR_forum] Search with Grid / List


Larry,



Following is a sample listview with a sort. To keep the example short I have left off the code that builds the arrays for the fields in the listview. I am assuming you already have code that works to build arrays.



In this example, mat ClientHeadings$, mat ClientWidths, and mat ClientSpec$ are the definition of the columns in your listview.



The arrays that are called Mat CLV_Something$ in the example contain the actual data to display on the listview.



The steps required to get your search box working are:



1) Draw the listview

2) Populate the listview

3) Sort the listview through code

4) Input from the listview and the search box.





! Draw Listview
print #0, fields "6,9,LIST 15/65,HEADERS,[LVHEADERS]" : (Mat Clientheadings$, Mat Clientwidths, Mat Clientspec$)



! Populate Listview
print #0, fields "6,9,LIST 15/65,=" : (Mat Clv_Acct$,Mat Clv_Name$,Mat Clv_Street$,Mat Clv_Town$)

! Presort List On Acct Num

print #0, fields "6,9,LIST 15/65,SORT": 1


! Input from the listview and the search box.

input #0, fields "4,34,SEARCH 25,,6,9;6,9,LIST 15/65,ROWSUB,SELONE" : Search$,Selectedrow



Now, take a closer look at the last line, the input statement. You want to input from both your search box and your listview at the same time - that way they will both be active at the same time. The format for the search box is "row,col,SEARCH width,,ListviewRow,ListviewCol". The format for the listview is "ListviewRow,ListviewCol,LIST Height/Width". The ListviewRow and ListviewCol is what tells the search box which listview to search through. All the rest of the magic is handled for us in BR.



Does this explanation help?



Gabriel





On Sat, May 23, 2009 at 6:04 AM, Larry <ltietz@verizon.net (ltietz@verizon.net)> wrote:
Ok, how do I use this info. How does this connect to the list or grid?

I sort the grid using:

PRINT FIELDS "nn,nn,GRID 10/40,SORT": {column number}

I give the grid info via:

RINPUT FIELDS "nn,nn,15/SEARCH 10,leading-attributes,row,col": str-value


Is row 10 and col 40?

Shouldn’t there be a GRID 10/40 somewhere in that line?



From 4.1 release notes:

Variable Positioning Control Field

RINPUT FIELDS "nn,nn,15/SEARCH 10,leading-attributes,row,col": str-value

Where row,col addresses a GRID or LIST that has been sorted on a column.
This causes the 'current' position to progressively reposition based on
the last column sorted. If no column has been sorted, the an error is
generated.

gordon
On Fri, May 22, 2009 at 7:51 AM, Luis I. Gomez <GomezL@collectionsoftware.com (GomezL@collectionsoftware.com)> wrote:
Nice example!

25790 Input #EMF_WIN, Fields "1,16,SEARCH 30,U,2,1;2,1,LIST 19/59,ROWCNT,SEL" : SEARCH_ARG$,AVAIL_ROWS

I pulled this one line out of the sample. It might not have been obvious with all of that code.

1,16,SEARCH 30,U,2,1
Row,Column,SEARCH ##,Attribute,List Row,List Column.

It’s almost like a “C”, but you add the List information at the end of the line.

I think that we tested grids during the conference, and found it’s lists only!


Luis I. Gomez
GomezL@CollectionSoftware.com (GomezL@CollectionSoftware.com)
1-800-435-7257
Commercial Legal Software, Inc.
http://www.CollectionSoftware.com

From: br_forum-bounces@ads.net (br_forum-bounces@ads.net) [mailto:br_forum-bounces@ads.net (br_forum-bounces@ads.net)] On Behalf Of Doug Meenen
Sent: Thursday, May 21, 2009 11:32 PM
To: Business Rules Forum
Subject: Re: [BR_forum] Search with Grid / List


Larry,
Here is a subroutine of a List Window with a Search included.
see the attached screen shot "Search_Window.jpg" for the finished product.

The attached srchwin.wbs file is the code.
Pay attention to the line with "sort", this is the key to searching on the name in column 2.

It uses Gabriel's Fileio to build the data for the list, but this is not required - Fileio just makes life easier in the long run.
I think search may work in a grid, but haven't tried that - I have enough problems with grids already.
Doug Meenen



--- On Thu, 5/21/09, Larry <ltietz@verizon.net (ltietz@verizon.net)> wrote:

From: Larry <ltietz@verizon.net (ltietz@verizon.net)>
Subject: [BR_forum] Search with Grid / List
To: "'Business Rules Forum'" <br_forum@ads.net (br_forum@ads.net)>
Date: Thursday, May 21, 2009, 10:10 PM
One of the cool things I learned about at the conference was that there is a
search feature that can be attached to a grid or a list.

Unfortunately even with sample code from George, hints from Gabriel, I can't
quite make the connection.

First, does this feature work with both lists and grids? Or just one?

Second, is there a reference in any release notes or other documentation.

And, to make life simple, what is the syntax that makes this all work?


Thanks for any help !


_______________________________________________
BR_forum mailing list
BR_forum@ads.net
http://ads.net/mailman/listinfo/br_forum_ads.net







_______________________________________________
BR_forum mailing list
BR_forum@ads.net (BR_forum@ads.net)
http://ads.net/mailman/listinfo/br_forum_ads.net







_______________________________________________
BR_forum mailing list
BR_forum@ads.net (BR_forum@ads.net)
http://ads.net/mailman/listinfo/br_forum_ads.net
Susan Smith
Posts: 717
Joined: Sun Aug 10, 2008 4:24 am
Location: Southern California

[BR_forum] Search with Grid / List

Post by Susan Smith »

Thanks for posting back with your results Larry. I haven't tried the search yet, but I'm working on a project right now where it will probably be used often. So now I can go back in the conversations and follow your path to success! ("path to success"? How cheesy did THAT sound? <g>)

-- Susan

Larry wrote:
v:* {behavior:url(#default#VML);} o:* {behavior:url(#default#VML);} w:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} <![endif]--> st1:*{behavior:url(#default#ieooui) } <![endif]--> <![endif]--> <![endif]-->
Yes!! I finally located the source of my problem. The Search control needed the row and col where the starting row and columun of the list /grid control I wanted to connect to. That;s why I kept asking what the various parameters meant.

I can confirm that the SEARCH command works equally well with both LISTs and GRIDs.

I fully empathize with Susan, about what we know and what we have forgotten and why one approach may be favored over another. All too often we are racing to complete a project, choosing anything that works. We envy those operations with a stuff that work out which approach is best in terms of speed, etc (lol) !

I am very grateful for everyone’s help and willingness to share.

Extra especially grateful on these holidays and weekends. BRers never sleep !


From: br_forum-bounces@ads.net (br_forum-bounces@ads.net) [mailto:br_forum-bounces@ads.net (br_forum-bounces@ads.net)] On Behalf Of Gabriel Bakker
Sent: Monday, May 25, 2009 1:05 PM
To: Business Rules Forum
Subject: Re: [BR_forum] Search with Grid / List


Larry,



Following is a sample listview with a sort. To keep the example short I have left off the code that builds the arrays for the fields in the listview. I am assuming you already have code that works to build arrays.



In this example, mat ClientHeadings$, mat ClientWidths, and mat ClientSpec$ are the definition of the columns in your listview.



The arrays that are called Mat CLV_Something$ in the example contain the actual data to display on the listview.



The steps required to get your search box working are:



1) Draw the listview

2) Populate the listview

3) Sort the listview through code

4) Input from the listview and the search box.





! Draw Listview
print #0, fields "6,9,LIST 15/65,HEADERS,[LVHEADERS]" : (Mat Clientheadings$, Mat Clientwidths, Mat Clientspec$)



! Populate Listview
print #0, fields "6,9,LIST 15/65,=" : (Mat Clv_Acct$,Mat Clv_Name$,Mat Clv_Street$,Mat Clv_Town$)

! Presort List On Acct Num

print #0, fields "6,9,LIST 15/65,SORT": 1


! Input from the listview and the search box.

input #0, fields "4,34,SEARCH 25,,6,9;6,9,LIST 15/65,ROWSUB,SELONE" : Search$,Selectedrow



Now, take a closer look at the last line, the input statement. You want to input from both your search box and your listview at the same time - that way they will both be active at the same time. The format for the search box is "row,col,SEARCH width,,ListviewRow,ListviewCol". The format for the listview is "ListviewRow,ListviewCol,LIST Height/Width". The ListviewRow and ListviewCol is what tells the search box which listview to search through. All the rest of the magic is handled for us in BR.



Does this explanation help?



Gabriel





On Sat, May 23, 2009 at 6:04 AM, Larry <ltietz@verizon.net (ltietz@verizon.net)> wrote: Ok, how do I use this info. How does this connect to the list or grid?
I sort the grid using:
PRINT FIELDS "nn,nn,GRID 10/40,SORT": {column number}
I give the grid info via: RINPUT FIELDS "nn,nn,15/SEARCH 10,leading-attributes,row,col": str-value
Is row 10 and col 40?

Shouldn’t there be a GRID 10/40 somewhere in that line?
From 4.1 release notes:

Variable Positioning Control Field

RINPUT FIELDS "nn,nn,15/SEARCH 10,leading-attributes,row,col": str-value

Where row,col addresses a GRID or LIST that has been sorted on a column.
This causes the 'current' position to progressively reposition based on
the last column sorted. If no column has been sorted, the an error is
generated.

gordon
On Fri, May 22, 2009 at 7:51 AM, Luis I. Gomez <GomezL@collectionsoftware.com (GomezL@collectionsoftware.com)> wrote: Nice example!

25790 Input #EMF_WIN, Fields "1,16,SEARCH 30,U,2,1;2,1,LIST 19/59,ROWCNT,SEL" : SEARCH_ARG$,AVAIL_ROWS

I pulled this one line out of the sample. It might not have been obvious with all of that code.

1,16,SEARCH 30,U,2,1
Row,Column,SEARCH ##,Attribute,List Row,List Column.

It’s almost like a “C”, but you add the List information at the end of the line.

I think that we tested grids during the conference, and found it’s lists only!


Luis I. Gomezhttp://www.collectionsoftware.com/

From: br_forum-bounces@ads.net (br_forum-bounces@ads.net) [mailto:br_forum-bounces@ads.net (br_forum-bounces@ads.net)] On Behalf Of Doug Meenen
Sent: Thursday, May 21, 2009 11:32 PM
To: Business Rules Forum
Subject: Re: [BR_forum] Search with Grid / List


Larry,
Here is a subroutine of a List Window with a Search included.
see the attached screen shot "Search_Window.jpg" for the finished product.

The attached srchwin.wbs file is the code.
Pay attention to the line with "sort", this is the key to searching on the name in column 2.

It uses Gabriel's Fileio to build the data for the list, but this is not required - Fileio just makes life easier in the long run.
I think search may work in a grid, but haven't tried that - I have enough problems with grids already.
Doug Meenen



--- On Thu, 5/21/09, Larry <ltietz@verizon.net (ltietz@verizon.net)> wrote:

From: Larry <ltietz@verizon.net (ltietz@verizon.net)>
Subject: [BR_forum] Search with Grid / List
To: "'Business Rules Forum'" <br_forum@ads.net (br_forum@ads.net)>
Date: Thursday, May 21, 2009, 10:10 PM
One of the cool things I learned about at the conference was that there is a
search feature that can be attached to a grid or a list.

Unfortunately even with sample code from George, hints from Gabriel, I can't
quite make the connection.

First, does this feature work with both lists and grids? Or just one?

Second, is there a reference in any release notes or other documentation.

And, to make life simple, what is the syntax that makes this all work?


Thanks for any help !













Post Reply