REST Documentation Question

Looking over the documentation I noticed something odd.

In both the ws_update and ws_create code there is a foundset.loadAllRecords(); at the end of the code.

function ws_create(data,version,pk)
{
	var rec = foundset.getRecord(foundset.newRecord());

	rec.name_first = data.name_first;
	rec.name_last = data.name_last;
	rec.email = data.email;
	rec.phone_cell = data.phone_cell;
	rec.company_id = data.company_id;
	databaseManager.saveData(rec);

	foundset.loadAllRecords();
}

The doing that important or necessary? Or is it just in there by mistake?

Hey James!
if you ask me, the real mistake is to use the rest plugin instead of Velocity ;)

ptalbot:
Hey James!
if you ask me, the real mistake is to use the rest plugin instead of Velocity ;)

+1 :-)

ptalbot:
Hey James!
if you ask me, the real mistake is to use the rest plugin instead of Velocity ;)

Well, I’m really just working on using Servoy Mobile as it is, so I don’t really have a lot to do with how the REST portion of it is implemented.

That being said, if you have a strategy for deploying Mobile Apps with a combination of Servoy, Velocity, and jQuery Mobile (or some other UI framework) I would love to read up on it.

Ah ah ah! I was picking on you! :)
For mobile, there’s no big strategy involved… just use whatever UI framework you like and are familiar with, then use Velocity/Servoy to build the kind of JSON required by that framework to serve data.

jgarfield:
Looking over the documentation I noticed something odd.

In both the ws_update and ws_create code there is a foundset.loadAllRecords(); at the end of the code.

function ws_create(data,version,pk)

{
var rec = foundset.getRecord(foundset.newRecord());

rec.name_first = data.name_first;
rec.name_last = data.name_last;
rec.email = data.email;
rec.phone_cell = data.phone_cell;
rec.company_id = data.company_id;
databaseManager.saveData(rec);

foundset.loadAllRecords();

}




The doing that important or necessary? Or is it just in there by mistake?

The loadAllRecords call is not really needed here.
You do have to keep in mind that the rest_ws plugin uses a pool of headless clients to serve the requests.
REST defines statelessness, so each request may not depend another one.
Make sure that something like the forms foundset state left over from previous request does not affect the next request.

Rob