Page 1 of 1

link first database item to a other items in the second database

Posted: Mon Feb 02, 2015 4:39 am
by Yu Niu

I searched a lot of topics and try the tutorial on the post, but still cannot fix it.
My problem is I list items from first database, when I click on the item, it should list items with the same tagID in the second database.
I declare the LSV and pass it the request, but it displaies all the items with different tagID. I tried one week already. Could anyone help me to fix it?


link first database item to a other items in the second database

Posted: Mon Feb 02, 2015 7:22 am
by Evgene Karachevtsev

Hello!

Could you please provide us with more details:
1) both DB structures of collections you are trying to list
2) how you save value in LSV
3) how you use LSV


link first database item to a other items in the second database

Posted: Mon Feb 02, 2015 2:41 pm
by Yu Niu

1)only one database, two collections,
1st collection, list_1: _id, name, tagID,acl
2nd collection, list_2: _id, meaning, picture, sound, tagID, ID, acl
2)I created a LSV which named tagID and set a click event action is set local storage and binding with tagID of list_1
3) I created a database service for page 2 and add a query(tagID) in request database service then did two mapping. First is before event, I mapped LSV to query, second is success event, I mapped list_2 information to item on the page


link first database item to a other items in the second database

Posted: Wed Feb 04, 2015 12:16 am
by Yurii Orishchuk

Hello,

It seems you have problem with 2nd step.

Please show us how you set "tagID" lsv(storage) with "click" event handler sceenshot.

Also in 3rd step you should link in "before send" mapping "tagID" LSV(storage) to "where" request parameter. And use following JS code:

pre

var whereObject = {"tagID": value};

return JSON.stringify(whereObject);

/pre

Regards.


link first database item to a other items in the second database

Posted: Wed Feb 04, 2015 1:44 am
by Yu Niu

Thanks you very much! I fixed the second step, put the code into JS and it works.