Update of /var/cvs/applications/searchrelate/templates
In directory james.mmbase.org:/tmp/cvs-serv5787
Modified Files:
Searcher.js.jsp
Log Message:
searching after create was broken
See also: http://cvs.mmbase.org/viewcvs/applications/searchrelate/templates
Index: Searcher.js.jsp
===================================================================
RCS file: /var/cvs/applications/searchrelate/templates/Searcher.js.jsp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- Searcher.js.jsp 17 Apr 2008 20:57:58 -0000 1.10
+++ Searcher.js.jsp 21 Apr 2008 10:54:14 -0000 1.11
@@ -11,7 +11,7 @@
*
* @author Michiel Meeuwissen
- * @version $Id: Searcher.js.jsp,v 1.10 2008/04/17 20:57:58 andre Exp $
+ * @version $Id: Searcher.js.jsp,v 1.11 2008/04/21 10:54:14 michiel Exp $
*/
$(document).ready(function(){
@@ -26,7 +26,7 @@
*
*/
function MMBaseLogger(area) {
- this.logEnabled = false;
+ this.logEnabled = true;
/*this.traceEnabled = false;*/
this.logarea = area;
}
@@ -325,6 +325,8 @@
this.searchResults = {};
this.bindEvents();
this.validator = this.relater.validator;
+ this.searchUrl = $(this.div).find("form.searchform").attr("action");
+ this.logger.debug("found " + this.searchUrl);
}
@@ -344,8 +346,8 @@
* Feeded are 'id' 'offset' and 'search'.
* The actual query is supposed to be on the user's session, and will be
picked up in page.jspx.
*/
-MMBaseSearcher.prototype.search = function(el, offset) {
- var newSearch = $(el).find("input").val();
+MMBaseSearcher.prototype.search = function(form, offset) {
+ var newSearch = $(form).find("input").val();
if (newSearch != this.value) {
this.searchResults = {};
this.value = newSearch;
@@ -353,15 +355,13 @@
this.offset = offset;
var rep = this.getResultDiv();
- var url = $(el).attr("action");
-
- var params = {id: el.id, offset: offset, search: this.value, pagesize:
this.pagesize, maxpages: this.maxpages};
+ var params = {id: this.getQueryId(), offset: offset, search: this.value,
pagesize: this.pagesize, maxpages: this.maxpages};
var result = this.searchResults["" + offset];
$(rep).empty();
if (result == null) {
var self = this;
- $.ajax({url: url, type: "GET", dataType: "xml", data: params,
+ $.ajax({url: this.searchUrl, type: "GET", dataType: "xml", data: params,
complete: function(res, status){
if ( status == "success" || status == "notmodified" ) {
result = res.responseText;
@@ -486,9 +486,11 @@
this.logger.debug("binding to "+ $(this.div).find("a.navigate"));
$(this.div).find("a.navigate").click(function(ev) {
- self.logger.debug("navigating " );
var anchor = ev.target;
+ self.logger.debug("navigating " + anchor);
+
var id = anchor.href.substring(anchor.href.indexOf("#") + 1,
anchor.href.lastIndexOf("_"));
+ self.logger.debug("Found id " + id);
return self.search(document.getElementById(id), anchor.name);
});
}
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs