im using LCDS 2.6, I have auto-sync-enabled=false and im using
manualsync. I've read, deleteItem() should be handled automaticaly
and seems deleteItem is working fine. But when i use createItem(),
seems that data are routed to clients but item isn't added to fill.
I have no clue where is problem..
Recieved message on the client:
(mx.data.messages.DataMessage)
messageId = '9C930053-171A-20A2-5176-F0C710C33445'
operation = update collection
destination = wallVO
identity = (null)
body = [
mx.data::UpdateCollectionRange {
identities = ["E2036A8A-8132-1662-7F09-F0B4D538B3FE"]
position = 2
size = 0
updateType = 0
}
]
headers = {
DSSubtopic = mx.collections::ArrayCollection {
filterFunction = null
length = 1
list = mx.collections::ArrayList {
length = 1
source = ["wall.edit.30886704"]
uid = "E8852CB3-3208-26A5-5812-F0C7144D0302"
}
sort = null
source = #0
}
}
on the client i have:
public function getWallMessages
(collection:ArrayCollection,vo:UserProfileVO):void{
service.manualSync.consumerSubscriptions.removeAll();
var subtopic:String = "wall.edit."+vo.id.toString();
service.manualSync.consumerAddSubscription(subtopic);
service.manualSync.consumerSubscribe();
var token:AsyncToken = service.fill(collection, "user", vo);
token.addResponder(this.responder);
}
public function createWallMessage(vo:WallVO):void{
service.manualSync.producerSubtopics.removeAll();
var subtopic:String = "wall.edit."+vo.profile.id.toString();
service.manualSync.producerSubtopics.addItem(subtopic);
var token:AsyncToken = service.createItem(vo);
token.addResponder(this.responder);
service.commit();
}
public function deleteWallMessage(vo:WallVO):void
{
service.manualSync.producerSubtopics.removeAll();
var subtopic:String = "wall.edit."+vo.profile.id.toString();
service.manualSync.producerSubtopics.addItem(subtopic);
var token:AsyncToken = service.deleteItem(vo);
token.addResponder(this.responder);
service.commit();
}
assembler's code;
public class WallAssembler extends AbstractAssembler {
...
public Collection fill(List fillParameters)
{
String queryName = (String) fillParameters.get(0);
if (queryName.equals("user")){
int userID = ((UserProfileVO) fillParameters.get(1)).getId();
return dao.getProfileWall(userID);
}
return super.fill(fillParameters); // throws a nice error
}
public void createItem(Object newItem)
{
DataServiceTransaction dtx =
DataServiceTransaction.getCurrentDataServiceTransaction();
WallVO vo = dao.addWallMessage((WallVO) newItem);
dtx.createItem("wallVO", vo);
dtx.commit();
}
}
Thanks