Index: /MDService2/trunk/MDService2/WebContent/scripts/mdservice_model.js
===================================================================
--- /MDService2/trunk/MDService2/WebContent/scripts/mdservice_model.js	(revision 1485)
+++ /MDService2/trunk/MDService2/WebContent/scripts/mdservice_model.js	(revision 1486)
@@ -241,12 +241,31 @@
 	
 	
-	var res = $(this.queryobject.container).find('.result').html("");
+	var res = $(this.queryobject.container).find('.result').append(data);//html("");
 	//res.append('<ul></ul>');
+	/*
 	$.each(data.hits,function(){
 		//$(res.children('ul')[res.length]).append('<li>'+this+'</li>');
 		res.append(this);
 	});
-	
-	if (data.activeclients == 0){
+	*/	
+	
+	var result_header = $(res).children('.result-header');
+	
+	var q_header;
+	q_header = $(res).parent().find('.query_header');
+	q_header.children('.result-header').remove();
+	
+	q_header.append(result_header);				
+ 	addDetailFunctionality(q_header, this);
+ 	
+ 	
+	if (Number( $(data).find(".activeclients").text() ) == 0) {
+	//if (data.activeclients == 0){
+		// update link-hrefs
+		var qid = $(res).closest('.query_wrapper').attr("id");
+		//notifyUser("result-loaded ID:" + qid,'debug');
+		
+		var q = queryset.getQuery(qid);
+		$('#' + qid ).find(".cmd_link").attr("href", q.link("fullpage"));
 		notifyUser("result-loaded",'debug');
 		
@@ -810,5 +829,5 @@
 	 	
 	 	var reptype = workspace.getRepositoryType(this.repository);
-	 	/*
+	 	
 	 	if (reptype=="pazpar"){
 	 		//pazpar handling this
@@ -816,5 +835,5 @@
 	 		return;
 	 	}
-	 	*/
+	 	
 	 	if (reptype=="md" ){
 			uri = link('recordset',this.format, this.query_uri());
@@ -824,10 +843,10 @@
 	 		} else {
 	 			
-	 			if (reptype=="pazpar"){
-		 			uri = link('pazpar', this.format, this.query_uri());
-		 		} else {
+	 			//if (reptype=="pazpar"){
+		 		//	uri = link('pazpar', this.format, this.query_uri());
+		 		//} else {
 		 		
 		 			return;
-		 		}
+		 		//}
 	 		}
 	 	}
Index: /MDService2/trunk/MDService2/WebContent/scripts/mdservice_pz2.js
===================================================================
--- /MDService2/trunk/MDService2/WebContent/scripts/mdservice_pz2.js	(revision 1485)
+++ /MDService2/trunk/MDService2/WebContent/scripts/mdservice_pz2.js	(revision 1486)
@@ -311,9 +311,10 @@
         $.get("/MDService2/pazpar2/" + this.format + "/" + params,
             function(data) {
-                if (  $(data).find("status")[0].textContent == "OK"  ) {
+                if (  $(data).find(".status").text() == "OK"  ) {
                     // first parse the status data send along with records
                     // this is strictly bound to the format
-                    var activeClients = Number( $(data).find("activeclients")[0].textContent );
+                    var activeClients = Number( $(data).find(".activeclients").text() );
                     context.activeClients = activeClients; 
+                    /*
                     var show = {
                         "activeclients": activeClients,
@@ -326,6 +327,7 @@
                         "num": 
                             Number( $(data).find("num")[0].textContent ),
-                        "hits": $(data).find("hit")//[]
+                        "hits": $(data)//.find("hit")//[]
                     };
+                    */
                     // parse all the first-level nodes for all <hit> tags
                     //var hits = $(data).find("hit");
@@ -344,6 +346,6 @@
                             delay);
                     }
-                    global_show = show;
-                    context.showCallback(show);
+                    global_show = $(data);//show;
+                    context.showCallback($(data));
                 }
                 else
Index: /MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/Pz2ProxyAction.java
===================================================================
--- /MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/Pz2ProxyAction.java	(revision 1485)
+++ /MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/Pz2ProxyAction.java	(revision 1486)
@@ -204,8 +204,10 @@
 		setBlock("1");
 		while (Integer.parseInt(activeclients) > 0){
-			activeclients = getDocumentData(this.getSourceStream(), "//show/activeclients");
+			//activeclients = getDocumentData(this.getSourceStream(), "//show/activeclients");
 			is = this.getSourceStream();
+			activeclients = getDocumentData(is, "//show/activeclients");
 			
 		}
+		is = this.getSourceStream();
 		return is;
 	}
