Dynamically find ClientID in javascript

Hello,
I have a requirement to find the ADF's component( Output Text ) Client ID dynamically in my Javascript code . The Javascript is called during initial loading , I cannot have an event associated with output text that can get me clientID by "getClientAttribute".
<af:resource type="javascript">
onTimer("r4:0:ot4")
function fireTimerEvent(id) {
var panel = AdfPage.PAGE.findComponent(id);
AdfCustomEvent.queue(panel, 'onTimer',
input : 'refresh'
true);
function onTimer(id) {
setInterval(function () {
fireTimerEvent(id);
8000);
</af:resource>
<af:outputText id="ot4" value="Activities">
<af:serverListener type="onTimer"
method="#{viewScope.RecentRewardsBean.onTimer}"/>
</af:outputText>
So, I am trying to dynamically generate "r4:0:ot4" in onTimer("r4:0:ot4")
Please let me know if there is way out
Thank You

Hi,
the output text component must have clientComponent="true" set. Then you can use AdfPage.PAGE.findComponentByAbsoluteId('id_here') to obtain a handle. If component is in a naming container (e.g. region) then get this first using the same call. If you have a handle to a component, you can call component.findComponentById("id") to look for nested child components. In your case, where you have a region
var reg = AdfPage.PAGE.findComponentByAbsoluteId('r4');
var txt = reg.findComponentById("ot4");
Note that there is no other way of getting a component's client ID except for using a page phase listener that searches the JSf component tree for the component to then call getClientId on it and issuing a JS call through the ExtendedRenderkitService class. Note that your JS code has no guarantee that the output text component exists to the time your load even fires. So better is to use a hidden component and bind it to a managed bean. This managed bean then is called when the hidden component (in the region) renders and uses the ExtendedRenderKit to invoke client side JavaSCript. This is a better and save event hook for your JS operations.
Frank

Similar Messages

  • How to dynamically find DNS server

    Is there any way to dynamically find out the address of the local DNS server strictly using java?? i.e. with out looking in etc/resolv.conf or using Runtime.exec and running some machine dependent command??

    Some quick thoughts (I have a meeting in five minutes):
    Send out dhcp requests and see if you get the answer back. This requires that your applet can send broadcast ip packets, which is beyond what can be done with a normal unsigned applet, but maybe permission can be granted for signed applets. You will have to find a dhcp client library or implement a partiel one yourself.
    Open /etc/resolf.conf or whatever the equivalent resource is on other operating systems, then use that name server.
    Put a list of known good dns servers in a file on the webserver the applet is loaded from. Keep the list updated, as servers disappers. If you stick to DNS servers of more stable looking companies, and have say five on the list, then at least one is likely to be available at all times.

  • Dynamically finding correct instance of class

    I am running two different applications under same context in tomcat. Both application has their own set of classes and common classes which are accessed by both applications. One of the common class say Class A is implemeting common interface say B is extended by both applications having their own subclasses C and D respectively. Now when some other common class Say X invokes method on interface B , at runtime class X should be able to invoke method on correct instance C or D depending on which application request came from. Is there any way where Class X can dynamically find the correct instance of class C or D to invloke method on?

    My answer is in your other thread.

  • Dynamically finding form parameters

    Hi all,
    I am using Forms 6i.
    I want to give my users the ability to 'bookmark' any form they are currently in enabling them to return to that form later displaying that data by selecting that bookmark (very much like a web browser's bookmarks.)
    To do this I need to be able to dynamically find out what form parameters are in any form. Whilst I can use GET_FORM_PROPERTY(FIRST_BLOCK) etc to find out what blocks and items are in a form, I cannot see any way of finding out what parameters it contains and what values they hold.
    Can anyone help me out with this?
    Thank you,
    David.

    Maybe you could convert the forms to .fmt's and parse them? I bet that'd be a mess.
    To expand on my previous suggestion, when you build your parameter list in FormA to call FormB, use a library proc that (1) adds the parameter and value to the param list, and (2) writes the userid, session id, form name (FormB), param name and value to a table. Then, when a user is running FormB and decides to bookmark it, query the table by userid, session id, and form name for the parameters that were used when it was called.
    I know that isn't as neat as what you're looking for, but could it work for you?

  • How to find & replace in Javascript code?

    Hi all!
    I hope that this turns out to be an easy question! We recently updated several forms (about 50 of them) to alter a select set of field names per customer requirements. However, it turns out that one of these fields is a key field and is referenced in one or more places by JavaScript within the PDF.
    In Acrobat 6 I'd select the option to edit all scripts which would give me a big document with all of the Javascript within the PDF. I could then do a find/replace on the code and save it. Now, using Acrobat Pro 9, I cannot find anything like this. Please don't tell me that I have to search through all of the different form fields and PDF objects to find all of the script pieces tied to objects or events! I'm really, really hoping that there is an easier way to do this since right now I'm out of ideas and really don't want to have to sift through all of the objects in over 50 PDF documents.
    Thanks in advance for pointing me in the right direction!

    Talk about not being able to see the forest for all the trees! I can't believe that I missed that -- I spent quite a while looking all over before posting. *sigh*
    The exact menu sequence (for those interested) is Advanced -> Document Processing -> Edit All JavaScripts...  That is exactly what I needed. Thanks!!!

  • Dynamic Page that uses javascript to run an executable on the client's pc

    I have an .exe file on a shared network that has to be called and executed from portal. The below code works as standalone but not from a dynamic page or an HTML portlet. Any ideas?
    <html>
    <script language="javascript" type="text/javascript">
    function runApp()
    var shell = new ActiveXObject("WScript.shell");
    shell.run('"c:/CstatsWeeklyreport.exe"',1,true);
    </script>
    <body>
    <input type="button" name="button1" value="Run Notepad" onClick="runApp()" >
    </INPUT>
    </body>
    </html>

    Thanks D, but that's not what I'm looking for. That changes which application a file opens with when you download it. That's not what I need for this situation. Here's a little more detail.
    The clients will have an application on their hard drive; it can be any application, even a custom application that they developed themselves. Then, they open a web page with a listbox full of items. Depending on which item they select, a query will return a file path to the .exe file itself. The .exe file resides on the client's hard drive, not on the server. So they're not downloading anything. Depending on the filepath returned by the query, the browser needs to start the process and open the .exe file for them.
    So let's say I have developed a simple text editor called Tedit. I have a file on my hard drive - "C:\TextEditor\bin\debug\TEdit.exe". When they click the open button, that file path is returned from the database. Then the javascript is called to start the process and open that program.
    Again, nothing is getting downloaded, the application resides on the user's hard drive and there is no file to associate it with.
    This can be done in IE using an ActiveX control. And it used to be possible in Firefox using the nsIFile or nsIProcess objects. But since FF15 that's not available anymore, so the javascript throws an error telling them that their permission is denied.
    What I need, is a javascript that will launch the .exe file from the user's hard drive without downloading anything.

  • Problems finding the netscape.javascript api

    I'm trying to import netscape.javascript.* into my applet so that I can perform some basic calls to javascript functions. I've got both Java 1.4.2 and 1.5.0 beta versions and I've tried all sorts of path additions. My current one is this:
    %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\Program Files\Java\jdk1.5.0;C:\Program Files\Java\jdk1.5.0\jre\lib\plugin.jar;C:\Program Files\Java\jre1.5.0\lib\jaws.jar;C:\Program Files\Common Files\Autodesk Shared\;C:\3dsmax5\backburner2\
    since I've read a tutorial that says I have to include the jaws.jar and another forum post that says I need to include the plugin.jar. Neither, however, work. I'd prefer it if I didn't have to use liveConnect at all, so does anyone know if thats possible.
    Any help would be most appreciated. Regards

    You will find the package in C:\Program Files\Java\j2re1.4.2_05\lib\plugin.jar if you use the default locations.

  • Dynamically find values for M_EINK_FRG for FRGCO

    I would like to dynamically fill the release code value in the authorization object M_EINK_FRG based on the user entering ME54N.
    Can this be done?
    So instead of putting 06 as a value in this object I'd like to put a field name that would be filled when this authorization check is made.

    What you can do is generate javascript that looks likeif (selectedID == 1) {
        return ['option a', 'option b'];
    } else if (selectedID == 2) {
        return ['option 'c', 'option d'];
    }and use that from a different function (which gets invoked if your first level menu changes). The generation would be done with some loop construct (c:if or logic:iterate for example).

  • How to set a dynamic validation message in javascript

    Hi,
    I am using the "validate" event on a field, along with the "script message" field, to make a validation and send a message to the user if the test fails.
    - Is it possible to define parameters in this message, for example "field &1 is invalid" where we replace &1 by the name of a field?
    - Is it possible to send 2 different messages (I guess it's like using a message &1)?
    - What is the best practice according to your experience?
    Notes:
    - I am aware of the xfa.host.messageBox, but I'd like to keep Adobe logic for validations (am I wrong? why?)
    - I also saw the possibility of binding a field from the context, to the message field, but I found that it was not very clean to do this way (if even possible)
    Thx !

    According to the tests I did since yesterday, it is very difficult to use the "validation script message" (in the "value" tab of a "text input" field, within a dynamic table), for sending a dynamic message.
    I abandon, and prefer to use use
    xfa.host.messageBox( "dynamic message text" )
    For information, I could change the message during "validate" event, with a rather complex algorithm.
    Unfortunately, when a table row is just added (dynamically, with a button), though the message has been changed, it displays the original value. When I change the field again, the changed validation message is taken into account. I don't know why.
    Edited by: Sandra Rossi on Jul 24, 2009 9:01 AM : it's only to say that since then, this was the only solution! Question closed

  • Dynamic Page / Oracle Tags/ Javascript

    I'm attempting to insert values from an Oracle database into javascript code that creates a scrolling text area. I'm assuming I need to use <oracle></oracle> tags to do so, but I'm not sure exactly how to populate what I need in the code. Any ideas?
    The code is below. The area that needs to be populated with the data is in the Array variable, and I've used "Database Value 1, 2, 3" as placeholders.
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
         <title>Untitled</title>
    <style TYPE="text/css">
         <!--
         .TextScrollStyle {
              visibility:hidden;
              font-family:Verdana;
              font-weight:bold;
              text-align:center;
              padding:0;
              margin:0;
              width:100%;
              overflow:hidden;
         -->
         </style>
    <script language="JavaScript1.2">
              var TS_message = new Array();
    TS_message[0] = '<div align="left">Database Value 1</div>';
         TS_message[1] = '<div align="left">Database Value 2</div>';
              TS_message[2] = '<div align="left">Database Value 3</div>';
    var TS_scrollwidth=400
              var TS_colorFG = 0x000000;
              var TS_colorBG = 0xFFFFFF;
              var TS_ymax = 50;               
              var TS_ystep = 1;               
         var TS_speed = 2;                    
    var TS_pause = 100;
              var TS_fadestep= 20;               
    if (document.all)
    document.write('<style>#containerarea{width:'+TS_scrollwidth+'}</style>')
    </script>
    </head>
    <body>
    <DIV id="containerarea">
    <SCRIPT LANGUAGE="JavaScript1.2" SRC="\\Portalapp\ORACLE\iSuites\portal30\java\textfader.js"></SCRIPT>
    </DIV>
    </body>
    </html>

    You can write a piece of PL/SQL for
    TS_message[0] = '<div align="left">Database Value 1</div>';
    TS_message[1] = '<div align="left">Database Value 2</div>';
    TS_message[2] = '<div align="left">Database Value 3</div>';
    between <ORACLE> tags:
    declare
    cursor ...
    begin
    loop for i in cursor loop
    htp.p('TS_message[0] = ''<div align="left">'||i.value||'</div>''; ';
    end loop;
    end;
    Hope it helps.

  • Dynamic Dropdown / PHP / MySQLi / Javascript Problem

    I have 2 pages, namely main.html and list.php The Main Pageincludes the following code and consists of a dropdown that i want to pull some database records into by calling the function fillCategory contained in list.php
    Content on main.html
    <!doctype html public "-//w3c//dtd html 3.2//en">
    <html>
    <head>
    <title>Page Title</title>
    <script language="javascript" src="list.php"></script>
    </head>
    <body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000" onload="fillCategory();">
    <FORM name="drop_list" action="yourpage.php" method="POST" >
    <SELECT NAME="Category" >
    <Option value="">Category</option>
    </SELECT> 
    </form>
    </body>
    </html> 
    Content of list.php
    <?php 
    require_once('mysqli_connect.php');
    echo "
    function fillCategory(
    $q="select * from category"; 
    echo mysqli_error($dbc); 
    $r=@mysqli_query($dbc,$q); 
    while($row=mysqli_fetch_array($r,MYSQLI_ASSOC)){
    echo "addOption(document.drop_list.Category, '$row[cat_id]', '$row[category]');";
    ?> 
    I know that records are being pulled from the MySQL database since when i view 127.0.0.1/list.php i can see the following diplayed on the page: 
    function fillCategory( addOption(document.drop_list.Category, '1', 'Sport');addOption(document.drop_list.Category, '2', 'Music');addOption(document.drop_list.Category, '3', 'Art'); 
    which are the contents (Sport, Music, Art) that i'd like to appear in my dropdown. However, i suspect that i shouldn't see the above being displayed in list.php Instead, it should probably be passed to main.html "unseen". Can anyone point out the probable error in my syntax. I can provide more detail on the database structure if it will help. 
    Thanks,
    Mark

    I think that this is the line in error:
    <script language="javascript" src="list.php"></script>
    The <script> tag is generally used to include client-side script. I believe that PHP will recognize on the server-side, but you need to change "javascript" to "php". You may want to use a PHP include or require statement, instead.
    Also, you might need to remove the "<?php" and "?>" delimiters from list.php.
    HTH,
    Randy

  • How to dynamically find the dependent jar files on user's PC

    I've written an application to deal with JTAPI. Unfortunately the implementations by vendors are different in terms of file names. Ideally I'd like to load jars based upon what's installed, e.g. load jtapi.jar when Cisco is installed, or Escjtapia.jar when it's Avaya. The application uses a small subset of JTAPI so different implementations should not yield any different results.
    I edited the manifest file in my jar so that the Class-path has both jar file names for Cisco and Avaya. I didn't enter any path, hoping the CLASSPATH of Windows would be searched, but it is not the case. Also, if other vendors are supported in the future, I might have to add all different file names in the manifest. I don't think the class loader will work in my case, as I may not know the class name at all. I just want to search the system's classpath the find any jar complys to JTAPI and load it.
    Anybody can give suggestions on deployment? Thanks!

    I found it. EXIT_SAPLV01Z_001 does the trick. A package contains many User-Exits, BADIs and enhancement points, so it took me a while to go thru all of them.

  • Dynamically finding Number of Parameters in Parameter List.

    Hi All,
    Does it possible to count the number of parameters in the list.
    I am creating discoverer report so I need to find out how many periods I am passing in parameter list.
    Thanks in advance.
    Regards,
    Bluetooth

    No, you can't "read" a forms parameter-list.

  • Find Server Behavior/JavaScript Errors

    I am getting an error whenever I created Update or Insert
    record server behaviors in my pages. When I go through the process
    of adding the behavior, it inserts the VBScript for my ASP page,
    but then I get an error message when findServerBehaviors runs. In
    DW8, it was referring the InsertRecord.htm, in DW CS3, it referres
    to InsertRecord2.htm whenever I run and Insert Server Behavior. As
    I said, it inserts the code, but it will not show an Insert Record
    in the Server Behaviors panel.
    If I close and open DW, the next time I open the page, the
    behaviors will be listed in the panel, but the moment I make any
    changes to the page, and the findServerBehaviors javascript is
    triggered, I get the error message and lose the listing of the
    insert or update in the behavior panel even those the VBScript code
    is still in the page. This is super annoying.
    Anyone have this problem?

    It's probably some extension you have installed that's
    causing the issue. I found a tech support article that helped -
    can't remember where, but basically you recreate your configuration
    by renaming your existing config folder to something like
    "configuration-old" and then restart DW. It will create a new
    config folder and you will have to re-enable all your extensions.
    This solved the problem for me initially and I enabled a few
    extensions every few days until one day the error started happening
    again. For me the problem was caused by the extension "Justso
    Picture Window". Once I disabled that extension, my problems went
    away. It would be nice if DW had some way of telling you which
    extension is causing an issue.

  • Dynamically Find out the Integer and Decimal Data Type of a Column

    Table: test (INTE number, DECI number(7,2))
    Try to dynamically determine the column type.
    Using select data_type from user_tab_columns. It only returns NUMBER which does not indicate if the column is an integer or decimal data type.
    Is there a way to dynamically determine if a column is integer or decimal type?
    Thanks

    First of all your column INTE stores not just integers but any franctional numbers too:
    SQL> create table test(INTE number, DECI number(7,2))
      2  /
    Table created.
    SQL> insert
      2    into test
      3    values(
      4           10.99,
      5           10.99
      6          )
      7  /
    1 row created.
    SQL> select  *
      2    from  test
      3  /
          INTE       DECI
         10.99      10.99
    SQL>If you want to declare column as integer you use either NUMBER(n) or INTEGER. And, as others already pointed out, you can check DATA_PRECISION & DATA_SCALE in data dictionary view USER/ALL/DBA_TAB_COLUMNS.
    SY.

Maybe you are looking for

  • Displaying output  in ALV Report..

    Dear Guru's I  have a Tipical Problem in Producaiton. when iam executing the report in Development Server it is working fine. but when I executing the same report in Producation server , first time it is given blank output(only layout) and once come

  • Iphone getting a certificate error logging into Lync 2013

    Hello, I am having a strange issue with Lync Mobility. Android seems to work just fine, but my IPhone clients are throwing certificate errors. Everything is showing up properly in the Lync Connectivity Analyzer. The LyncDiscover URL seems to work jus

  • After Effects CC 2014 Graphics Card Issues?

    I just updated to After Effects CC 2014 the other day and have been having issues with it accepting my graphics card. I worked with AE CC before this with this card and haven't had any issues. The program will not use the graphics card for any ray tr

  • Invalid origin Host error AVP due to DRA originating RAR

    Here is the scenario in our Customer environment : For VoLTE Gx environment, our Customer use Cisco PGW, Oracle DRA and Openet PCRF. Their DRA has sessions/subscribers database. In order to avoid ghost sessions on DRA, they have implemented a feature

  • Link between spool request & abap program

    Hi all, I m looking for the link table between a spool request and the corresponding job and abap program. I want to select all spool requests generated via een job via een abap program. Some suggestions? Thanks in advance,