Adding a button by clicking on a "Add button" button

Hi,
I want to add dynamically button controls on my application. These buttons will be created when the user click on a "Add button" button.
What command should I use to get that result ?
Using <mx:button...> into the [[CDATA... doesn't work and all the trys I did based on what I grabbed on the net didn't run neither.
Thanks a lot for any input.
Loic

Hi Greg,
Thank you for your great input.
However, Flex throws an error when I try that.
var btn:Button = new Button(); > "This type can't be found or isn't a compiling constant" (Frenglish translation sorry)
I am using patchpanel technology and here is the code. Maybe this is because I want to mix both import com.adobe.cs3.InDesign and mx.controls.* stuff ?
Here is my code so far if it can help understanding :
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="325" height="254" creationComplete="onCreationComplete()">
     <mx:Script>
          <![CDATA[
               //Importe le DOM Indesign
               import com.adobe.cs3.InDesign.*
               import mx.controls.Alert;
               import mx.controls.Button;
                    Fonction appelée quand l'utilisateur appuie sur le bouton 'start'
               public function onClick():void
                    // Creation d'un bouton
                    //myButton = new Button();
                    //yButton.label = "Hello world !";
                    //InDesign.alert("ttt");
                    var btn:Button = new Button();
                  btn.label = "New Button";
                  btn.addEventListener(MouseEvent.CLICK, clickFunc);
                  vb.addChild(btn);
               private function clickFunc(evt:MouseEvent):void{
                    mx.controls.Alert.show(evt.currentTarget.toString());
                    Fonction de recadrage du fichier swf après son initialisation
               public function onCreationComplete():void
                    InDesign.$resize( width, height);
          ]]>
     </mx:Script>
     <mx:Button x="135" y="119" label="start" click="onClick()"/>
     <mx:Button label="Add Button" click="addButton();"/>
       <mx:VBox id="vb"/>     
</mx:Application>
Thanks anyway for your first input and hoping you could help me fixing that issue.
Regards,
Loic

Similar Messages

  • Unable to add a printer. When I click on the "Add Printer" button, nothing happens.

    I have IE9 on Windows 7 PC.  I have compared my Internet options with another PC and it does not seem to have this issue. Any suggestions?
    NOTE: Please don't suggest changing browsers.  That is a work-around not a solution.
    Thanks

    Hi,
    Clicking the Add a Printer actually not much related with any web browser but more with the operating system functionaity.
    I would suggest you to try updating windows by running Windows Update, reboot the PC and check for any change.
    Also make sure the Print Spooler Service is running:
    Click the Start button and typr run into the search box.
    Open the Run Application within the results.
    Type net start spooler, then click OK
    You should see a black dialog for a single moment.
    Next go to Control Panel > Devices and Printers and try adding a printer again,
    If the option still not function  I would recommend you to contact Microsoft support as the problem relies within the operating system and not within the HP software.
    Regards,
    Shlomi
    Say thanks by clicking the Kudos thumb up in the post.
    If my post resolve your problem please mark it as an Accepted Solution

  • Issue with empty value of LOV of first row after clicking on add row button

    JDeveloper 11.1.14
    I have a page with table-form layout.
    In the form I have two detail tables on the same page (tabbed).
    I have an issue with using model-choicelist LOV's in the detail tables.
    I am able to add a new row in the detail table, select a value from the model-choiceList LOV (which is required) and save the new row.
    After adding another row in this table the value of the model-choiceList LOV in the previous row is suddenly empty on the screen. It is not empty in the database,
    I have checked it in the datbase. Only the value of the LOV of the first row on the page is being cleared after clicking on the add row button.
    After saving the new row I get the following error on the screen:
    Error: a selection is required. --> first row
    Does anyone have a suggestion how to solve this issue?

    After adding another row in this table the value of the model-choiceList LOV in the previous row is suddenly empty on the screen. It is not empty in the database, Is the complete LOV blank or only the selected value .. can you try putting autoSubmit=true in the LOV and try ? Also check if you have any partialTriggers on the LOV from the add button ?

  • Page loss at the click of add new button in advanced table

    Have created an advanced table and when I click on the add row button for the first time it results in page loss issue. But if I query and then click on the button it works fine.
    AM code:
    public void initialize()
    OAViewObject vo = (OAViewObject)getXxutlDomainsVO();
    if (vo.getFetchedRowCount() == 0)
    vo.setMaxFetchSize(0);
    public void createDomainSetupData()
    OAViewObject vo = (OAViewObject)getXxutlDomainsVO();
    if (vo.getFetchedRowCount() == 0)
    vo.setMaxFetchSize(0);
    Row row = vo.createRow(); vo.insertRow(row);
    row.setNewRowState(Row.STATUS_INITIALIZED);
    CO:
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    OAApplicationModule domainSetupAM = pageContext.getRootApplicationModule();
    domainSetupAM.invokeMethod("initialize", null);
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule domainSetupAM = pageContext.getRootApplicationModule();
    if ("DomainsAdv".equals(pageContext.getParameter(SOURCE_PARAM))
    && ADD_ROWS_EVENT.equals(pageContext.getParameter(EVENT_PARAM)))
    domainSetupAM.invokeMethod("createDomainSetupData", null);
    Please help

    Hi,
    There are two ways to do it.
    1. Use create method of entity object, create method fires whenever you creates new row.
    2. Handle the event raised by addanotherrow button and write logic there to initialize contactid as you are getting contactid from pageContext so I will suggest you to use this method.
    if (tableBean.getName().equals(pageContext.getParameter(SOURCE_PARAM)))
    && ADD_ROWS_EVENT.equals(pageContext.getParameter(EVENT_PARAM)))
    //write your logic here to default the contact id
    Hope this will help.
    Regards,
    Reetesh Sharma

  • 2 table rows - one "Add Row" button

    I am a novice, not alot of training with javascript.
    I need 2 table rows added to a table without having multiple "add row" buttons. I would like to be able to add both rows with one button.
    right now the button is set for the most current row:
    Table1._Week.addInstance(0);
    the row above is Table1._Codes
    How do I script this in order to have both rows appear when the Add Row button is selected?

    Hi,
    A couple of things without benefit of seeing the form.
    Are the repeating rows called:
    'Week' / 'Codes'?
    OR
    '_Week' / '_Codes'?
    The underscore '_' is shorthand for instanceManager, which is used to call the addInstance. If I assure that the repeating rows are just 'Week' / 'Codes' then the following javascript in the click event of the button should work:
    Table1._Week.addInstance(true);
    Table1._Codes.addinstance(true);
    This should add a row to each repeating row in one button.
    Please note that the parameter for the addInstance is either 0 (false) or 1 (true), which relates to whether the row will be data merged with the form.
    Hope that helps,
    Niall
    hmmm, see you have another thread on this: add multiple rows with add a row button ???

  • HT5057 There is no Add Money button in iTunes or App Store account page

    I've tried adding money to my iTunes account on my PC and on my iPad but can't find out how to get to the page. I've followed the instructions that Apple provided online, but their instructions to navigate throught to my Account page and click on the Add Money button is incorrect. There is no button on either the computer (iTunes) or the iPad (App Store).
    How can I add money to my account?????

    sherrynick wrote:
    On iPhone I am prompted to update say 5 apps. When I hit update all it prompts me to type password. The problem is it is an old iTunes ID
    Anything Downloaded with a Particular Apple ID is tied to that Apple ID and Cannot be Merged or Transferred to a Different Apple ID
    Apple ID FAQs  >  http://support.apple.com/kb/HT5622

  • The Add Printer button on the eprintcenter website on my screen is not working.

    I just registerd on the eprintcenter.com site and now I am trying to click on the +Add Printer button/icon to add my printer and it is not working. I have tried it in all different web browsers and it doesn't take me anywhere on any of the browsers. Sometimes I get the "javascript&colon;void(0)" message down in the left hand bottom portion of my screen when my mouse goes over that button. What is wrong? Is it your site or my computer?

    I'm having same problem

  • How to add a button to the toolbar in transaction MIRO

    Hi, I wanna know if some1 could tell me how can I add a custom button in the standard toolbar of transaction MIRO.
    The client have the lastest version of SAP so I have enhancement point to add the functionality of the button, but how can I add the button without registering the object in the OSS.
    Thx.

    Hi Siva,
    Create one custom program Eg:zxyz activate it. Now open se80 give program name:SAPMV50A and open gui status.
    In GUI Status right click on 'W0' copy it to custom 'ZW0' and the custom program name which created first.
    Now goto your custom program and write
    double click on 'ZW0' and create your custom button in application toolbar.
    activate it and activate your program.
    Now come to stander program SAPMV50A open screen 1000.
    in moduel  'initialisieren' double click on perform cua_setzen.
    again double click on module initialisieren and by using enhancement framwork functionality implement the below logic.
    Finally you will get the button in application toolbar.
    Reward if it is help full.
    Regards,
    Quddus.

  • Add People button results in "You have labeled everyone in your selection"

    Hopefully there's a solution out there that I simply failed to find.
    I am using PSE11 20120830.r.32025
    When I click on the "Add People" button under the "People" tab in the Organizer, normally the program would show a dialog box, "Preparing files...", then show either faces it doesn't recognize for me to tag, or show a window with known faces on the left and potential matches on the right for my to verify.
    However, lately when I click on "Add People", it still shows the "Preparing files..." dialog, but then it brings up a windows saying "You have labeled everyone in your selection".
    This is obviously not true, since I can go through the majority of my pictures that do no have the faces tagged (most show the "Who is this?" box where the name would normally show.
    This happened to me before, and I started a brand new catalog to see if the old one had just gotten corrupted, but here I am again, stuck.
    Please help!

    Go to Edit >> Preferences >> Media-Analysis
    Make sure the box for people recognition is checked.
    Otherwise click the Media Tab and make sure you are showing all media. Then, without selecting any thumbnails, try again and leave Elenents to complete the indexing.

  • Add Image button on Gumtree unresponsive.

    Whenever I try to post an ad on gumtree, I go to click on the "Add Image" Button and all it does is take me back up to the top of the screen. Doesn't refresh page or anything, just takes me back to top of page.
    Any ideas? It's frustrating having to use a different browser just for that.

    I assume you already tried making an exception for the site in Adblock Plus... since the problem relates to ads...
    ''Did this feature ever work in Firefox?'' If so, you could try clearing your Firefox cache and your saved cookies for the site. (Steps for that are listed below.)
    ''If that button never worked in Firefox,'' have you considered possible interference by add-ons? You could test whether Firefox can work with the site when your extensions are deactivated by opening the site in Firefox's Safe Mode. (Steps for that are listed below.)
    When you have a problem with one particular site, a good "first thing to try" is clearing your Firefox cache and deleting your saved cookies for the site.
    (1) Bypass Firefox's Cache
    Use Ctrl+Shift+r to reload the page fresh from the server.
    Alternately, you also can clear Firefox's cache completely using:
    orange Firefox button (or Tools menu) > Options > Advanced
    On the Network mini-tab > Cached Web Content : "Clear Now"
    If you have a large hard drive, this might take a few minutes.
    (2) Remove the site's cookies (save any pending work first). While viewing a page on the site:
    * right-click and choose View Page Info > Security > "View Cookies"
    * Alt+t (open the classic Tools menu) > Page Info > Security > "View Cookies"
    In the dialog that opens, you can remove the site's cookies individually.
    Then try reloading the page. Does that help?
    Trying Firefox's Safe Mode is a standard diagnostic technique to bypass interference by extensions (and some custom settings). More info: [[Troubleshoot Firefox issues using Safe Mode]].
    You can restart Firefox in Safe Mode using
    Help > Restart with Add-ons Disabled
    In the dialog, click "Start in Safe Mode" (''not'' Reset)
    Any difference?

  • I can't use the Mark Face or +Add People buttons in PSE11 or PSE12

    Hi,
    I'm really struggling with this as I thought this would be a very important feature for me, one reason I am trying to make PSE 11 work for me rather than Lightroom. When I click on the Mark Face button I get a pop up that says "People Analysis has yet to beperformed on the selected media. Would you like to start the analysis now?" When I click Yes, something pops up for less than a second, so fast I can't read it. I can tell there is a bar with what is maybe 0% to the left and 100% to the right. And that is all that happens. If I click on the +Add People button, same thing. If I right click on the picture I can select Add a Person, and then type in a name and I can add people tag that way. Not what I really want to do. The Mark Face funtion worked for about 50 picturesandthen stopped, I don't know why.
    Things I have tried:
    Optimize catalog.
    Repair catalog,
    renaming BreezeSession.dat to BreezeSession.old
    I downloaded PSE 12 and am in the first day of my trial. The Mark face function worked for the first picture and I thought I had my solution! On the second picture it is now doing exacttly as before.
    Any insight would be appreciated. I guess I could live without this feature but it is onethat I think I would really use.
    Thanks,
    -AJ

    Hi 99jon,
    Thanks for the reply. Selecting multiple thumbnails and clicking the +Add People button on the bottom toolbar results in the same problem. I get a popup for a brief instance and that's it. It lasts a fraction of a second. After repeated clicks I thinnk it says "Analyzing your media" or something to that affect.
    -AJ

  • Wan to add push button in the output of ALV Grid display.

    Hi Friends,
    I wan to add a Push button in the output of ALV GRID display with STANDARD ikons.
    How to copy standard ikons of GRID output.
    How to apply the copied status into my code.
    Regards,
    Viji

    Hi,
    Goto SE41, create a pf-status for your alv report program.
    On the next screen, click menu EXTRAS --> click option ADJUST TEMPLATES and select radiobutton LIST VIEWER --> you will get all standard buttons of alv in the pf-status.
    Delete the unwanted buttons and also you can add new buttons if reqd.
    Activate pf-status --> and apply in alv program.
    Now to apply this pf-status in your alv report follow code:-
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         i_callback_program                = v_rep_id       " report id
         i_callback_pf_status_set          = 'PF'           " for PF-STATUS
         i_callback_user_command           = 'USER_COMMAND' " for User-Command
         is_layout                         = wa_layout      " for layout
         it_fieldcat                       = it_field       " field catalog
         it_sort                           = it_sort        " sort info
        TABLES
          t_outtab                          = it_final      " internal table
       EXCEPTIONS
         program_error                     = 1
         OTHERS                            = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    *&      Form  pf
    *       SUB-ROUTINE PF IS USED TO SET THE PF-STATUS OF THE SCREEN
    *       ON WHICH THE ALV GRID IS DISPLAYED
    *       -->RT_EXTAB
    FORM pf USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS 'ZTG_STAT'. "<--pass pf-status name here
    ENDFORM.                    "pf
    *&      Form  USER_COMMAND
    *       SUB-ROUTINE USER_COMMAND IS USED TO HANDLE THE USER ACTION
    *       AND EXECUTE THE APPROPIATE CODE
    *      -->LV_OKCODE   used to capture the function code
    *                     of the user-defined push-buttons
    *      -->L_SELFIELD   text
    FORM user_command USING lv_okcode LIKE sy-ucomm l_selfield TYPE slis_selfield.
    * assign the function code to variable v_okcode
      lv_okcode = sy-ucomm.
    * handle the code execution based on the function code encountered
      CASE lv_okcode.
        WHEN '<function_code>'. "<--to handle user actions
      ENDCASE.
    ENDFORM.                    "USER_COMMAND
    Hope this helps you.
    Regards,
    Tarun

  • Firefox 36 has broken the "Add Exception" button for self signed certs

    clicking on the add exception button does nothing now in version 36, I had to roll back to 35.0.1

    HI ringnjc,
    It will depend on the type of self signed certificate. An example url will help better investigate.
    However recently, CA 1028 bit RSA certs were phased out in version 36. In order to make sure that the certificates are compatible:
    *[https://www.mozilla.org/en-US/about/governance/policies/security-group/certs/policy/ Mozilla CA Certificate Policy
    Version 2.2]
    [https://blog.mozilla.org/security/2015/01/28/phase-2-phasing-out-certificates-with-1024-bit-rsa-keys/]

  • How do you tell if the first mouse button or the 2nd mouse button is clicke

    Hi guys,
    I need to figure out if the first mouse button is clicked or the 2nd mouse button is clicked.
    it seems that there is a method that is suppose to return an integer value dpeneding on what button is clicked but I printed out what is being returned and it seems it keeps printing out 0 for both the first and second.
    Here is my code:
      private void initMouse()
              addMouseMotionListener
             new MouseMotionAdapter()
                public void mouseDragged( MouseEvent event )
                    System.out.println("event:" + event.getButton());
                    if(event.getButton() == MouseEvent.BUTTON2)
                        brushColor = Color.LIGHT_GRAY;
                        System.out.println("Button 2 pressed");
                    else
                       // System.out.println("nope");
                   xvalue = event.getX();
                   yvalue = event.getY();
                   repaint();
            }Even when I compare to the constants event.MOUSEBUTTON1 its never true nor is MOUSEBUTTON2, what am i doing wrong here?
    THanks

    there are a number of ways, here's one of them
    SwingUtilities.isRightMouseButton(event)//<---'event' is from your code)

  • Message popup add more buttons than six

    Hi,
    On TestStand 4.2.1, I encounter a limit of 6 buttons. 
    How can I add more buttons ?
    Or, can I replace message popup by list ?
    Thank you 

    Hi,
    Have you thought of using LabVIEW to create something?
    I have attached a simple VI that you can pass an array of string data from TestStand to LabVIEW..
    Regards,
    Shane.
    Attachments:
    PopUp.vi ‏25 KB

Maybe you are looking for

  • Importing images edited in Photoshop into Iphoto

    Hi, I tend to use Photoshop elements and bridge as my initial repository for RAW format photos. I use Bridge and Elements to select photos for editing, and storing the edited .psd file. I also create a jpeg copy of the finished file, which I import i

  • 2012 RMBP HDMI to tv not working

    Bought in august. I connected it to my tv via HDMI cable to test it and it worked fine. I recently tried to plug it in and it goes to a black screen. it will occasionally show glitchey pieces of the desktop but most of the time i just get a black scr

  • I just switched from EXCEL to numbers and have a lot of problems

    Problem1.  I converted an excel spread sheet to Numbers.  The excel sheet subracted two dates to determine if date 1 was earlier or equal or later than date 2.  The result was used in an IF statement to take various actions in either of the three cas

  • Microsoft M60 Mouse

    I recently got the bluetooth version of the Microsoft M60 IntelliMouse explorer, but the forward and back buttons on the side wont work in Safari (or FireFox for that matter). There isnt any option to program those buttons anywhere that I can find, i

  • Sleep prevented by SB 0, SS 1, AS 1

    I ran into a situation this AM where 3 separate attempts to have my mid 2009 MBP sleep failed. Its running 10.6.3 I see these messages in kernel.log (and this is every message from the time period): May 7 05:39:14 mystic kernel[0]: CoreServicesUIAg[7