PDA

View Full Version : Preffered way to access data in a javascript section for web/mobile



hmischel@diligentsystems.com
2015-12-11, 15:27
Hi,

This doesn't seem to be working for me.


db = Lianja.openDatabase("southwind");
rs = db.openRecordSet("example");
var mytable = Lianja.getCursor("example");
var lastname = mytable.getData("LAST_NAME");

Is there a different way I am suppose to use data in a javascript section for web and mobile?

Thanks.

Herb

barrymavin
2015-12-11, 21:36
There is a cursor maintained internally for each table bound to a section which you can reference using Lianja.getCursor().

If you are hand coding data access and not using data binding (which does all this for you) operate on the recordset that is returned from openRecordSet() through its methods.

You can't mix cursor objects and record set objects. They are two completely different things.

tekhong
2015-12-11, 22:53
Hi Barry

Do you mean cursors refers to the tables bound to the sections of current page?
So we should only use Recordset object to get /update data for tables not bound to the page sections?

Your advice is much appreciated

Thanks & Best Regards

barrymavin
2015-12-12, 23:21
Hi Tek Hong,

Yes.

However, I would write a server-side business proc if I wanted to hand code CRUD operations for non UI bound data or a multi table transaction such as a debit/credit operation. I would not do this on the client.

Most modern apps use data binding. If they don't you need to have a good reason for wasting time and effort doing something which is already done for you.

hmischel@diligentsystems.com
2015-12-13, 00:07
Hi Barry,

Data Binding makes a lot of sense.

I see how to data bind a form section, but I cant seem to find a way to bind a custom section.

can you please explain how do that?

Thanks.

Herb

hmischel@diligentsystems.com
2015-12-13, 00:23
My apologies - I think I misunderstood.

Data binding is on the standard UI sections, not the custom sections - which is fine, I just didn't understand that.

Herb