If you want to know what all variables are present on a particular webpage, you can run the following code to find all the available variables.
If you want to know what are columns and values present in an IList
Disclaimer: Any sample code on this blog is not officially recommended, use at your own risk.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
Enumeration e = ics.GetVars(); | |
while ( e.hasMoreElements() ) | |
{ | |
String varName = (String)e.nextElement(); | |
String varValue = ics.GetVar(varName); | |
out.println("Name: "+varName +" & Value:"+ varValue +"<br/>"); | |
} | |
%> |
If you want to know what are columns and values present in an IList
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
StringBuffer iListTable= new StringBuffer(); | |
IList tmp = ics.GetList("listname"); | |
if (tmp!=null && tmp.hasData()){ | |
int cols = tmp.numColumns(); | |
iListTable.append("<table>"); | |
//Column Names | |
for (int x = 0;x<cols;x++){ | |
iListTable.append("<th>"+tmp.getColumnName(x)+"</th>"); | |
} | |
iListTable.append("<tr>"); | |
//Column Values | |
do { | |
for (int y = 0;y<cols;y++){ | |
iListTable.append("<td>"+ tmp.getValue(tmp.getColumnName(y)) +"</td>"); | |
} | |
} | |
while(tmp.moveToRow(IList.next, 0)); | |
} | |
iListTable.append("</table>"); | |
out.print(iListTable.toString()); | |
%> |
No comments:
Post a Comment