| Geoff Wass [dBVIPS] 2007-11-16, 1:29 pm |
| In article <tpkIY9JHIHA.1084@news-server>, bb@magenta-netlogic.com
says...
> Geoff
>
> I think I have misled you with the entryfield.
> The hardcoded range was deliberate for simple illustration, the point is that the range is not implemented when the form is opened.
> I would have expected the rowset_setrange function to be called automatically when the form is opened, otherwise what is the point of the rowset having that method.
> Is it a bug, perhaps?
>
> Regards
>
> Brian
Brian,
Is this what you mean?
--
Geoff Wass [dBVIPS]
Montréal, Québec, Canada
..|.|.| dBASE info at http://geocities.com/geoff_wass |.|.|.
..|.|.| ---------------------------------------------------------- |.|.|.
..|.|.| IT Consultant http://Geoff_Wass.com |.|.|.
** END HEADER -- do not remove this line
//
// Generated on 31/10/2007
//
parameter bModal
local f
f = new test2Form()
if (bModal)
f.mdi = false // ensure not MDI
f.readModal()
else
f.open()
endif
class test2Form of FORM
with (this)
onOpen = class::FORM_ONOPEN
height = 16
left = 43.4286
top = 1.5909
width = 40
text = ""
endwith
this.db = new database( "DBASESAMPLES" )
this.FISH1 = new QUERY()
this.FISH1.parent = this
with (this.FISH1)
database = form.db
left = 32
top = 13.5
sql = 'select * from "Fish.dbf"'
active = true
endwith
with (this.FISH1.rowset)
setRange = class::rowset_setRange
indexName = "ID"
endwith
this.GRID1 = new GRID(this)
with (this.GRID1)
dataLink = form.fish1.rowset
height = 10
left = 6
top = 1
width = 31
endwith
this.PUSHBUTTON1 = new PUSHBUTTON(this)
with (this.PUSHBUTTON1)
onClick = class::PUSHBUTTON1_ONCLICK
height = 1
left = 6
top = 13
width = 13
text = "Set Range"
endwith
this.ENTRYFIELD1 = new ENTRYFIELD(this)
with (this.ENTRYFIELD1)
height = 1
left = 6
top = 11.5
width = 24
value = 0 // the rowset index is a number so this should be, too
endwith
this.PUSHBUTTON2 = new PUSHBUTTON(this)
with (this.PUSHBUTTON2)
onClick = class::PUSHBUTTON2_ONCLICK
height = 1
left = 6
top = 14.5
width = 13
text = "Clear Range"
endwith
this.rowset = this.fish1.rowset
function PUSHBUTTON1_onClick
form.fish1.rowset.setrange(form.entryfield1.value)
return
function PUSHBUTTON2_onClick
form.fish1.rowset.clearrange()
return
function form_onOpen
// you have assigned the overridden setRange(). Now, let's use it...
form.fish1.rowset.setRange( )
form.grid1.refresh()
return
function rowset_setRange
return ROWSET::setRange( 2, 5 )
endclass
|