How do I use javascript or formcalc to reference child controls (not by name)

Hi everyone,
I've created a ton of reports in the past, and I'm now looking at creating some reusable objects so that other people can use advanced form functionality without having to learn to use scripts.
A lot of the coding was acheived using this, .parent, etc. so that they can rename controls and subforms without having to worry about breaking scripts. One issue that I am having is that Some of my code looks at children controls, and references them by name (for example, I have some code that uses setfocus to move the user to the first field in a subform).
In most languages, there are ways to refer to child controls via an indexer or an items/children array. i.e. Subform.items[0].rawValue.
I know that this would pose some issues, but I think I could sort it out, if only I knew where to start. Is there some way to reference a child control without it's name?
Thanks for your help!
- Scott

Hi Scott,
The subform has a nodes collection you can loop though, as you suspected.  If might show up more than you want but you can test the className to see if it is a field and then ui.oneOfChild.className to work out what type of field. So;
for (var i = 0; i < Subform1.nodes.length; i++)
    var n = Subform1.nodes.item(i);
    console.println(n.className + " " + n.name + " " + n.ui.oneOfChild.className);
Hope this helps.
Bruce

Similar Messages

  • Addition of fields in Adobe forms using JavaScript or FormCalc

    Hi All,
    I have a few amount fields in my Adobe form. I want to calculate their sum and show it in another textfield. Any ideas how this is done using JavaScript or FormCalc.???
    Thanks and Regards,
    Sameer

    Hi Sameer,
    you cant use JavaScript here in Web Dynpro. But if you want to calculate the sum through a button click that can be done through the Action Handler method.
    Suppose you have 2 fields to add whichare field1 and filed2 in the context tree and the sum will be shown in field3 of context tree - all of numeric data type - obviously. So you can do the following in the action handler method.
    int sum = wdContext.currentContextElement().getField1() +
              wdContext.currentContextElement().getField2();
    wdContext.currentContextElement().setFields3(sum);
    Regards,
    Shubhadip

  • How can I use javascript in a Text Area with HTML editor??

    My question is... how can I use javascript in Text Area with HTML editor??
    I can use javascript functions that change the content of Text Areas but i can´t if i try in text area with html editor....
    I need to limit number of characters in a text area with html editor and i can´t.
    could anybody help me please?

    I have been experiencing similar problems with the HTML Editor and have managed to find an answer that should start to answer some of my questions. The Apex HTML Editor Standard is actually an HTML editor called FCKeditor. The FCKeditor has a Javascript API that can be found at http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/JavaScript_API. Unfortuately this doesn't seem to give the whole answer and I found more at http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:49607.
    I needed to get the text entered within my html editor standard (e.g. P1_MYTEXT) and use it within my javascript function. I did this by using the following script
    <script language="JavaScript" type="text/javascript">
    function showtext(){
    var oEditor = FCKeditorAPI.GetInstance('P1_MYTEXT');
    var editortext = escape(oEditor.GetXHTML(oEditor.FormatOutput));
    alert(editortext);
    </script>
    Hope this helps.
    Matthew

  • How can i use javascript in weblogic jsp

    Hai,
              I know that we can use the jsvascript to validate the html parameters.
              Is the wblogic jsp support the javascript ?. I tried in weblogic
              5.1.0.,the javascript is not working.
              anybody can help me how to validate html input and how can i use
              javascript in jsp.
              Thanks
              Srinivas
              

              Do you know how JSP can use a variable defined in Javascrip ?
              Thx,
              Lin
              "Cameron Purdy" <[email protected]> wrote:
              >Write your JSP as you would any HTML file, including JavaScript. Then
              >rename the .html file to .jsp. Add your custom tags and Java code as
              >desired. Done.
              >
              >There was a complaint in the 5.0 beta about the JSP parser choking on
              >JavaScript, so I would make sure you at least try on the latest 5.1 service
              >pack, just in case.
              >
              >Cameron Purdy
              >
              >"SRINIVAS" <[email protected]> wrote in message
              >news:[email protected]..
              >> Hai,
              >> I know that we can use the jsvascript to validate the html parameters.
              >>
              >> Is the wblogic jsp support the javascript ?. I tried in weblogic
              >> 5.1.0.,the javascript is not working.
              >> anybody can help me how to validate html input and how can i use
              >> javascript in jsp.
              >>
              >> Thanks
              >> Srinivas
              >>
              >
              >
              

  • How jsp to use javascript's variable??

    Hi, how jsp to use javascript's variable or a jsp's variable can be assigned a value in the javascript??
    thx

    well i havent accessed the value of javascript variable in jsp
    yet but i have accessed the value of a java variable in java script
    try it
    <script ...>
    function jspToJavaScript(a){
    alert(a);
    </script>
    <%
    int a=10;
    %>
    <img src="..." onClick="jspToJavaScript(<%=a%>)">

  • How can I use the button in one panel to control the other panel's appearing and disappearing?

    How can I use the button in one panel to control the other panel's
    appearing and disappearing? What I want is when I push the button on
    one button . another panel appears to display something and when I
    push it again, that the second panel disappears.

    > How can I use the button in one panel to control the other panel's
    > appearing and disappearing? What I want is when I push the button on
    > one button . another panel appears to display something and when I
    > push it again, that the second panel disappears.
    >
    You want to use a combination of three features, a button on the panel,
    code to notice value changes using either polling in a state machine of
    some sort or an event structure, and a VI Server property node to set
    the Visible property of the VI being opened and closed.
    The button exists on the controlling panel. The code to notice value
    changes is probably on the controlling panel's diagram, and this diagram
    sets the Visible property node of a VI class property node to FALSE or
    TRUE to show or
    hide the panel. To get the VI reference to wire to the
    property node, you probably want to use the Open VI Reference node with
    the VI name.
    Greg McKaskle

  • How do I use Javascript to populate a text field based on a selection from a drop down box?

    Greetings,
    I have virtually no experience with JavaScript and I am trying to figure out how to add some basic automation features to an Adobe form.  I have a drop down box called "Hospital_Name" that will contain approximately 7 possible selections.  When the user makes a selection, I would like to have the text field (called "Hospital_Address") below the drop down box populate with the corresponding address for the selection.  I have the "Hospital_Address" text field configured for multiple lines and would like the address to have a line break between the street address and the city/state/zip.
    For example, if the user selected "Hospital 1", the text field would display:
    123 Main St
    Anytown, CA 12345
    Any help or examples you can provide would be greatly appreciated.

    You have the element names within the object within brackets.
    Make sure your brackets are properly placed and matched.
    // Place all pre-population data into a single data structure
    var Location = {
    "--Hospital--":{ line1: " ", line2: " " },
    "Bellevue Medical Center":{ line1: "2500 BMC Drive", line2: "Bellevue, NE 68123" },
    "CHI Bergan Mercy":{ line1: "7500 Mercy Road", line2: "Omaha, NE 68124" }, 
    "CHI Immanuel":{ line1: "6901 N. 72nd Street", line2: "Omaha, NE 68122" }, 
    "CHI Lakeside":{ line1: "16901 Lakeside Hills Court", line2: "Omaha, NE 68130" }, 
    "CHI Midlands":{ line1: "11111 S. 84th Street", line2: "Papillion, NE 68046" },
    "Creighton University Medical Center":{ line1: "601 N. 30th Street", line2: "Omaha, NE 68131" },
    "Nebraska Medical Center":{ line1: "4400 Emile Drive", line2: "Omaha, NE 68105" }
    // some debugging code to see location names;
    console.show();console.clear():
    for(I in Location) {
    console.println(I);
    // end debugging code;
    function SetFieldValues(Hospital_Name) {
        this.getField("AddLine1").value = Location[Hospital_Name].line1;
        this.getField("AddLine2").value = Location[Hospital_Name].line2;
    This is not a beginners task but requires a fair amount of knowledge about the structure of objects, defining strings, and structure of arrays.
    Are you sure you have all the field names correctly spelled and capitalized?
    Do you get any error in the JavaScript console?
    Just trying the line that defines the "Location", I get the following error:
    SyntaxError: invalid property id
    1:Console:Exec
    undefined
    All the form field in a PDF are processed by using JavaScript and any error in any script will stop JavaScript processing.
    It might help to have a link to the problem form.
    Make sure your brackets are properly placed and matched.
    // Place all pre-population data into a single data structure
    var Location = {
    "--Hospital--":{ line1: " ", line2: " " },
    "Bellevue Medical Center":{ line1: "2500 BMC Drive", line2: "Bellevue, NE 68123" },
    "CHI Bergan Mercy":{ line1: "7500 Mercy Road", line2: "Omaha, NE 68124" }, 
    "CHI Immanuel":{ line1: "6901 N. 72nd Street", line2: "Omaha, NE 68122" }, 
    "CHI Lakeside":{ line1: "16901 Lakeside Hills Court", line2: "Omaha, NE 68130" }, 
    "CHI Midlands":{ line1: "11111 S. 84th Street", line2: "Papillion, NE 68046" },
    "Creighton University Medical Center":{ line1: "601 N. 30th Street", line2: "Omaha, NE 68131" },
    "Nebraska Medical Center":{ line1: "4400 Emile Drive", line2: "Omaha, NE 68105" }
    function SetFieldValues(Hospital_Name) {
        this.getField("AddLine1").value = Location[Hospital_Name].line1;
        this.getField("AddLine2").value = Location[Hospital_Name].line2;

  • How can i use JavaScript in Struts

    Any one can please tell me how can i use simple java script in Struts framework
    like
    <script language="javascript">
    function call()
    alert("You Are In call()")
    </script>
    </head>
    <body>
    <form ..... >
    <input type="button" value="CHECK" onclick="return call()" >
    </form >........
    ok this i can use in normal jsp
    but how can i use same in Struts framework
    Thanks in advance

    This forum is for JSF, not Struts. Your best bet to get your question answered, is to post to the struts user mailing list.

  • How can I use JavaScript extention functions with Xalan for transforming XML with XSL

    While transforming standart XML and XSL files to HTML with this servlet:
    package mypackage1;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    import java.net.URL;
    import javax.xml.transform.*;
    import javax.xml.transform.stream.StreamSource;
    import javax.xml.transform.stream.StreamResult;
    import org.mozilla.javascript;
    public class Servlet2 extends HttpServlet
    private static final String CONTENT_TYPE = "text/html; charset=windows-1252";
    public void init(ServletConfig config) throws ServletException
    super.init(config);
    public void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException
    try
    response.setContentType(CONTENT_TYPE);
    PrintWriter out = response.getWriter();
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Source xmlSource = new StreamSource(new FileReader("c:/aaa.xml"));
    Source xslSource = new StreamSource(new FileReader("c:/bbb.xsl"));
    Transformer transformer = tFactory.newTransformer(xslSource);
    transformer.transform (xmlSource, new StreamResult(out));
    catch (Exception e)
    e.printStackTrace();
    everything is going ok,
    but when try to use javascript function in XSL file, for example like in this:
    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
    xmlns:lxslt="http://xml.apache.org/xslt" xmlns:my-ext="ext1"
    extension-element-prefixes="my-ext">
    <lxslt:component prefix="my-ext"
    functions="getdate">
    <lxslt:script lang="javascript">
    function getdate() {
    var d = new Date();
    return d.toUTCString();
    </lxslt:script>
    </lxslt:component>
    <xsl:template match="/">
    <p><xsl:copy-of select="my-ext:getdate()"/></p>
    </xsl:template>
    </xsl:stylesheet>
    recieve error-message:
    XSL-1000: (Fatal Error) Error while parsing XSL file (Extension function namespace should start with 'http://www.oracle.com/XSL/Transform/java/'.).
    What kind of namespace I should specify?

    Hello, Paul.
    I'm sure you may not use JavaScript as a language for creating XSLT extention functions with Oracle XDK Parser. This is since parser might have JavaScript interpreter to work with JavaScript, but it has not.
    If you need to build any XSLT extention functions you must build them as Java class' static methods.
    After that, you define the usage of the class by mean of namespace declaration as:
    xmlns:your-ns="http://www.oracle.com/XSL/Transform/java/yourpackage.Yourclass"
    (Prefix "http://www.oracle.com/XSL/Transform/java/" may differs if you use non-Oracle XML parser)
    and use class' static method in XSLT:
    <xsl:value-of select="your-ns.staticMethodName(paramsIfAny)"/>
    In your case you may wish to use standard Date class:
    xmlns:date="http://www.oracle.com/XSL/Transform/java/java.util.Date"
    <xsl:value-of select="date:toString(date:new)"/>

  • How does one use JavaScript with the Windows Media Player Plugin?

    Hi there.
    According to this old [http://msdn.microsoft.com/en-us/library/dd564570%28v=VS.85%29.aspx MSDN Article] it is possible to control the windows media player plugin using javascript.
    It provides a series of objects off the object that should perform certain funtions, such as play stop and seek.
    It states very clearly in the article that some are not supported; however, none of them seem to be working with the latest version(s?) of Firefox.
    I have Firefox 5 installed currently and have not tested in any other version, so I'm not sure when it stopped working.
    The video does load and will display properly -- the ability to control it through javascript however, does not work.
    i.e.:
    var mplay = document.getElementById('myplayer');
    mplay.controls.play(); // mplay.controls is undefined
    This same code works in Internet Explorer.

    You need to place the URL in a data attribute for Firefox.
    <pre><nowiki>document.write(' <OBJECT id="Player" data="http://87.117.197.189:16229" width="320" height="45" type="application/x-ms-wmp">');
    document.write(' <param name="AudioStream" value="true">');
    document.write(' <param name="Enabled" value="True">');
    document.write(' <param name="ClickToPlay" value="false">');
    document.write(' <param name="BufferingTime" value="5">');
    document.write(' <param name="ShowDisplay" value="False">');
    document.write(' <param name="Volume" value="70">');
    document.write(' <param name="autoStart" value="true">');
    document.write(' </OBJECT>');</nowiki></pre>

  • HOW I CAN USE JAVASCRIPT IN 11GFORMS

    ANY EXAMPLE / TUTORIAL / SAMPLE?

    Hi,
    Here is an example of how to call a javascript function
    1. Drag and drop a hyperlink component
    2. Click on the JSP tab to go to the JSP source editor
    3. Insert the following block of javascript code in the ui:head tag
    <script type="text/javascript">
                            function popup() {
                            alert("Hello World")
    </script>4. Return to the design editor
    5. Select the hyperlink component
    6. In the properties sheet, under the section Javascript, click on the ... button next to the onClick property
    7. A dialog window pops up. Enter the following line
    popup();
    8. Click on OK
    9. Save and run the application
    10. When the page is rendered click on the hyperlink and an alert saying Hello World appears
    Hope this helps
    Cheers
    Girish

  • How do i use an active directory group for vpn and not all user

    hi all,
    i have an asa 5515x...
    how do i use a particular group in active directory to have vpn/anyconnect access?  right now i believe it's for all user on my current config,
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    !integrate with active directory
    aaa-server LDAPSERVERS protocol ldap
    aaa-server LDAPSERVERS (vlan192) host 10.0.0.2
    ldap-base-dn dc=company,dc=com
    ldap-scope subtree
    ldap-naming-attribute sAMAccountName
    ldap-login-password 12345678
    ldap-login-dn cn=administrator,cn=Users,dc=company,dc=com
    server-type auto-detect
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    say i want this "vpn-group" object group in AD and my vpn is only anyconnect and no other vpn types.
    thanks for any comment you may add.

    The best way is to use Dynamic Access Policies (DAP). Cisco has a white paper (here) that shows how one can choose the LDAP group as one of the DAP criteria.
    DAP requires the Advanced Endpoint Assessment feature, so your licensing must support that.

  • How can i use NI's VXI-1394 controller to control the CONDOR's VXI-1553B module?

    Now I want to use the NI's VXI-1394 to control a CONDOR's VXI-1553B module.But I did a test and found that the NI's VXI-1394 can not control that module.The VXI-PCI8015 can control the VXI-1553B module.
    But I have a VXI-1394 module and I want to use that to control the CONDOR's VXI-1553B module.How can I do that?Give me a hand,please.

    Hello Lincoln,
    Judging by the fact that you mention the VXIpc-8015, I am deducing that you are using the VXI-MXI-2 card under Windows NT. Is that correct?
    Under Windows NT, the VXI-MXI-2 board and the VXI-1394 need to use different versions of the NI-VXI driver.
    The VXI-PC-8015 (MXI-2) should be using NI-VXI v3.2, while the VXI-1394 needs to use a special version of the driver (v2.1.1) because Windows NT does not natively support the IEEE 1394 protocol.
    The issue may simply be the wrong driver, but if it is not, we will need to know more information about your system.
    1a. What version of NI-VXI are you using with the VXI-1394
    1b. What version of NI-VXI are you using with the VXI-MXI-2)
    2. What OS are you running?
    3. How are you attempting to communi
    cate with the CONDOR device?
    4a. What configuration utility are you attempting to use with the VXI-1394
    4b. What configuration utility are you attempting to use with the VXI-MXI-2
    5. Is the CONDOR device register based or message based VXI device?
    6. Have you used NI-Spy? If so, can you generate NI-Spy logs that might help debug this issue? There is a quick tutorial on NI-Spy here.
    Start with these steps, and let us know how it goes. Thank you!
    Regards,
    Josh Hernstrom
    Applications Engineer
    National Instruments

  • HT5429 How can I use this app in India? It does not show me precise navigation direction here at all?

    How do I use new apple maps (GPS) upgraded in the iOS 6 of my 4S model. It is neither showing me precise location of my whereabouts nor giving me driving directions to the defined locations. I even tried putting very prominent locations near me, but it said maps server not responding. How to solve this problem? can I get the older version of maps?

    The Apple Maps app will get better over time. And we will see this with each subsequent iOS upgrade. It will take time. There is nothing we can do, execept wait. Sorry.
    Remember, when the original Apple/Google maps came out in the original iPhone, five plus years ago, it was garbage and pretty much unusable.

  • The page at docviewer at my company's website displays this error when using FireFox but not hwne using I.E. "ERROR: JAS MiscUtils AX Control not installed!"

    When using Fire Fox to view documents at my company's website, the following message occurs:
    "ERROR: JAS MiscUtils AX Control not installed!"
    This error does not occur when I use I.E.

    That error message probably refers to a missing ActiveX control, which is why it doesn't work in Firefox but does in Internet Explorer.
    https://support.mozilla.com/en-US/kb/ActiveX

Maybe you are looking for

  • How to add a button to a JFrame..?

    Hi everyone, First of all, I would like to apologise for asking such a "stupid" question.. im new to the java world. Now for my question : I have a JFrame , but I would like to add a button to it ( I would also like to be able to choose where I can p

  • Ipod nano 2gig - consistent problems with freezing?? should i bin it?

    Hi, I have either a 1st or 2nd nano 2 gig and about 4 months back it froze and battery seemed to die out. I have just been using my wives since but she needs hers...and i need my one to work its not very old i had had it perhaps a year when it happen

  • 4K resolution

    Hi, I'm about to buy a 4K monitor. I need to know if all of Adobe CC programs support 4K resolution.

  • Missing BeanInfo Editor in JDeveloper 10.1.3

    Hello, I had mad a JavaBean as extension of JPanel. After defining my elements and methodes for the javabean. I created the BeanInfo of my JavaBean with the menu entry new and selected the BeanInfo as new type. After creating the BeanInfo, I miss the

  • How to use thread only for progress bar.....

    Hello, I am working on an application which is taking time to load. Now I want to use a progress bar to tell the user of the application that It is taking time to load. How to do it... I read the Java swing tutorial and went through the example. Plea