cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timur Izhbulatov <...@yxo.ru>
Subject [Flow] redirectTo() bug?
Date Fri, 10 Sep 2004 12:05:05 GMT
Hi! 

Calling the redirectTo(URL) function in my flowscript makes corrupted 
(escaped wrong) non-ASCII characters containing in the URL. If I use the 
sendPage(URL) everything works fine. 

The question is who does the URL escaping? 

It's definitely not the JavaScript's fault 'casue I can see the correct URL 
in a jx generated page (see the folwsript funciton bellow). 

 

Here's my function: 

function doSearch(form) {
   // Get the repeater
   var rules = form.lookupWidget("rules"); 

   var predicates = "";
   var attribute =  "";
   var operation =  "";
   var value =      "";
   var inverse =    "";
   var debugInfo =  new Array(); 

   form.showForm("test-display-pipeline");

   for(i = 0; i < rules.getSize(); i++) {
       attribute = rules.getWidget(i, "attribute").getValue()
       operation = rules.getWidget(i, "operation").getValue()
       value =     rules.getWidget(i, "value").getValue()
       inverse =   rules.getWidget(i, "inverse").getValue()

       // form an XPath predicate
       var predicate = "";
       if(operation.toString() == "=") {
           predicate = attribute + operation + "'" + value + "'";
       }
       if(operation.toString() == "contains") {
           predicate = operation + "(" + attribute + ",'" + value + "')";
       } 

       if(predicate.toString() != '') {
           if(inverse == "true") {
               debugInfo.push("*** if: inverse");
               predicate = "[not(" + predicate + ")]";
           } else {
               predicate = "[" + predicate + "]";
           } 

           predicates += predicate;
       }
   } 

   var URL = "show-data/?xpath=//Client" + predicates;
   debugInfo.push("URL: " + URL); 

//    cocoon.sendPage("test-pipeline", {"list":debugInfo}); //works fine
//    cocoon.sendPage(URL); //works fine
   cocoon.redirectTo(URL); // here the problem appears
   return;
} 

Timur 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message