Insert JavaScript code at the level of the doc

Hello

It is perhaps a silly question, but so far my research lead to no results. I know that JavaScript can be run from a plug-in by using the AFExecuteThisScript function, but in my case it is not enough. So, is it also possible to add a JavaScript to the level of the doc to the document of the plug-in.

Or maybe you have even a better idea how I could achieve my goal, so let me explain to you the szenairo:

I have a PDF document that is dynamically populated with data. To this I add lines of fields to my document using the doc.addfield JavaScript and AFExecuteThisScript. It works very well. Now, I also need to be able to remove such a line of fields. And I don't know yet how I can do it.

An idea that I have... and that's also why I ask if it is possible to add a JavaScript to the level of the doc... must also add a button in the same row of field I'm insertion and with this button, it would be possible to remove the entire line of the fields. The problem with this, is that I don't know to set the RAM action in my button. Another point that I'm not sure about is whether in JavaScript button knows his name or if the programmer needs to know it.

It does not, because the function is not stored anywhere. So I can see my alert when the row is created, but when I click the button nothing happens:

sprintf (jsScript, "function deleteFieldsRow() {\
App.Alert ("it's deleteFielsRow ()"); \
}");
AFExecuteThisScript (pdDoc jsScript, NULL);

sprintf (fieldName, "btnDelete_ % s_ % d_ %d", categorieTreated, actionCtr, subActionCtr);
sprintf (jsScript, "var f = this.addField (' %s, 'button', [%d,%d,%d,%d]);\, %d) ')
f.buttonSetCaption ('X'); \
f.fillColor = color.ltGray;.
("f.setAction (" MouseUp ", deleteFieldsRow()"); ", fieldName, pageNum, x_9, y_1, x_10, y_2);
AFExecuteThisScript (ePaperPDDoc, jsScript, NULL);

Another idea I've had is add the command remove the context menu and determine which fields to remove the position by the x, y of the click. It also via JavaScript because I think that it is not possible to add something to the context menu with the SDK... is it?

I would be happy to get some feedback on what you feel is best and how can I do, or maybe you even now an easier way to reach my goal. I am open to any suggestion.

Thanks for your help.

Escape characters '

Tags: Acrobat

Similar Questions

  • Popup of console log in Chrome for the Javascript code for the Adf application

    Hello

    I use JDev 11.1.1.7.

    In our application, I used the same code as in the example (http://www.oracle.com/technetwork/testcontent/27-long-running-queries-169166.pdf) adf code corner next.

    I used this code to my command button on my page.

    The problem is, when you run the application in the browser Chrome, clicking this command button displays a warning for javascript popup (Please find below printscreen).js_error_popup.png

    The application is not break and continues to work even if this popup comes.

    I tried with other browsers, it is works well and do not show this javascript error.

    You can all help to suggest? Is there something wrong with the javascript code? Thank you.

    Best regards

    cmoster

    Hi Timo,

    The problem is now resolved.

    We have corrected by adding these params of context in the web.xml file to work around the problem.

        org.apache.myfaces.trinidad.DEBUG_JAVASCRIPT

        fake

     

     

        oracle.adf.view.rich.profiler.ENABLED

        fake

     

     

        oracle.adf.view.rich.LOGGER_LEVEL

        OFF

     

     

        oracle.adfinternal.view.faces.DISABLE_CONTENT_COMPRESSION

        fake

     

    Best regards

    cmoster

  • Adding an event does not add the JavaScript code to the code automatically window

    I'm learning to animate Adobe classroom in a book (among others).  The lesson says to add an event to the timeline.  I click the icon "open stock" ({}) to the beginning of the row on the timeline for the item that I want to add an action.  The edit window appears.  I click on "mouseover", and only a comment is added to the window instead of the Javascript code.  I have to enter the code manually.  Animate is no longer does this in the code window actions?

    Note that the second stage ("choose a target") is required to automatically add the code.

    You must select an object, and then click Enter.

  • No javascript code in the browser of acrobat DC IOS

    I had several PDFs with an attachment html with javascript and graphics. They worked well, but after update, the browser does not support javascript more. Why? He comes back?

    Hello

    For security reasons, we have disabled JavaScript support in the HTML preview inside the Acrobat DC iOS app.

    You should consider a different way to package HTML files or use the HTML files to a web server and provide hypertext links in a PDF document.

    Sorry for the inconvenience.

  • Javascript code for the ADF to complete a field entry date

    Hey guys,.

    I have a field of adf entry date

    < af:inputDate value = "#{MyBean.date}" >
    < af:clientListener method = "onEnterDate" type = "keyPress" / >
    < / af:inputDate >

    I would like to implement a javascript function that complements the date field, means: when the user inserts 10 in the field and press the ENTER key on the keyboard, I want to fill the date with the time current system, like this (11/10/2011), so how can I do this...

    Thanks in advance...

    AccadSoft

    You can write a client-side converter [url http://myfaces.apache.org/trinidad/devguide/clientValidation.html] to do this.

    John

  • insert JavaScript popup within the Organization

    simple question I'm sure that I have a basic javascript

    < script type = "text/javascript" >

    <!--


    alert ("This is a JavaScript ALERT box. ") ")


    ->

    < /script >

    However it must be inserted in the head of <>, however it is blocked in the model and if I insert it, it will appear on all pages based on the template, I just that appear on a single page.

    Thanks in advance

    You can insert it as the first element after youron this page and it should work the same way as in the header.

  • How to find and replace in the Javascript code?

    Hi all!

    I hope that this proves to be an easy question! We have recently updated several forms (about 50 of them) to change a set of names of fields by the requirements of the customer. However, it turns out that one of these fields is a key field and it is referenced in one or more places of JavaScript in the PDF.

    I would choose the option to edit all of the scripts that would give me a large document with all the Javascript code in the PDF in Acrobat 6. I could then do a find/replace on the code and save it. Now, using Acrobat 9 Pro, I don't know something like that. Please don't tell me that I have to search in all fields in different form and PDF objects to find all the pieces of script related to objects or events! I'm really, really hoping that there is an easier way to do it from right now, I'm ideas and really do not want to have to sift through all the objects in more than 50 PDF documents.

    Thanks in advance for pointing me in the right direction!

    Go to the Advanced section - Document Processing - Edit Document JavaScripts...

    (or something similar, don't have it in front of me at the moment)

  • Run the code from the jar java fixed pitch

    Hello

    based on article

    https://supportforums.Cisco.com/document/98986/UCCX-quick-Java-recipes

    I copied the code of 1). and they changed a bit for my daysx24hours. The only type is, give the script a parameter (here the number of credit card and return the result of UCCX (perhaps the last type is missing).)

    The following code:

    ###############################################################################

    public class ClassCheckCC {}

    Public Shared Sub main (String [] args) {}
    TODO self-generating method stub
    String ccnumber = args [0];
    String ccnumber = "66666666666666666";
    int isValid = 99;
    isValid = verifyCC (ccnumber);
    System.out.println (IsValid);
    }
            
            
            
            
    private static int verifyCC (String ccnumber) {}
    int sum = 0;
    Boolean alternate = false;
    Boolean isValid = false;
    try {}
    int i = 0;
    for (I = ccnumber.length () - 1; i > = 0; i--) {}
    int n = Integer.parseInt (ccnumber.substring (i, i + 1));
    If {(acting)
    n = n * 2;
    If (n > 9) {}
    n = (% n 10) + 1;
    }
    }
    sum += n;
    Alternate =! alternate;
    }
    isValid = (sum %10 == 0);

    } catch (Exception e) {}

    Returns - 1;

    }

    return (isValid == true? 1: 0);
    }
    }

    ###############################################################################

    In Eclipse, I create a new java project named "CheckCreditCardNumber" and insert this code into the new project. The name of the new class is 'ClassCheckCC '. I created a "CheckCCNumber1.jar" executable jar file This will work as expected in a DOS window.
    I call it this way: java-jar CheckCCNumber1.jar 1234567890123456

    The number represents a credit card number.

    In my opinion, always ready to implement in UCCX.

    JAR file downloaded on UCCX (you can find it in an attachment here), moved to the right side (to the Classpath entries. selected :) Some service restarted. Do some tests to access the file and can be seen in UCCX Editor.

    Then, I created a new script file and inserted a defined step

    takes it place the following errors:

    But the result expected from the byte type (-1.0 or 1) java code. Shit, I declared the variable isValid as string occurs:

    We try to call java code:

    Next, the error message is different:

    Yes, here are my questions. What wrong? Where can I call this java code little success.

    I know, it s possible to run code without additional jar files. I am interested to implement more than java classes in a jar file for future needs, and this is a first step.

    Greetings Naatz Maic

    Hello

    UH... Let's get a few things right if you don't mind.

    Your class is valid, as you say, you tested with Eclipse, which is a fair way to go. You have two methods, 'main' and a private static "verifyCC" returning an int value. Good. Now, if I take a quick glance at your UCCX script I see some interesting things there. First, you create a new variable of type ClassCheckCC, with the name CheckCC and with null as default. Cool, that's like saying JRE of UCCX for "Hey, let's use a new variable of type ClassCheckCC", or more precisely:

    ClassCheckCC CheckCC = null;

    Alrighty. Then, you kind of try to value of isValid saying CheckCC (ccnumber). Why it's wrong: in Java, it does:

    isValid = CheckCC (ccnumber);

    You see already? The above code actually means:

    isValid = null (ccnumber); Not valid!

    CheckCC is null.

    Let's try a slightly different approach:

    public class CheckCC {}
    Public Shared Sub main (String [] args) {}
    System.out.println ("Move along, nothing to see here, call verifyCC (String s) instead. ');
    }
    public static int verifyCC (String ccnumber) {}
    int sum = 0;
    Boolean alternate = false;
    Boolean isValid = false;
    try {}
    int i = 0;
    for (I = ccnumber.length () - 1; i > = 0; i--) {}
    int n = Integer.parseInt (ccnumber.substring (i, i + 1));
    If {(acting)
    n = n * 2;
    If (n > 9) {}
    n = (% n 10) + 1;
    }
    }
    sum += n;
    Alternate =! alternate;
    }
    isValid = (sum %10 == 0);
    } catch (Exception e) {}
    Returns - 1;
    }
    return (isValid == true? 1: 0);
    }
    }

    You may have noticed that I made a few adjustments. I renamed ClassCheckCC to the simpler CheckCC, I changed the method of verifyCC to the public modifier. It's actually a great example of a utility class where you have not all instances, so we should let JDK code optimization.

    Using this approach, we don't need to create instances of the object - that they are unnecessary in this case. Simply call CheckCC.verifyCC (String aString) is quite sufficient. We can, as I will demonstrate, but then again, why should create us instances of the class each time a script is run.

    The following three constructs are valid (assuming that I have created the necessary variables: val, validCCNumber, and invalidCCNumber):

    Valid value = CheckCC.verifyCC (validCCNumber)

    Pure and simple. I simply call the static verifyCC method on the CheckCC class with a parameter.

    The valid value = {return CheckCC.verifyCC (invalidCCNumber) ;}

    I just padded the single line above with braces, creating a block of code, point comma and the return keyword became necessary.

    The valid value = {CheckCC instance = new CheckCC(); return instance.verifyCC (validCCNumber) ;}

    Now, it's quite redundant but functional example. I created an instance of the CheckCC class, named instance and then ran the method verifyCC on the newly created class instance. Once again, it is a situation when a developer is boring and has nothing better to do than to create instances of the class and sending them to the eternal bytefields.

    G.

    Here is a screenshot:

  • External javascript file in the page login.html Campus Mobile

    Hello


    We try to load an external javascript file of Mobile Campus of Oracle application login.html page.  The code works in the Android app, but not the IOS app.  Here is a code snippet:

    Can you offer any help on how we can get the javascript code to load correctly for iOS?  The code is not local to the application is because we're going to make changes so that it displays various messages on the login page at different points throughout the year.

    Thanks for any help you can provide!

    Just wanted to give everyone an update and let you know that we have understood the question.

    in the file Application.xml - MAF, we added our URL to the white list (Security tab).  This allowed the application to invoke successfully the javascript code for the external file.  I hope it is useful to someone, as it seems to help others / Oracle support on this forum is unlikely.

  • With the help of APEX_JSON translated by JavaScript and escape the quotes

    I am currently generation JSON using the APEX_JSON package.  It works fine, but I got out the JavaScript code on the loading of the page and can not find a way to escape the double quotes.

    function drawChart() {
    
    
            var jsonData = &P9_JSON.;
    
    
            var data = google.visualization.DataTable(jsonData);
    
    
            var options = {
              title: 'Test Chart',
              pieSliceText: 'value'
            };
    
    
            var chart = new google.visualization.PieChart(document.getElementById('piechart'));
    
    
            chart.draw(data, options);
          }
    

    I'm getting errors because "is replaced by & quot;" in the javascript code generated.  Any ideas how to replace these?  I tried to use to replace them, but it doesn't seem to work...

    Thank you!

    Hi LSDev

    Replace this line--> var jsonData = & P9_JSON. ;

    To--> var jsonData = & P9_JSON! RAW. ;

    This work for me...

    Best regards

    Eduardo

  • Integrating Javascript functions in the HTML file generated from Adobe Muse

    I have a HTML file, CSS and js files generated by the tool Adobe Muse. Each button is clicked, I want to call a Js function and must do the same. I want to know how to integrate the Javascript code in the HTML file generated from Adobe Muse. My HTML file generated from Adobe Muse is shared below.

    http://pastebin.com/wDrWEmm6

    This will not happen because internal code must be confidence... you can link to a database if you have a server to host it and Adobe BC is the simple solution but none of the 3rd party site hosts will rent you space.

  • Can I add javascript customized to the generated Web page of Muse?

    I assess the ability of Muse and would like to know: can I insert javascript customized to the generated Web page of Muse?

    Our site desktop and mobile needs to communicate with the back-end web service via REST and have front end JSON data visually. But I can't find any instructions in Muse, is he able to do these things?


    Where can I find a complete reference manual for all the function but not fractional files video only?


    It is not documented as it would be a custom implementation, but you can go ahead and test the appeal of the order through REST using javascript.

    Personally not tried but it should work.

    Thank you

    Sanjit

  • What is the code at the top of new pages?

    DW insert this code at the top of new pages:

    < ! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional / / IN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > ""
    " < html xmlns =" http://www.w3.org/1999/xhtml ">

    A reason for it?

    Most of my inner pages of my site didn't do it in fact.

    All pages should have doctype if they are supposed to conform to w3 standards.  I suggest to try this link and if you still have questions, you can post back:

    http://www.w3schools.com/tags/tag_doctype.asp>

    HTML5 is a simple way to set the doctype, but I suggest you stick with what you get in the Dreamweaver until you are ready to learn something new about html5.  DW CS4, 5 and 5.5 have an extension to work with html5, but you should have a firm grasp of the current html because it's the Foundation of html5.

    HTH

  • Code generated JavaScript clock via the shared components?

    Hello :)

    I inserted a javascript code in my foottext in the section of page of page rendering.
    If I turn the page a text clock appears in the footer.

    I want to have is that I can put this javascript in a shared component article.

    I did it with my name of the application as the picture.
    Appears on all pages in the same place.

    Can I put this javascript somewhere in the same way?

    TNX
    Cara

    Hello Cara,

    You can use Page 0 to do this, how that it is placed in Page 0 will be used on all pages.

    Concerning

    Paul

  • I want to change the URL of a bookmark to JavaScript code, specifically Phantom Limb. How can I do this?

    I take a class of building mobile app & trying to save the JavaScript for Phantom Limb as a bookmark. I found how to chrome and replace the URL with the code, but I am unable to do that in FireFox. This is a simulator of touch screen for desktop computers, so it's something I want, but can't understand. Please notify.

    Is the problem with creating the bookmarklet, or by running successfully?

    You can create a bookmarklet by right-clicking on the toolbar bookmarks, new bookmark, then paste your code into the location.

    If there are problems running, try to open Firefox browser Console (Ctrl + Shift + j). Click on the clear button to declutter, then try your bookmarklet and see if it generates error messages.

