Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Bi-Dimensional string array - Routine output to tJavaRow

Hello,

I'm facing an issue passign a multi dimensionall array from routine output to tJavaRow.

Scenario:

  • I've defined a routin with bi-dimensional string :

 

public static  String [][] post_text_login

 

  • In my routine I've several "for" nested cycles, setting array values on specific step:
for(int i=0;i<posts.size();i++)
        {
        	post_text[i] = posts.get(i).getElementsByClass("xxxt").text();
        	post_photo[i] = posts.get(i).getElementsByClass("_5dec _xcx").attr("data-ploi");
        	post_DT[i] = posts.get(i).getElementsByTag("abbr").attr("data-utime");
        };
        for(int j=0;j<posts.size();j++)
        {
        	ret_link[j][0]= post_text[j];
        	ret_link[j][1]= post_photo[j];
        	ret_link[j][2]= post_DT[j];
}
        
  • when I call the routine from the tJavaRow, loops are not working:
String [][]s =WebDriver_Selenium_3_8_1.post_text_login(x,x,x)

for(int i=0; i<10; i++) {
row14.post_text = s[i][0];
            row14.post_photo = s[i][1];
            row14.post_DT = s[i][2];
            row14.id_post = s[i][0];
 }

0683p000009Lt7S.jpg

 

How can I iterate trought the bi-dimensional array and cycle to rows?

 

Thank you

 

 

Labels (3)
2 Replies
Anonymous
Not applicable
Author

You to use the tJavaFlex for this. The Start Code section would have this code in it....

String [][]s =WebDriver_Selenium_3_8_1.post_text_login(x,x,x)

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

....... the Main Code would have this code in it......

row14.post_text = s[i][0];
row14.post_photo = s[i][1];
row14.post_DT = s[i][2];
row14.id_post = s[i][0];

...... and the End Code would have this code in it....

}

.....yes, you just close the loop here.

You cannot generate rows from a tJavaRow, it just processes each row passed to it. To generate rows the only Java component to use is the tJavaFlex.
Anonymous
Not applicable
Author

Hello,

thx for the tip.

I still have issue understandign how to pass variable from previous componet to tJavaFlex:

 

0683p000009Lt2S.jpg

This it the code in the start part of tJavaFlex:

String [][]s =WebDriver_Selenium_3_8_1.post_text_login(XXX,YYY,row12.line);

row12.line is always null.

Thx