Page 2 of 2

PostPosted: Tue May 01, 2007 3:21 pm
by jcompagner
If it does what it sounds like, it'd be really nice if it could be enhanced by

Code:
databaseManager.getFoundSet(server, table, [query], [args])


That would really allow us to create foundset of whatever sort "in the dark"...


you can do this in 3.5:

var vs = databaseManager.getFoundSet(server, table).loadRecords(query, [args])

PostPosted: Tue May 01, 2007 7:34 pm
by patrick
That's very cool!! In the current beta this does not seem to work, however. Is that right or am I missing something? And: I understand right that you don't need a form based on that table at all, right?

PostPosted: Tue May 01, 2007 7:34 pm
by patrick
That's very cool!! In the current beta this does not seem to work, however. Is that right or am I missing something? And: I understand right that you don't need a form based on that table at all, right?

PostPosted: Sat May 05, 2007 6:57 am
by faheemhameed
Nice work. Thanks guys.

Now in the debug mode the codes past the showFormInDialog are not run until you close the formInDialog which is cool. But I could not debug any code while the formInDialog is on the top. I could not touch the method editor and other debug buttons there. Would be cool if this is fixes quickly.

Thanks

PostPosted: Mon May 07, 2007 11:14 am
by jcompagner
Patrick: that should already work in the latest beta of 3.5

faheemhameed: i will look at this. Maybe we maybe don't check this anymore because it is currently one of the other (so or you have a blocking dialog and can't debug it or you have a none blocking dialog and you can debug it)

PostPosted: Mon May 07, 2007 11:21 am
by patrick
Johan: no, at least I don't get it to work. I have a form that shows data and use this code:
Code: Select all
var fs = databaseManager.getFoundSet(controller.getServerName(), controller.getTableName())
var record = fs.getRecord(1)


in the debugger, fs looks empty (not null, but empty string). record evaluates to null.

As far as I understand, a form (and a controller) is not needed at all, right? At first I tried
Code: Select all
var fs = databaseManager.getFoundSet(myServer, myTable)


but that resulted in the same. But something useful seems to be going on, because when I do
Code: Select all
var fs = databaseManager.getFoundSet(controller.getTableName(), controller.getServerName())


fs is null.

PostPosted: Mon May 07, 2007 11:32 am
by jcompagner
patrick: i thought we talked that you could do loadRecords()
but looking at your code you don't do that

Code: Select all
var fs = databaseManager.getFoundSet(controller.getServerName(), controller.getTableName())
fs.loadAllRecords();
var record = fs.getRecord(1)


that works fine. You get a completely empty foundset you need to do find or loadRecords first before you can get records out of it.

PostPosted: Mon May 07, 2007 11:36 am
by patrick
Excellent! Thanks for clarification and it works like a charm! The only thing that doesn't seem to work is this

var fs = databaseManager.getFoundSet(controller.getServerName(), controller.getTableName()).loadAllRecords();

Great functionality!!

PostPosted: Mon May 07, 2007 11:46 am
by patrick
I played with this now:

var vQuery = ...
var fs = databaseManager.getFoundSet('myServer', 'myTable')
foundset.loadRecords(vQuery); // works form based
fs.loadRecords(vQuery); // does not work
fs.loadAllRecords(); // does work

PostPosted: Mon May 07, 2007 1:13 pm
by jcompagner
in the next beta this is fixed:

Code: Select all
var fs = databaseManager.getFoundSet(controller.getServerName(), controller.getTableName())
fs.loadRecords("select categories.categoryid from categories order by categories.categoryname");
var record = fs.getRecord(1)



faheemhameed: also the modal dialog debug behavior we have i 3.1 is back in 3.5. We will only be able to fix this completley for servoy 4.0

PostPosted: Mon May 07, 2007 1:22 pm
by faheemhameed
Thanks Johan. I can wait for this. This is not very critical for me now.

But could please.... help with the following issues (these are critical for me):

could not export solution
http://forum.servoy.com/viewtopic.php?t=8273&highlight=

connecting to multi developer repository
http://forum.servoy.com/viewtopic.php?t=8272&highlight=

Re: Servoy 3.5.5

PostPosted: Wed Aug 27, 2008 9:08 am
by amcgilly
Servoy 3.5.5 WinXP:

I create a foundset using

var fs - databaseManager.getFoundSet(...)
fs.loadAllRecords()

then I do this:

fs.setSelectedIndex(200)

I expect it to load the next 200 records into the foundset but it doesn't. I was expecting it to behave the same way as a controller-based foundset. Is there some reason it doesn't?

I note that if I do this:

fs.getRecord(200)

it DOES load in the next 200 records.