Json WS Second, 3rd level List view consumption..Please Help
Hi I am trying to display a Dynamically generated List View upto 3 levels where 3 levels of list view would call 3 different Json webservices.
I was able to generate fist level of Listview by consuming Json but i am not able to(or I dont know how to call the next two webservices as we navigate by clicking on the first level dynamically generated List views Items...By a filter as parameter.
here is theJson for now it has only one returned value but will have more.....(this is returned by passing a parameter called AND to this Json webservices from first level ListView list item code below(first level list view is also generated from Json consumption)
2nd Json return value (passing parameter of Android from first level-sell code below on list views first level)
{"getFolderResult":[{"FolderName":"and-031812"}]}
Second Jaon returned value (onpassing th pameter "and-031812" on click of the List item created from above Json
Second Json
{"getFolderResult":[{"FolderName":"and45"}]}
As Said please let me know how do I generate the next two levels of list views and call each seperate Json webservices.
Here is the code which i have used to create first level List view created fron Json.
- <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Single page template</title>
<link href="css/jquery.mobile-1.2.0.css" rel="stylesheet" type="text/css" />
<script src="js/jquery-1.7.1.min.js" type="text/javascript"></script>
<script src="js/jqm-docs.js" type="text/javascript"></script>
<script src="js/jquery.mobile-1.2.0.js" type="text/javascript"></script>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
<script src="AppstoreWS1.js"></script>
</head>
<body>
<div data-role="page" id="LatestBuilds">
<div data-role="header">
<h1>Page Title</h1>
</div><!-- /header -->
<div data-role="content">
<ul data-role="listview" data-inset="true" id="categoryList">
</ul>
</div><!-- /content -->
<div data-role="footer">
<h4>Page Footer</h4>
</div><!-- /footer -->
</div><!-- /page -->
</body>
</html>
- JS File
- $(document).ready(function () {
$.ajax("AppstoreWS.svc/getPlatforms", {
beforeSend: function (xhr) {
$.mobile.showPageLoadingMsg();
},
complete: function () {
$.mobile.hidePageLoadingMsg();
},
contentType: 'application/json',
dataType: 'json',
type: 'POST',
error: function () {
alert('Something awful happened');
},
success: function (data) {
var result = data.getPlatformsResult;
$.each(result, function (index, output) {
$('#categoryList').append('<li> <a href=Index2.html?Platform=' + output.FolderName + '>' + output.FolderName + ' </a></li>');
});
$('#categoryList').listview('refresh');
}
});
});