Adding a button at run time

I know that you can add components at run time (I've done it with a tree for instance) but how do you link a run time added component with an action handler?
For example, when you use the designer, you just double click on a button to get an action handler built that automatically gets called when the application is deployed and that button is clicked. Well, when you add a button at run time, you have no way of doing this.
Just how do you link a dynamic button to an action handler then?
Thanks

Hi,
I generate a table at runtime and also bind it to a dataprovider at runtime and display the records in a table. It works find and I have no problem with that.
I am trying to add a new column with the button in them, i generate the buttons at runtime. Even this works fine. Along with the data in the table i have the last column with all buttons.
I am having problem binding the method to the button at runtime. My code is something like this...
     for (int i = 0; i <= numOfCols ; i++) {
          //add the delete button as the first column
          if( i == 0 ){
          TableColumn column = new TableColumn();
          column.setHeaderText("Delete");
          Button st = new Button();
          st.setText("Del");
          st.setId("del");
          MethodBinding mb = (MethodBinding) context.getApplication().createMethodBinding("#{Page.delete_action}", null);
          st.setAction(mb);
          column.getChildren().add(st);
          getTableRowGroup1().getChildren().add(column);
          } else{
          TableColumn column = new TableColumn();
          column.setHeaderText(rsm.getColumnLabel(i));
          log("rsm.getColumnLabel("+i+"): "+rsm.getColumnLabel(i));
          column.setNoWrap(true);
          column.setSort(rsm.getColumnName(i));
          ValueBinding vb = app.createValueBinding("#{currentRow.value['" + rsm.getColumnName(i) + "']}");
          StaticText st = new StaticText();
          st.setValueBinding("text", vb);
          column.getChildren().add(st);
          getTableRowGroup1().getChildren().add(column);
public String delete_action() {
log("Inside delete_action().");
return null;
The method delete_action() is not called at all.
It would be appreciated if someone could help me with this problem of mine.
Thanks,
Adi.

Similar Messages

  • Hide radio button in run time

    Hi expert,
    kindly help me for hide radio button in run time for web dynpro kindly give me on example .
    thank's and regard's
    Vikash

    hi.
    For Visibility :
    ->  bind its Visible Property to the context of type WDUI_VISIBILITY.
    -> Now make it visible or invisible according to your requirement.
    using Code Wizard ( Control + F7) , Set the particular context.
    For visible Set as 02.
    For invisible Set as 01.
    code for your ref ( Generated using Code Wizard- Set the particular context attribute. )
    In below code : radiobutton is binded with CA_VIS of type WDUI_VISIBILITY
    DATA lo_el_context TYPE REF TO if_wd_context_element.
    DATA ls_context TYPE wd_this->element_context.
    DATA lv_ca_vis TYPE wd_this->element_context-ca_vis.
    get element via lead selection
    lo_el_context = wd_context->get_element( ).
    @TODO handle not set lead selection
    IF lo_el_context IS INITIAL.
    ENDIF.
    @TODO fill attribute
    lv_ca_vis = 1.
    set single attribute
    lo_el_context->set_attribute(
    name = `CA_VIS`
    value = 02 ).
    I hope it helps.
    Check the sample Wedbynpro Component WDR_TEST_events . This is having the complete UI element functionalities in WDA.
    Thanx.
    Edited by: Saurav Mago on May 1, 2009 1:53 PM

  • Adding new rows at run time in alv oops

    HI ALL,
    I have a created an editable alv report in oops. Now i have to add a new row having similar values as the previous row at run time when a custom button is clicked in the output and after entering some values in the new row and pressing the database must be updated and also the internal table at run time itself.
    for example let us suppose i have the following row in the alv output.
    MATNR                          DESCRIPTION                             NAME                             DATE
    001                                 TEST                                        MATRIKS                      10092001
    NOW if we click the custom button added on the alv toolbar, it should a new row at the run time similar to previous row as shown below
    MATNR                          DESCRIPTION                             NAME                             DATE
    001                                 TEST                                        MATRIKS                      10092001
    001                                 TEST                                        MATRIKS                      10092001 -> NEW ROW.
    can we do it in alv oops? pls let me know the soln or any helpful links
    thanks
    john

    Hi John,
       I dont think, you can find any method for that,
    one way what I can suggest is
    Get the selected row index.
    Insert the blank row in your internal table at this index
    Refresh the container.
    Hope  this will help.
    Thanks,
    Anmol.

  • Adding DVM values at run time

    Hi,
    I am trying to adding domain values to DVM at run time,
    it is getting added to DVM at that movement ,bt
    when i redeploy the service I am not able to see the changes.
    so help required regarding this

    Hello
    That is the solution to his problem, by the sounds of it when he redploys his code he gets the old values (the one in his code) if he migrates it to the MDS when he redeploys it won't change. This will seperate his deployment from run time configuration values which is a good idea.
    Best Regards Tristan

  • To enable iconic button at run time

    hi ,
    i have requirement regarding an iconic button could you please help me with the code
    i have taken the button style as iconic
    i have given a file to the icon with extension as .ico
    it was showing at deisn time but it was not diplaying at runtime
    could anyone plz help me with the coding to run at it runtime
    thanks & regards
    Prasad T

    hi
    i was using oracle forms 10g running it in web environment
    but when i give .gif
    it was not displaying even at the desin time
    could you provide me any alternative solution
    thanks
    Prasad.T

  • Adding new coloumns at run time in report

    hi friends,
    i wan to knw, how to add coloumns at runtime in the report.
    the requirement is like,,the user wll enter the cost center group in selection screen n i have to show all the cost elements in tht cost elements group as different coluomn, with the name of the costelement as the coloumn header.
    so it is not fixed tht how many coloumn wll be there in report.
    so plz help me out.
    good points wll be rewarded for helpful ans....
    thankx
    brij

    Hi John,
       I dont think, you can find any method for that,
    one way what I can suggest is
    Get the selected row index.
    Insert the blank row in your internal table at this index
    Refresh the container.
    Hope  this will help.
    Thanks,
    Anmol.

  • Checking dynamic query at run time

    i need to check whether the query is valid or not at run time. The query will be formed based on the column name, table name, and where clause. this query is purely a select statement. if column name and table names are diff then system should display an error msg. i have more than 10 tables and the table name will be selected from LOV. i should be allowed to enter the condition for where clause also ar run time and this condition column should also be validated.

    Hi,
    I think you only want to see if your select statement has compilation error or not because when you use dynamic statement it doesnt show the compilation erro if the statement has it or not. What you can do is add an item say "stmt" in your control block. change the property to multi record so that you can see multiple lines in that item and make the lenght say 2000. Now assign your statement into "stmt" for example
    :control_block.stmt := 'select ' || col1
                        || ','
                        || col2
                        || ','
                        || col3
                        || ' FROM '
                        || table
                        || ' where ' || conditionput this statement on any button on when-button-pressed trigger. When you will press the button on run time you will see the statement. Run that statement on sql*plus or toad and check if there is any problem in the statement.
    Hope this helps
    Ghulam

  • GETWA_NOT_ASSIGNED run time error_MIGO processing stock transport order

    Hi,
    I have an issue  in which I would like to ask for your comments / help.
    In MIGO, I type in the number of the stock transfer order and want to post a GI from the transit.Right efter I pressed the enter button, the run time error occurs.                                                                               
    "The termination occurred in the ABAP program "SAPLEINR" in "BETB_ERGAENZEN".
    The main program was "SAPLMIGO ".                                                                               
    The termination occurred in line 44 of the source code of the (Include)     
    program "LEINRF2N"                                                         
    of the source code of program "LEINRF2N" (when calling the editor 440). "
    Only the volumes and the delivery date have been changed in the stock transfer order since the last time it worked fine to post GI against this order. Does anyone have an idea what to check?    
    Thanks in advance.
    Esra

    The program has not been modified since 12.2007. A programmer debugged the PO and found out that the program compares two different condition types, lets say X and Y. In one position of the PO, another conditions type (KSCHL) was booked during the GI booking in MIGO. The program can not find a table which is XEBEFU and loops there. All other POs has X and the wrong PO has Y as condition type.
    Does this mean that the comparison of the conditions types are done between the one in the PO and the calculation schema in IMG? I don`t see the wrong one Y in the PO at the position 70.
    Thanks in advance,
    Esra

  • How do with change table cells from staticText1 to button1 in run time?

    I have two question:
    first: I think change table's cells from staticText to button in run time?
    how do?
    second: I think change table column's order in run time?how do?
    ex:
    =============change before===========
    name age
    wtu 22
    =============chnage after=============
    age name
    22 wtu
    thanks

    Try something like this:
    1. Drop a Table. By default it has three columns.
    2. Drop a button inside the third column. Set its id property to buttonInColumn3, and set its rendered property to false.
    3. Drop another button, this time outside the table. Set its id property to buttonOutsideTable.
    4. Double-click the buttonOutsideTable and make the method look as follows:
    public String buttonOutsideTable_action() {
    //switch the first two columns
    List cols = tableRowGroup1.getChildren();
    Object col = cols.remove(0);
    cols.add(1, col);
    //toggle between showing staticText3 and buttonInColumn3 (in the third column)
    staticText3.setRendered(!staticText3.isRendered());
    buttonInColumn3.setRendered(!buttonInColumn3.isRendered());
    return null;
    5. Run the application and click the button outside the table several times.

  • Adding panel into JDialog at run time problem

    Hi ,
    I am adding one component at a time into the jdialog at run time.
    What I do , when I launch jdialog instance first time I added one
    component into the jdialog. when OI press next button it removes this
    component and adding next one , but the problem is that is is not showing in the jdialog.
    Please give me any idea that
    How I can add component into jdialog at run time.
    Thaks In Advance.
    - vikas

    Hello,
    without source-code its difficult to understand where your problem is. The following sample code works 'fine':
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class AddCompoDialog extends JDialog {
         int compoCounter;
         public AddCompoDialog(){
              setLocationRelativeTo(null);
              setSize(300,300);
              JPanel mainPanel=new JPanel(new BorderLayout());
              JPanel buttonPanel =new JPanel();
              final JPanel compoPanel=new JPanel(new GridLayout(10,10));
              JButton newCompo=new JButton("add new Component");
              newCompo.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent e){
                        compoPanel.add(new JLabel("Compo #"+ ++compoCounter));
                        compoPanel.revalidate(); //Dont forget to relayout your container
              buttonPanel.add(newCompo);
              JButton close=new JButton("close Dialog");
              close.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent e) {
                        dispose();
              buttonPanel.add(close);
              mainPanel.add(buttonPanel,BorderLayout.NORTH);
              mainPanel.add(compoPanel);
              getContentPane().add(new JScrollPane(mainPanel));
         public static void main(String[] params) {
              new AddCompoDialog().setVisible(true);
    }Regards,
    Tim

  • Setting corect value in JTable while adding row @ run time

    HI All,
    Iam facing the following problems in Java Swing while using JTable..
    I have a JTable with 11 colums and i add row on run time..
    Since i needed the 11th column of the table to be of type CheckBox i used the follwing object in the DefaultTableModel class..
    Object[][] data =
                   {"1", "", "", "", "", "", new Double(0.0), new Integer(0), new Double(0.0), new Double(0.0),new Boolean(false) }
    When ever i wan't to delete a row i will click the Boolean Object ( which appears as a Check box ) and then delete that row.. For deleteing i am using 1 methods..
    1. By selecting the col by mouse and the click a button to delete the selected rows...
    2. By selecting the col by key board , using a Menu ShortCut key ( CTRL-F ) and then using the space key to on the value , then i use another Menu ShortCut key ( CTRL-D ) to delete all the selected rows..
    The above 2 methods work fine as for as deleting is concerned..
    But the problem starts while adding another row after deleting one or more rows..That 2 happens while the deletion had been done by the KEYBORD only..
    The problem is...
    If there is more than 1 rows and i select some rows of any order..And then delete them with the Keyboard option..and then add a rows , while adding the row @ the postion where the last row was deleted iam getting the 11th col. value ( which apears as a check box ) as selected..For example if there is 4 rows and i delete the 3rd and 4th row and then when i add rows its fine for the 3rd row and for the 4th row ( which was the last one which was slected to be deleted ) i get the option as a selected one..
    But while adding i use the above said Data object only..I then used the the
    JTablename.getValueAt(i,10); to print the value and iam geting false only..
    And more over when i try to focus in the cell in 1st row last column of the table by the setSelection method , the focus goes to the cell which appears to be enbled..
    My friends asked me to use the follwing methods before adding rows ..
    1. clearSelection()
    2. Validate()
    3. repaint()
    But the problem seems not over can anyone help....
    U can mail me to [email protected]
    Love,.
    Siva

    Yes, relatively easily, I think.
    In your end jump script set a second value in a different GPRM that identifies the last film played. This way the play all flag is set and you know which clip has just been seen.
    On resuming the play all you need to reset the play all flag to '1' and then look at the other GPRM to see which clip played last. Use a bunch of jump commands to get back in to the playback at the start of the next logical clip and it should continue through as before.
    The secret here is to clear the play all flag when showing a few clips, but use your 'resume play all' button to reset the flag and see where you were by reading the other GPRM.
    The downside here is that you could be in clip 3 when you exit the play all, but you would have to resume clip 3 from the start when you return as the 'Resume' info will get cleared if you start showing other clips in the mean time.
    Have you also considered setting up a video jukebox? You could then pick a selection of tracks to play in the order they were chosen and leave them to run through. This is a much trickier bit of scripting, but very possible!
    Stories could have made things easier, but given the set-up that you have built you can still get what you need from the scripting

  • How do I disable one item in a radio buttons control at run time

    I need to disable one item in a radio buttons control. At design time
    this is possible, but how do I do this at run time? Is this possible? I
    cannot find a property per item

    Use the property "Controls[ ]" - this gives you an array with references of each single button in the radio buttons control. These you can access with property nodes too.
    Hope this helps.
    Using LV8.0
    Don't be afraid to rate a good answer...

  • Setting the webservice url at run time for a execute button in adobe form

    Hi,
    I am using Data connection from the wsdl file to interact with the backend, the button generated from the data connection is of type execute which has the url of the webservice in the object property "Webservice URL" and name of the FM in the interface name. My problem is at present the form is working fine but when the same form transported to QA and PRD them the url of the webservice gets change. hence the same button wont function.
    The solution is either we do the changes manually in all the system or pass the url at run time. Please proide me the solution if there is a way to set this url in the execute button at runtime.
    Thanks in advance.
    Pooja

    Why don't you pass in the URL via an XML input file and bind a hidden text field in your form to that element in your XML? Then use javascript to modify the docReady event of the submit button to something like this:
    var url = textFieldWithURL.rawValue;
    this.event__click.submit.target = url;

  • Run time error when clicking on sum button

    Hi,
        I have used a field (data type-QUAN,length-10,Decimal Places-3)
    in an internal table. I have passed this table in 'REUSE_ALV_GRID_DISPLAY'.
        When I wan to see the 'sum' by clicking the button on the application tool bar , There is always a run time error.
        Please help as quick as possible.
    Regards,
    Sourav Paul.

    Hi,
    try following,
    DATA: GT_EVENTS TYPE SLIS_T_EVENT.
    INITIALIZATION.
    PERFORM BUILD_EVENTS CHANGING GT_EVENTS.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
               IT_EVENTS          = GT_EVENTS[]
        TABLES
          T_OUTTAB           = IFINAL.
    ENDFORM.                    " display_output
    FORM BUILD_EVENTS CHANGING GT_EVENTS TYPE SLIS_T_EVENT.
      DATA: LINE_EVENT TYPE SLIS_ALV_EVENT.
      CLEAR LINE_EVENT.
      LINE_EVENT-NAME = 'TOP_OF_PAGE'.
      LINE_EVENT-FORM = 'TOP_OF_PAGE'.
      APPEND LINE_EVENT TO GT_EVENTS.
    ENDFORM.                    "build_events
    Reward pts if usefull.
    Regards,
    Dhan

  • I am new at Captivate 8 and I have created a learning project using an existing power point presentation.  I have added a button that will allow my students to view a video on the subject.  When I run the project in Preview the button works but when I pub

    I am new at Captivate 8 and I have created a learning project using an existing power point presentation.  I have added a button that will allow my students to view a video on the subject.  When I run the project in Preview the button works but when I publish it, it stops working.

    I added an Interactions button and in the Actions on Success I open an URL or file. I have placed the video on our web server.   In the URL I point to our web server "http://www.wmabhs.org/Media/Add Client 3rd Party Coverage.mp4".  If I run this from any browser it works.  So what do you think I have done wrong?

Maybe you are looking for

  • New GR/IR account

    Hi Is it possible to have more than 1 GR/IR account? Looking at obyc, I know tha tthe GR/IR account assignment is driven by the internal SAP key ?WRX?. We have a situation in which the client wants a separate GR/IR account for a specific type of purc

  • File To Proxy : Handle the response from ECC to send mail without BPM

    Hi, Scenario: FILE To Proxy Requirement: We are receiving xml acknowledgement file from bank with IDoc number and status in SAP PI and the file is used to send the status number, message and and IDoc number to ECC. After request is received in ECC BA

  • Toshiba 500gig usb external HDD disconnects at the drop of a pin

    Hi, I have one of the new USB powered portable usb drives from Toshiba. It is a 500gig unit. It has worked flawlessly up until about the last couple weeks. Since this time is disconnects very easly and sometimes is not useable because it disconnects

  • Scope of ATP check (sales forecast)

    Hi gurus, I want to know whether the info from sales forecast can be take into account by using standard ATP check function? thanks.

  • BAPI's for Migration of data in SD module

    Hi All, I need to know BAPI's used for migrating data from legacy system to SAP, for the following SD scenario's. 1. Customer Master 2. Inquiries 3. Quotations 4. Proposals 5. Sales Order 6. Goods Issue Please send suitable answers. Regards, Sathya.