rediff ILAND
Welcome Guest, | Create your own iLand| Sign In  | New User? Get Started
BLOGS
iLand
Blogs
Friends/Contributors
Guestbook  
 
sanjeev pandey
Categories
Hobbies
Friends
Tibco GI
Favourites 1
purvi shah
What is an RSS feed?
RSS Feed 
urssanj00.rediffiland.com/
 
Saturday 11 October, 2008
By  sanjeev pandey   09:14 | 22/Feb/2008 |  0 Comment(s)
  Add sanjeev pandey as Friend     Write to sanjeev pandey     Forward this link
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.





Category: Tibco GI | Permalink