Quantcast
Channel: SCN : All Content - SAP BusinessObjects Design Studio
Viewing all articles
Browse latest Browse all 4216

Use getter/setter in component.js

$
0
0

Hi,

 

I'm new to the Design Studio SDK and this is probably a pretty easy one...

 

I would like to change an object, that is exposed to Design Studio inside a function in component.js.

 

Snippet from contribution.xml

<property type="String" title="WebserviceURL" id="wsurl" group="Webservice"></property>

 

Snippet from contribution.ztl:

 

/* Returns the current WebserviceURL for Webservice. */
String getWsurl() {*
return this.wsurl;
*}

 

 

/* Sets the WebserviceURL for Webservice. */
void setWsurl(/* New Wsurl */ String newWsurl) {*
this.wsurl = newWsurl;
*}

 

Snippet from Component.js

 

this.wsurl = function(value) {
if (value === undefined) {
} else {
_wsurl= value;
return this;
}
};

 

also in Component.js is a function, that i can run from Design Studio using michaels hack to execute functions from Design Studio.

 

      function processSuccess(data, status, req) {

          if (status == "success")

         

         var xml = req.responseText;

          this.wsurl = $(xml).find("Success").text(); // this doesn't work!

          alert( $(xml).find("Success").text()); // this works!

 

      }

 

In SAP Design Studio I would expect to see the content of var xml, when I use the getter (getwsurl). But that doesn't work.

 

So how can I access and change the wsurl from inside a function in component.js?

 

Thanks in advance.

 

Frederic


Viewing all articles
Browse latest Browse all 4216

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>