-
October 7th, 2008, 02:33 PM
#1
SubscriptionMode
can it be a issue in subscription mode? I'm using MERGE. all other three (RAW,DISTINCT and COMMAND says that they are not supported for item1
-
October 7th, 2008, 03:08 PM
#2
If i initially send(from javascript) all the names of items, it works without any prob(for the timebeing forget the username password word)
but if i try to add any item name that is not in the initial list, it is shown as undefined in the onitemupdate event(in js).. (i can dynamically remove items from the list, depending on the user)
is this relates to the listener.update in dataadapter?
public String[] getItems(String user, String id) throws ItemsException {
String group = "item1 "+ "item2 "+"item3 "+"item4 "+"item5 "+"item6";
return tokenize(group);
}
in my javascript
//var ngroup = ["item1","item2","item3","item4","item5","item6","i tem7"];
//this works fine and will subscribe only item1 to item6 and updates them correctly
var ngroup = ["items"];
var nvTable = new NonVisualTable(ngroup,nschema,"MERGE");
onItemUpdate
nvTable.onItemUpdate = function(itemIndex,update,itemName) {
alert(itemName);// this alerts "undefined" if i use ngroup = ["items"]
}
-
October 8th, 2008, 08:09 AM
#3
onitemupdate
it gives the correct itemIndex, but not the correct itemName . it seems that it generates the itemName from the group defined in the js, not from the metaadapter.
-
October 8th, 2008, 08:40 AM
#4
When you use a generic "group name" to be expanded into a list of item names by the Metadata Adapter, as in the generated item names are not communicated to the client library (see the onItemUpdate doc).
If you really need those names on your front-end, you can setup a new field to ask for them.
The client can still discriminate the items by their numeric "itemIndex".
About the subscription mode, note that they must obey some restrictions (see paragraph 3.1 in General Concepts.pdf).
However, you are free to configure the proper modes for your items, through the "modeMayBeAllowed" method of your Metadata Adapter.
You are probably still inheriting the configuration of the StockListDemo, which is made through the <item_family_...> elements in "adapters.xml", managed by the LiteralBasedProvider.
-
October 9th, 2008, 07:12 AM
#5
yes it works
-
October 9th, 2008, 12:31 PM
#6
get the list of subscribed items
any way, in this method is there any way to get the list of all the subscribed items initially.
or at least the number of items that is subscribed to that user?
To create the table correctly, i need the number of subscribed items in the web client. is it possible to catch it in the onStart() method in js or in some other method. Also can you please elaborate the use of setSnapshotRequried(true) onEngineCreation. I think i may use it. can you please elaborate?
-
October 10th, 2008, 10:38 AM
#7
This metainformation is not supplied, though your suggestion about onStart makes sense.
At the moment, you would need to setup a separate item to get this information.
The group names were introduced as shortcuts for known sets of items, like stock lists.
Note that, for unknown sets, the COMMAND mode is also available, though it covers the more generic case of dynamic sets and requires specific handling by the Data Adapter.
By issuing setSnapshotRequired(true), you ask for a preliminary update about the current state of the item (for each item in the table). The Server tries to send this update immediately.
The snapshot is covered in the "DOCS-SDKs/General Concepts.pdf" document, paragraph 3.4.1.
onEngineCreation allows you to perform Engine initialization (The Engine page connects to Lightstreamer Server on behalf of one or more Push-Pages). The Master Push-page, after creating the Engine through "createEngine", receives a call to the onEngineCreation callback, through which it can (and should) configure the Engine so that it can access the Server.
Details can be found in the online documentation, but the normal usage is best described by the provided sample pages.
Similar Threads
-
By abhijeetgk in forum Adapter SDKs
Replies: 1
Last Post: September 28th, 2011, 10:53 AM
-
By bartol82 in forum Adapter SDKs
Replies: 1
Last Post: August 30th, 2011, 10:15 AM
-
By Otake in forum Client SDKs
Replies: 5
Last Post: December 17th, 2009, 02:15 PM
-
By nagakumaran in forum Adapter SDKs
Replies: 6
Last Post: October 16th, 2007, 02:11 PM
-
By Mone in forum Client SDKs
Replies: 2
Last Post: May 7th, 2007, 02:59 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
All times are GMT +1. The time now is 01:06 PM.
Bookmarks