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

Incremantal components in Design Studio script

$
0
0

I am trying to increment the name of a component, similar to what we can do in JAVA when using a for statement.

 

Assuming that I have components called Tile_1, Tile_2, Tile_3,...., Tile_10.

 

Java:

for( int i=0; i<12 ; i++){

     Tile_[i] = "Test component";    //assigns text to each component 1,2,3...10.

     System.out.print(Tile_[i]);       //prints the text.

}

 

 

In Design Studio scripting I would have to do something like this.

 

Design Studio:

var tile_iconSTR = DS_2.getMembers("_abc123",1);

tile_iconSTR.forEach(function(element, index) {

     var i = 0;

     if(i == 1){

         var Icon1 = "../ref/"+element.text+"-icon.png";

         TILE_1_IMAGE.setImage(Icon1);

         i = i+1;

     }else if(i == 2){

         var Icon2 = "../ref/"+element.text+"-icon.png";

         TILE_2_IMAGE.setImage(Icon2);

         i = i+1;

     }else ....... all the way to 10

});

 

 

Does anyone have any ideas on how to get around that long IF ELSE statement?


Viewing all articles
Browse latest Browse all 4216

Trending Articles



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