Highlighted
Super Contributor.. Super Contributor..
Super Contributor..
408 views

display array of array in table control

Hi,

I had a requirement to display the follwoing data in a table, do like to seek advice how to display it in a table.

I had try putting $temp1,1 at the input of the table control but got error for it

vars.$temp1 = new array();

vars.$temp2 = ["abc","efg","hij"];
vars.$temp3 = ["hah","lol","ttt"];

vars.$temp1.push(vars.$temp2);
vars.$temp1.push(vars.$temp3);

trying to get some thing like below

----------------
| abc | efg | hij |

| hah | lol  | ttt |

 

Regards
Soong
0 Likes
3 Replies
Highlighted
Outstanding Contributor.. Outstanding Contributor..
Outstanding Contributor..

Re: display array of array in table control

Two points:

1: Your arrays are not going to display horizontally in a table - they will display vertically, like so:

| aaa | bbb |
| aab | bbc |
| aac | bbd |
| aad | bbe |

If you absolutely need them to display horizontally, you'll need to do extra manipulation when you calculate them, so that their values get distributed in such a way that they display the way you want.

2: Since it looks like you have a place/time in your logic flow to do this calculation, why not simply make two separate arrays? Populate $array1 with what you want in the left column and $array2 with what you want in the right column, and then put those variables in the input of the column itself, not the table.

0 Likes
Highlighted
Super Contributor.. Super Contributor..
Super Contributor..

Re: display array of array in table control

Hi AChandler,

Thanks for the response, actually I had about 6 column of data to be display. 

I'm actually using this in a wizard, which function is to create multiple new request ticket, and the table which I'm trying to show here is actually a summary page after the wizard create the ticket. with information like:  open time, ticket id, catgory, requestor name, success/fail,logical name.

what happen in the wizards action script, is that after the script run to create the ticekt, I will push the infromation into an array.

So base on your advice does it mean I should create 6 array and when pushing data, I need to ensure that each push is push to the right index? 

open time | ticket id | category | requestor | successs/fail  | device
01/01/01   | RF123     | software | falcon       | successful      | network

 

 

Regards
Soong
0 Likes
Highlighted
Outstanding Contributor.. Outstanding Contributor..
Outstanding Contributor..

Re: display array of array in table control

Yes, I would say you should create six arrays and populate them accordingly so that the correct field values will show on a table row for each ticket properly.

Alternatively, couldn't you have the wizard, after creating these new tickets, send the user to an actual record list of them? That is, don't go to the trouble of populating and displaying these arrays - simply have the wizard end by displaying the tickets themselves.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.