|
|
|
|
| Saturday 11 October, 2008 |
|
|
|
|
|
|
|
|
|
|
|
| |
|
|
|
Tibco GI-Parse xml cache
Yesterday I was facing problem in loading the data in select/combo fetched from Webservices. Data fetched from webservices are stored in local cache file. Then I browsed the Tibco GI API and got some hints. Its very easy to do. Lets see step wise: 1. Get the xml document in srcDoc from cache- menu_xml.Data from webservices are loaded in cache in some local cache file. here menu_xml is used for example. var srcDoc = tibco.app.logic.SERVER.getCache().getDocument("menu_xml");
2. Convert the srcDoc in List of nodes. var recordNodes = srcDoc.getChildNodes(false);
3. Get the size of List recordNodes var recordSize = recordNodes.size();
4. Iterate the list, get the attributes and form the string to be loaded as XMLString in Drop down. var xmlString = ''; var recordNode; for (var i = 0; i < recordSize; i++) { recordNode = recordNodes.get(i); xmlString +=""; } xmlString += "";
5. Set the xmlString in combo.setXMLString(xmlString).
6. The drop down will get populated with value and options.
|
|
| | |
|
|
|
|
|
|
|