🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.vdbase.forms
2 messages
2 total messages Started by Calciotel Sun, 14 Mar 1999 00:00
Filter on a Form
#108
Author: Calciotel
Date: Sun, 14 Mar 1999 00:00
71 lines
2411 bytes
Hi,
I would like to know more imformation on the use of CanGetRow() event on a
query:
I have a form with 2 table in relation father-child 1:N;
I must in the same table filter the rowset for same fields of the father
table and one field of the child table and the  query do need to be live for
modified it.
I input the filter option in same entryfield object and then i apply the
form.query1.rowset.filter=.... value of entryfiled

How i can do for filter also a field of the child table?? Can i do the
CanGetRow() function?? How i can use it??

Example of may source code:
 this.QUERY1 = new QUERY()
   this.QUERY1.parent = this
   with (this.QUERY1)
      left = 55
      top = -0.0455
      database = form.database1
      sql = 'select * from "calciato.dbf"'
      active = true
   endwith

this.QUERY2 = new QUERY()
   this.QUERY2.parent = this
   with (this.QUERY2)
      left = 65
      top = -0.0455
      database = form.database1
      sql = 'select * from "note.dbf"'
      active = true
   endwith

   with (this.QUERY2.rowset)
      filterOptions = 3 // Lunghezza parziale e ignora M/m
      indexName = "CALNOT"
      masterRowset = parent.parent.query1.rowset
      masterFields = "CALCIAID"
   endwith

 this.FIELD_SER = new ENTRYFIELD(this)
   with (this.FIELD_SER)
      enabled = false
      height = 0.8182
      left = 61
      top = 2.5
      width = 24
      fontName = "MS Sans Serif"
      fontSize = 8
      fontBold = true
      value = ""
      validErrorMsg = "Dato immesso non valido "
      pageno = 1
   endwith

function PUSHBUTTON_filter_onClick
     wnom=trim(ltrim(form.field_ser.value))
     WFIL="observ='&wnom' "

     form.query1.rowset.beginfilter()
     form.query1.rowset.filter=wfil
     form.query1.rowset.refresh()
     form.query1.rowset.applyfilter()
 return

This go only for the input fields of the father table...

How can i do???
Thank's in advanced.
Andrea
Re: Filter on a Form
#110
Author: Bowen Moursund (dBASE, Inc.)
Date: Sun, 14 Mar 1999 00:00
31 lines
1571 bytes
>I have a form with 2 table in relation father-child 1:N;
>I must in the same table filter the rowset for same fields of the father
>table and one field of the child table and the  query do need to be live
for
>modified it.
>I input the filter option in same entryfield object and then i apply the
>form.query1.rowset.filter=.... value of entryfiled
>
>How i can do for filter also a field of the child table?? Can i do the
>CanGetRow() function?? How i can use it??

You must apply the constraint using an independent instance of the child
query, e.g.:

this.ChildConstraint = new query()
with (this.ChildConstraint )
   sql = ........
endwith

with (this.ChildConstraint.rowset)
   indexName = "TAGNAME"
endif

function ConstraintQuery_OnOpen
   this.parent.ParentQuery.ConstraintRowset = this

function ParentRowset_CanGetRow
   return this.ConstraintRowset.findKey( <expression> )
____
Bowen Moursund (dBASE, Inc.)
bowen at nerds dot com
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads