hi,
I have developed a new function, initFilter, in Context.js. It's a simple
function to set wmc:Literal value, in wmc:Filter, with parameter passed by
URL.  

For example:

--- WMC : tasmania.xml ----

<Layer>
....
<SLD>
    ...
       <Filter>
              ...
                <PropertyIsEqualTo>
                        <PropertyName>
                                TYPE
                          </PropertyName>
                <Literal id="type"></Literal>  // the id attribute determine 
url parameter
name
                </PropertyIsEqualTo>
                 <PropertyIsEqualTo>
                        <PropertyName>
                                LENGTH
                          </PropertyName>
                <Literal id="length"></Literal>  // the id attribute determine 
url
parameter name
                </PropertyIsEqualTo>
             ...
       </Filter>
   ...
</SLD>
...
</Layer>

--------- end WMC ------
-------- Context.js ------
...
//my function
 this.initFilter=function(objRef) {
    // Set wmc:Filter of context from URL CGI params
    
    if(window.cgiArgs["filter"]){
    var filter=window.cgiArgs["filter"].split(',');   
    
    var basicXpath='//wmc:[EMAIL PROTECTED]"value"]';
    var re="value";
    
    for(var i=0;i<filter.length;i++){
        var keyValue = filter[i].split(':');
        
        var currentXpath=basicXpath.replace(re,keyValue[0]);
        
        objRef.setXpathValue(objRef,currentXpath,keyValue[1],true);
    }
    
   }
        
  }
  this.addListener( "loadModel", this.initFilter, this );
...
-------- end Context.js-----
In this example, I can change value at '<Literal id="type"></Literal>'
passing "../index.html?filter=type:newTypeValue,length:newLengthValue" in
URL.

THE PROBLEM:
This function executes correctly in Mapbuilder 1.0.1 but it don't work in
Mapbuilder 1.5 .
Why?


-- 
View this message in context: 
http://www.nabble.com/new-Context-with-initFilter%28%29-function-to-initialize-filter-in-WMC-tp14716460p14716460.html
Sent from the MapBuilder Devel mailing list archive at Nabble.com.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
mapbuilder-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mapbuilder-devel

Reply via email to