Maybe you are looking for

  • Loading library question in FCPX

    Thank you very much for taking the time to look at this post.The prospects are much appreciated. A library where I worked on last month has suddenly stopped working and does not allow me to access, causing FCPX beachball constantly. The library has w

  • Win Vista 32 bit to windows 7 64 bit how to backup bookmarks firefox, passwords?

    Currently on Vista 32 bit OS. Using HDD COSTS I run Windows 7 64-bit... You want to save all about external hard drive to the new HARD drive. FIREFOX passwords, bookmarks, cookies, maybe even of the parameters? (1) able to backup 32-bit firefox tips

  • boot from cd to 3480

    Hello I have a 3480 with a PCMCIA cdrom and try to start from what is - anyone know if it's possible? If it is not possible does anyone know how to reinstall the operating system if you do not arrive within the operating system Windows (forgotten pas

  • ' does not ' after you type a few characters

    I use the latest version (7.17.105). After I typed a few characters, Skype is in the State "is not responding. It blocks everything in a few seconds. It happens again and again. What Skype did with it? It's a mess now!

  • HP Pavilion 14-v062us: 14-v062us Pavilion market reset password

    I'm trying to update an old laptop (Pavilion 14-v062us) for a local company.  Unfortunately, the employee who used the system already set up a password turning on and not left no notes on the password. is it possible to reset this password? Thanks in