Attaching an action to a button in Javascript

Hey guys,
I'm playing around with attaching an action to a button in javascript but I'm just not getting it
I've tried putting it into a function like so
function deleteSwatches () {
    = app.doScript("Delete Unused Swatches", "Custom Art Actions");
Then calling the action with said function but it doesnt respond.
Any ideas?

Try this:
!!! CS6 required
var w = new Window('dialog', '');
btnProd = w.add('button',undefined,'Delete unused swatches');
btnProd.onClick = function() {
    //alert ("Delete, if your action with the defined name is available !AND! CS6 required")
    deleteSwatches ()
w.show();
function deleteSwatches () {
    app.doScript("Delete Unused Swatches", "Custom Art Actions");
Otherwise looking for a John Wundes script, which do the same.
Have fun

Similar Messages

  • Can't attach action to a button?

    This is a newbie question. I've made an animated button and
    it plays back just as I want it to when preview it, but when I
    choose it on the stage and try to attach an action to it (goto
    frame etc) "I get a message that says Current selection cannot have
    actions applied to it"
    I'm stumped. I mean, it's a button, so you have to be able to
    attach functionality somewhere, but how?
    Thanks!

    Chances are your file is set up for AS3, which will not allow
    code to be attached to objects (AS2 does). All code for an AS3 file
    must be placed on the timeline.

  • How can I attach a PDF in an email, using javascript in PDF document?

    How can I attach a PDF in an email, using an interactive button in the PDF-document?
    I tried to create a form button with the menu action 'attach this PDF in an email'.
    This Send.to-action doesn't work with Microsoft.
    Does anyone has a solution by implementing a javascript-code for this in the PDF?

    Dick,
    Thanks for your replie.
    Nice alternative, but it still doesn't work on a Windows machine when the
    mail software from Microsoft doesn't react on PDF actions.
    You can do many things in Acrobat, but it is a problem when it doesn't work
    on Windows and iPad.
    So now I am looking for alternatives like  interactive magazine software
    (based on html5).
    2012/5/11 dick the flash <[email protected]>
       Re: How can I attach a PDF in an email, using javascript in PDF
    document?
    created by dick the flash <http://forums.adobe.com/people/dicktheflash>in
    JavaScript - View the full discussion<http://forums.adobe.com/message/4395927#4395927

  • Single form Multiple Actions based on button click

    Hi,
    I have to call two different actions based on button click from single <form > .
    How to achive this?.
    Thank you

    Hi,
    I am using struts <html:form> and my code is as follows
    <script language="javascript">
              function setAction(val){
         if(val==A){
                   window.open(document.forms[0].action="preview.do");
         }else if(val==B){
         document.forms[0].action="create.do";
              document.getElementById('fcreate').submit();
    </script>
    <html:form action="/create.do" >
    <html:text property="name">
    </html:form>
    action is mandatory for <html:form>
    Its not sending the form elements, when I click the preview button.
    Create button works fine. In struts-conig, I have taken same form name for create and preview actions
    Please give me some tips
    Thank you

  • Run PLSQL code by click on button usin javascript

    Hi
    I want to run plsql code
    on click button using javascript
    javascript is ok but code of plsql is not run
    suggest me
    APEX 4.2.1
    Oracle !!XE
    Windows Server
    Firefox 17.0.1
    Theme Cloudy
    thanks in advance
    bUTTON CODE IN PLSQL CODE AND SEND_RMNDE IS PROCEDURE
    '<button type="button" name="button1" onclick="send_rmndr('
    ||NO_DUES_MASTER.CERT_ID
    ||');" value ='
    ||NO_DUES_MASTER.CERT_ID
    ||'> '
    ||'Remind'
    ||'</button>'
    JAVASCRIPT
    <script type="text/javascript">
    function send_rmndr(pThis)
    var params='x= '+pThis;
    var get=new htmldb_Get(null,null,null,&APP_PAGE_ID.,null,'send_reminder',params);
    gReturn = get.get();
    //alert(gReturn);
    alert ('inside script ' +params);
    //get=null;
    </script>
    Edited by: 969091 on Feb 1, 2013 9:13 PM

    send_reminder needs to be defined as an application process
    Alternatively, you can define a dynamic action and do this more declaratively.
    It's easy to define a DA that fires on click of a button that runs PL/SQL, and you can also define which page items are sent to and received from the plsql via session state.
    Scott
    blog: [url grassroots-oracle.com]grassroots-oracle.com
    twitter: [url twitter.com/swesley_perth]@swesley_perth
    -- please mark any useful posts as helpful or correct, in the end it helps us all

  • Not able to call action of a button

    Hi All
    RIght now i am facing a very strange issue.
    In my applictaion if on my page i drop a buttion and add action for that button.
    If i add a SOP(System.out.println()) in that action i am able to see that in my back end means action is called. But on one specific page when i add a button and add action its not working.
    I am not able to see the SOP on a specific page means action is not called.
    Any idea why button on that specifci page is not called ?
    Thanks in advance,
    Vikas

    Which page?
    Which jdev version?
    Which UI technology you are using?
    What's the difference to the other pages?
    How do you get to the page in question?
    Timo

  • Add action to a button

    Hi everybody,
    i�m a beginner programming JAVA. So i think the question will be so easy.
    How can I add an action to a button created on a container???
    i.e. i want that when pressing the button, a word document can be opened.
    thank you very much in advance.

    hi,
    you need to add a listener to the button such as an actionlistener:
    JButton button1 = new JButton();
    button1.addActionListener(new buttonListener());
    //  This should be an inner class
    class buttonListener implements ActionListener() {
       public void actionPerformed(ActionEvent e) {
         System.out.println("Event generated!");
    }you an use an inner class to handle the event, pass the addActionlistener an object of the inner class, the inner class here should implement the actionlistener interface which has the actionPerformed method. You need a listener, best place to find one is the API.

  • HT1430 my very new iphone5s will not turn on its as if the button no longer works is there any additonal swiping actions or hidden buttons i may have triggered accidently it is barely 2 weeks old and has no obvious signs of wear............not impressed A

    my very new iphone5s will not turn on its as if the button no longer works is there any additonal swiping actions or hidden buttons i may have triggered accidently it is barely 2 weeks old and has no obvious signs of wear............not impressed APPLE

    im hoping that by holding both the power and circle buttons it will spring back to life ..........somtimes apple you are too clever with your secert hidden butttons switches

  • Creation of UI Element on the action of a button?

    Hi,
    Can we create some UI Element on the action of some button, i.e. writing code to create UI Element outside the wdDoModifyView() method of the view?
    Regards,
    Smriti.

    Hi,
    We can create an UI element dynamically, on button click action..Follow the steps given below:
    1. Create a static variable say ' myvar ' of type com.sap.tc.webdynpro.progmodel.api.IWDView in last declaration part(ie. inside //@@begin others //@@end.
    Eg: static IWDView myview;
    2. 2. In wdDoModifyView(), add the following
    myview=view;
    3. Now add the following code in the "OnAction<Submit>" event to create an UI element dynamically:
    IWDTransparentContainer rootContainer = (IWDTransparentContainer)view.getElement("RootUIElementContainer");
    IWDLinkToAction Link1 = (IWDLinkToAction) view.createElement(IWDLinkToAction.class, "Link1");
    rootContainer.addChild(Link1);
    Hope it helps!!!
    Regards,
    TFG - Kumara Guru

  • Associating two events with submit button using  javascript in jsp

    Hi
    How can i Associate two events with submit button using javascript in jsp. Firstly it should insert the data to database and secondly it should close the same pop-up window

    Have something like :
    <input type="submit" name="submitbtn" value="Click me" onClick="function1(); function2(); " />
    You just call both functions sequentially, it's that simple. Although using javascript to work with a database, that seems a bit tricky.

  • Delete Attachment link and the launchWebdynpro button in the UWL iview

    Hi,
    Can anyone help me in deleting or hiding the Attachment link and the launchWebdynpro button in the UWL iview. I dont want to do it in the iview properties which would affect all the tasks. Is there a way I can do it in the backend.\
    I appreciate the help.
    Thanks

    Hi Surjith,
    I have the same problem. How can I remove the link? After I called the mentioned function module, the attachment was removed (content) but in the UWL the file name is still there:
    From UWL:
    myFile.pdf by WF-BATCH (94 kb)
    myDeletedFile.pdf   <-- I removed this one with the function module
            CALL FUNCTION 'SAP_WAPI_ATTACHMENT_DELETE'
              EXPORTING
                workitem_id     = me->mv_wf_instance_id
                att_id          = ls_att_id
                delete_document = abap_true
              IMPORTING
                return_code     = lv_return.
    Could you please help me?
    Thanks,
    Thomas

  • Can we perform two actions with one button with two clicks one after other?

    Sir,
    can we perform two actions with one button with two clicks one after other?
    I want that when I click an Add Button first time it add data to the database and when I click again this button it clear the form data to empty fields.
    Regards
    Tanvir

    In code it should be easy.
    The following code adds a button called butman with a text "ADD".
    It then registers a listener that will be called if the button is clicked.
    This listener then calls the runAddData method if you clicked on butman while it contained the "ADD" text and it will call the runClearData method otherwise.
    Therefore it will swap the button's functionality between ADD and CLEAR on every click.
    final Button butman = new Button("ADD");
    butman.setOnAction(new EventHandler<ActionEvent>() {
              @Override
              public void handle(ActionEvent t) {
                        if (butman.getText().equals("ADD")) {
                                  butman.setText("CLEAR");
                                  runAddData();
                        } else {
                                  butman.setText("ADD");
                                  runClearData();
                        } // END IF-THEN
              }});I hope this is what you wanted.
    Some extra food for thought.
    You might want to run the ADD and CLEAR methods in their own threads so that it can run in the back ground, without slowing down your user interface.
    I also like to rather reuse one button for multiple functionality in stead of making an application with hundreds of nodes only used rarely with masses of code to show and hide them if needed.

  • Disable button using javascript

    Hi,
    I'm sorry if this is a relatively simple problem, but I have tried several things and have searched the forum, but still no luck!
    I am trying to get a button in a form to be disabled or hidden on loading the page and only to become enabled or shown once an 'onclick' event occurs. I already have a javascript function running successfully on the 'onclick' event, so there is no problem with that.
    Preferably I would like the button to be template driven, but I realise that disabling/hiding it may only be possible with an HTML button.
    I have tried the following JavaScript, but it appears to do nothing:
    document.getElementById('P6_OK').disabled=true;
    $x_HideItemRow('P6_OK');
    If the JavaScript is ok it is probably the way I am implementing it into the HTML.
    Thanks
    Lucy

    Hi,
    I'm still having troubles with this (see above). If anyone has successfully managed to disable a button using JavaScript I would be interested in how they did it.
    To clarify, I have tried the following two pieces of script, among others:
    (1) document.getElementById('P6_OK').disabled=true;
    (2) $x_HideItemRow('P6_OK');
    I have read quite a few forum links and followed what others have done, but in vain.
    Thanks for your help
    Lucy

  • Hide an HTML button using javascript

    Hi,
    I need to hide an html buttton using javascript. I have an radio button with values "YES" and "NO". If is select NO then i need hide the button without refreshing the page. Can anyone suggest me how to hide an button using javascript.
    Thanks
    Prashanth

    Prashanth,
    The exact solution will vary based on a few factors. The basic idea is to place an event handler on the radio button item that calls a function to hide/show the button. You might also want to call that function when the page loads too.
    If you put an example page on apex.oracle.com and provide the workspace/username/password I'll take a look. You can create a new account for this purpose.
    Regards,
    Dan
    Blog: http://DanielMcGhan.us/
    Work: http://SkillBuilders.com/

  • Accessing Properties of Individual Tool Buttons via JavaScript

    Hi all!
    I am new to both this forum and scripting Acrobat so please excuse me if the question sounds naive.
    I am trying to find a way to access the properties of individual tool buttons via JavaScript (if there is one). I could not find it yet in JS API Reference. If anybody can help me or direct me to the right way, I will greatly appreciate that.
    For example, in 'Comment & Markup' toolbar one can right-click and change the 'Tool Default Properties' of various markup tools like Highlighter, Line, Rectangle etc. Is it possible to access these properties through JavaScript so that buttons can be added for dynamically changing these? Hope this makes sense!
    Thanks in advance for your interest and help.
    John.

    Hi Andy, thanks for the answer. It was pretty simple - I just added an authorization scheme to the report column, wehre the javascript is executed. Christof

Maybe you are looking for

  • Meaning of Fields in SXMB_MONI

    Hi All, I have some confusion about the information displayed in transaction SXMB_MONI. Can you help to confirm whether my understanding is correct? 1. In synchronous scenario, one typical Caller -> XI -> Callee procedure will have 4 messages logged

  • How to notify in case SQL query(JDBC sender adapter) does not fetch records

    hi, How can we notify(by alerts or something) in case SQL query(JDBC sender adapter) does not fetch records? In channels logs it only says processing started & finished(no message is created for same). Thanks, Mayank

  • Uwl Attachment not rendering

    Hi expets, When trying to open attachment of an work item(which is a pdf) the system opens a transaction and generates pdf and saves it in the local path c:\documents and settings\user2\test.pdf but while trying to open it trys try's to open the path

  • Problem with HTML code wich is transforming by RH

    Hello I would like to know if there is a way to stop the transformation that Robohelp does in the html code. For example: I write in the html editor : <div id="footer"> bla bla bla </div> I go back to the Conception editor to work, then, when I go ba

  • CPC2206 by calling a external command

    Hi, we have one SAP installation which is not able to call an external command that is configured in the transaction SM69. For example we have created an command ZWRKWTR that call the command WRKWTR. When we try to execute the command via SM49, we re