Hi there,
I am able to store the ROWID for next set of Records to Batch and get those records. How ever, on the client it does not keep the old records i.e. I want to append to the old records. How would I append to the existing dataset on the client?
e.g:
First Read of the dataset I get records 1 and 2 and send that to the client for display. Then I get my next batch of records,3 and 4. When I send this to the client, it only displays 3 and 4. I want it to display records 1,2,3 and 4.
This is quite an urgent post. Does anyone have any information on this for me. Am I doing this the correct way in mobile or is there another way of doing batching?
Thanks in advance.
If it is with OE, please check the sample I've provided you that does batching.
The batching on that sample is a set of records at each request and allows you to navigate back and forward. The sample I've shared with you has the code on the OE backend and supporting javascript for the frontend.
I've never done an Incremental batch, but if I was to write one, I would try this approach (might not work):
- I would study this https://community.progress.com/community_groups/mobile/f/17/t/8529.aspx to see how to consume data services using JavaScript and the JSDO apis
- I would try to instantiate my own trigger for the AfterFill to append the data to my list using JavaScript (instead of having it visually mapped to the list)
Hopefully someone has done it in the past and would save you the research time! Good luck!
Ricardo
Meyrick Flanegan |
Developer - Managed Services |
Email: mflanegan@elcb.co.za |
|
ELCB Information Services (Pty) Ltd |
Customer Service Email elcb@elcb.co.za · www.elcb.co.za |
E A S T L O N D O N Tel: +27(43) 704 0700 Fax: +27(43) 704 0701 |
J O H A N N E S B U R G Tel: +27(11) 879 6179 Fax: +27(11) 454 0384 |
P O R T E L I Z A B E T H Tel: +27(41) 373 0529 Fax: +27(86) 650 0135 |
If it is with OE, please check the sample I've provided you that does batching.
The batching on that sample is a set of records at each request and allows you to navigate back and forward. The sample I've shared with you has the code on the OE backend and supporting javascript for the frontend.
I've never done an Incremental batch, but if I was to write one, I would try this approach (might not work):
- I would study this https://community.progress.com/community_groups/mobile/f/17/t/8529.aspx to see how to consume data services using JavaScript and the JSDO apis
- I would try to instantiate my own trigger for the AfterFill to append the data to my list using JavaScript (instead of having it visually mapped to the list)
Hopefully someone has done it in the past and would save you the research time! Good luck!
Ricardo
Flag this post as spam/abuse.
Hi Ricardo,
we have tried using that code from the link in a button on a click event. it bombs out when we assign the jsdo variable.
any ideas why?
ok got past that. please ignore.
Hello Meyrick,
I just wanted to give you a couple of quick tips.
You can use the "JSON Filter Pattern" as a way to do batching.
You specify "top" to indicate the number of records to return and "skip" to indicate the page.
The following article in the wiki provides some information and points to a sample Business Entity:
community.progress.com/.../2279.business-entities-using-the-json-filter-pattern-code-samples.aspx
If you want to add to an existing set of records in the JSDO memory, you could use an INVOKE operation.
The backend code for the invoke method could also use the JSON Filter Pattern.
Then you would use the addRecords() API in the JSDO to add the records to the JSDO memory.
I hope this helps.
How do we access the JSDO memory using javascript? we getting totally confused with this whole thing.
Hello,
You can access the JSDO memory using JavaScript by getting a reference to the JSDO from the JSDO Service.
Example:
MobilityDemoService_dsCustomer_JSDO.jsdo.sort(["CustNum"]);
I hope this help.
Meyrick Flanegan |
Developer - Managed Services |
Email: mflanegan@elcb.co.za |
|
ELCB Information Services (Pty) Ltd |
Customer Service Email elcb@elcb.co.za · www.elcb.co.za |
E A S T L O N D O N Tel: +27(43) 704 0700 Fax: +27(43) 704 0701 |
J O H A N N E S B U R G Tel: +27(11) 879 6179 Fax: +27(11) 454 0384 |
P O R T E L I Z A B E T H Tel: +27(41) 373 0529 Fax: +27(86) 650 0135 |
Hello,
You can access the JSDO memory using JavaScript by getting a reference to the JSDO from the JSDO Service.
Example:
MobilityDemoService_dsCustomer_JSDO.jsdo.sort(["CustNum"]);
I hope this help.
Flag this post as spam/abuse.
Hello Meyrick,
You just need to call the READ Service in the same way as already do to show the records on the grid control.
The READ Service has a request parameter called "readLocal".
When readLocal is not specified or "false", the records are from the server.
When readLocal is "true", the records are read from the JSDO memory.
To set the "readLocal" parameter, you can either map the "readLocal" parameter to a localStorage variable and change the value to "true" or "false" as needed.
Alternatively, you can just create another usage of the READ Service and specify "false" for "readLocal" directly in the Request tab.
I hope this helps.
Meyrick Flanegan |
Developer - Managed Services |
Email: mflanegan@elcb.co.za |
|
ELCB Information Services (Pty) Ltd |
Customer Service Email elcb@elcb.co.za · www.elcb.co.za |
E A S T L O N D O N Tel: +27(43) 704 0700 Fax: +27(43) 704 0701 |
J O H A N N E S B U R G Tel: +27(11) 879 6179 Fax: +27(11) 454 0384 |
P O R T E L I Z A B E T H Tel: +27(41) 373 0529 Fax: +27(86) 650 0135 |
Hello Meyrick,
You just need to call the READ Service in the same way as already do to show the records on the grid control.
The READ Service has a request parameter called "readLocal".
When readLocal is not specified or "false", the records are from the server.
When readLocal is "true", the records are read from the JSDO memory.
To set the "readLocal" parameter, you can either map the "readLocal" parameter to a localStorage variable and change the value to "true" or "false" as needed.
Alternatively, you can just create another usage of the READ Service and specify "false" for "readLocal" directly in the Request tab.
I hope this helps.
Flag this post as spam/abuse.