Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     load dropdown dynamically using javascript

Read-Only Read-Only Topic
Go
Search
Notify
Tools
load dropdown dynamically using javascript
 Login/Join
 
Master
posted
Hi,

I am trying to populate the dropdown using javascript when I click the button. I tried the following code but no luck.

if (myXmlRoot || loadXmlDoc())
{
var pattern="//input_controls/input_control[@id='" + fldname + "']/link[@persistentuniqueid='" + linkid + "']/condition/data_info";
alert("Myxmlroot : "+ myXmlRoot);
alert("Pattern : " + pattern);
var requestNode = getSingleNode(myXmlRoot, pattern);
alert("RequestNode : " + requestNode);
if (requestNode)
{
alert("inside if");
requestNode.setAttribute("datasource", ibif_ex);
requestNode.setAttribute("IBIMR_folder", ibimr_folder);
requestNode.setAttribute("displayfield",fldname1);
requestNode.setAttribute("datafield",fldname2);
}
}


Anybody did this. I searched in forum but found most of the posts related to chaining.

Any help in this issue would be appreciated.


WFConsultant

WF 8105M on Win7/Tomcat
 
Posts: 780 | Location: Florida | Registered: January 09, 2005Report This Post
Silver Member
posted Hide Post
I have used the following method to populate a changing dropdown list into a HTML page created via HTML Composer.


  • Create an iframe - iframe1
  • Create a javascript function:
    function populateDDList() {
      var randomNum=Math.random();
      window.iframe1.location.href='/ibi_apps/WFServlet?IBIF_ex=lookup_DD.fex&random='+randomNum;
    }
    

    Note: In this example, the fex is not in the MRE. Just adjust the href to point to MRE domain, if the fex is in MRE.

  • The focexe (lookup_DD.fex) that generates the options
    -* Prepare the dropdown list 
    DEFINE FILE xxxxxx
    CNT/I11=LAST CNT + 1;
    CNT_ALPHA/A11=TRIM('L', EDIT(CNT), 11, '0', 1, 'A11');
    OPTIONS/A300='DDList.options['||CNT_ALPHA||'] = new Option('''||fieldname||''','''||fieldname||''');';
    END
    TABLE FILE xxxxxx
    PRINT
    OPTIONS
    BY  fieldname NOPRINT
    ON TABLE HOLD AS  HLD_DD_OPT FORMAT ALPHA
    END
    -RUN
     
    -* Display the list of route names
    -HTMLFORM BEGIN
    <SELECT style="POSITION: absolute; TOP: 0px; LEFT: 0px; WIDTH: 220px;" id="cb_dropdown" name="cb_dropdown"></SELECT>
     
    <script type=text/javascript>
    function refreshOptions() {
      var ddList=document.getElementById("cb_dropdown");
      for(var i=ddList.options.length-1; i>=0; i--)
      {
        ddList.remove(i);
      }
      ddList.options.length = 0;
      !IBI.FIL.HLD_DD_OPT;
    }
     
    refreshOptions();
    </SCRIPT>
     
    -HTMLFORM END 
    


This message has been edited. Last edited by: JL,


Year(s) of experience in WebFOCUS: 5+. Using WebFOCUS 7.7.03 on Windows platform with Oracle/SQL Server.
 
Posts: 41 | Registered: September 08, 2008Report This Post
Master
posted Hide Post
I am trying to use the javascript functions doRepopulateInputControls(persistentuniqueid) or other functions but nothing works.

I am not getting any error but it is not loading the dropdown.

Any thoughts from the experts here.


WFConsultant

WF 8105M on Win7/Tomcat
 
Posts: 780 | Location: Florida | Registered: January 09, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     load dropdown dynamically using javascript

Copyright © 1996-2020 Information Builders